RosettaCodeData/Task/Fusc-sequence/EasyLang/fusc-sequence.easy

31 lines
523 B
Text
Raw Permalink Normal View History

2024-04-19 16:56:29 -07:00
FUSCMAX = 20000000
len fusc[] FUSCMAX + 1
#
2026-02-01 16:33:20 -08:00
fastproc fill .
fusc[1] = 1
for n = 2 to FUSCMAX
if n mod 2 = 0
fusc[n] = fusc[n / 2]
else
fusc[n] = fusc[(n - 1) / 2] + fusc[(n + 1) / 2]
.
2024-04-19 16:56:29 -07:00
.
.
2026-02-01 16:33:20 -08:00
fill
write "0 "
for n = 1 to 60 : write fusc[n] & " "
2024-04-19 16:56:29 -07:00
print ""
print ""
2026-02-01 16:33:20 -08:00
start = 1
print "fusc[0] = 0"
for i = 1 to 5
val = floor pow 10 i
2024-04-19 16:56:29 -07:00
for j = start to FUSCMAX
if fusc[j] > val
print "fusc[" & j & "] = " & fusc[j]
start = j
break 1
.
.
.