Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Fusc-sequence/BASIC256/fusc-sequence.basic
Normal file
32
Task/Fusc-sequence/BASIC256/fusc-sequence.basic
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
global f, max
|
||||
max = 36000
|
||||
dim f(max)
|
||||
|
||||
call fusc()
|
||||
|
||||
for i = 0 to 60
|
||||
print f[i]; " ";
|
||||
next i
|
||||
|
||||
print : print
|
||||
print " Index Value"
|
||||
d = 0
|
||||
for i = 0 to max-1
|
||||
if f[i] >= d then
|
||||
print rjust(string(i),10," "), rjust(string(f[i]),10," ")
|
||||
if d = 0 then d = 1
|
||||
d *= 10
|
||||
end if
|
||||
next i
|
||||
end
|
||||
|
||||
subroutine fusc()
|
||||
f[0] = 0 : f[1] = 1
|
||||
for n = 2 to max-1
|
||||
if (n mod 2) then
|
||||
f[n] = f[(n-1)/2] + f[(n+1)/2]
|
||||
else
|
||||
f[n] = f[n/2]
|
||||
end if
|
||||
next n
|
||||
end subroutine
|
||||
Loading…
Add table
Add a link
Reference in a new issue