Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
30
Task/Fusc-sequence/Yabasic/fusc-sequence.basic
Normal file
30
Task/Fusc-sequence/Yabasic/fusc-sequence.basic
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
maximo = 20000000
|
||||
dim f(maximo)
|
||||
|
||||
fusc()
|
||||
|
||||
for i = 0 to 60
|
||||
print f(i), " ";
|
||||
next i
|
||||
|
||||
print "\n\n Index Value"
|
||||
d = 0
|
||||
for i = 0 to maximo-1
|
||||
if f(i) >= d then
|
||||
print i using "###,###,###", f(i) using "###,###,###"
|
||||
if d = 0 d = 1
|
||||
d = d * 10
|
||||
end if
|
||||
next i
|
||||
end
|
||||
|
||||
sub fusc()
|
||||
f(0) = 0 : f(1) = 1
|
||||
for n = 2 to maximo-1
|
||||
if mod(n, 2) then
|
||||
f(n) = f((n-1) / 2) + f((n+1) / 2)
|
||||
else
|
||||
f(n) = f(n / 2)
|
||||
end if
|
||||
next n
|
||||
end sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue