Almost prime: Difference between revisions
Content deleted Content added
imported>Maxima enthusiast |
Add Easylang |
||
Line 2,083: | Line 2,083: | ||
k = 4: 16 24 36 40 54 56 60 81 84 88 |
k = 4: 16 24 36 40 54 56 60 81 84 88 |
||
k = 5: 32 48 72 80 108 112 120 162 168 176</pre> |
k = 5: 32 48 72 80 108 112 120 162 168 176</pre> |
||
=={{header|EasyLang}}== |
|||
{{trans|FreeBASIC}} |
|||
<syntaxhighlight lang=easylang> |
|||
func kprime n k . |
|||
i = 2 |
|||
while i <= n |
|||
while n mod i = 0 |
|||
if f = k |
|||
return 0 |
|||
. |
|||
f += 1 |
|||
n /= i |
|||
. |
|||
i += 1 |
|||
. |
|||
if f = k |
|||
return 1 |
|||
. |
|||
return 0 |
|||
. |
|||
for k = 1 to 5 |
|||
write "k=" & k & " : " |
|||
i = 2 |
|||
c = 0 |
|||
while c < 10 |
|||
if kprime i k = 1 |
|||
write i & " " |
|||
c += 1 |
|||
. |
|||
i += 1 |
|||
. |
|||
print "" |
|||
. |
|||
</syntaxhighlight> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |