Ludic numbers: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(Added Easylang) |
||
Line 1,407: | Line 1,407: | ||
=={{header|Delphi}}== |
=={{header|Delphi}}== |
||
See [https://rosettacode.org/wiki/Ludic_numbers#Pascal Pascal]. |
See [https://rosettacode.org/wiki/Ludic_numbers#Pascal Pascal]. |
||
=={{header|EasyLang}}== |
|||
{{trans|Nim}} |
|||
<syntaxhighlight> |
|||
proc initLudicArray n . res[] . |
|||
len res[] n |
|||
res[1] = 1 |
|||
for i = 2 to n |
|||
k = 0 |
|||
for j = i - 1 downto 2 |
|||
k = k * res[j] div (res[j] - 1) + 1 |
|||
. |
|||
res[i] = k + 2 |
|||
. |
|||
. |
|||
initLudicArray 2005 arr[] |
|||
for i = 1 to 25 |
|||
write arr[i] & " " |
|||
. |
|||
print "" |
|||
print "" |
|||
i = 1 |
|||
while arr[i] <= 1000 |
|||
cnt += 1 |
|||
i += 1 |
|||
. |
|||
print cnt |
|||
print "" |
|||
for i = 2000 to 2005 |
|||
write arr[i] & " " |
|||
. |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
1 2 3 5 7 11 13 17 23 25 29 37 41 43 47 53 61 67 71 77 83 89 91 97 107 |
|||
142 |
|||
21475 21481 21487 21493 21503 21511 |
|||
</pre> |
|||
=={{header|Eiffel}}== |
=={{header|Eiffel}}== |