Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
38
Task/Fusc-sequence/Ring/fusc-sequence.ring
Normal file
38
Task/Fusc-sequence/Ring/fusc-sequence.ring
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Project: Fusc sequence
|
||||
|
||||
max = 60
|
||||
fusc = list(36000)
|
||||
fusc[1] = 1
|
||||
see "working..." + nl
|
||||
see "wait for done..." + nl
|
||||
see "The first 61 fusc numbers are:" + nl
|
||||
fuscseq(max)
|
||||
see "0"
|
||||
for m = 1 to max
|
||||
see " " + fusc[m]
|
||||
next
|
||||
|
||||
see nl
|
||||
see "The fusc numbers whose length > any previous fusc number length are:" + nl
|
||||
see "Index Value" + nl
|
||||
see " 0 0" + nl
|
||||
d = 10
|
||||
for i = 1 to 36000
|
||||
if fusc[i] >= d
|
||||
see " " + i + " " + fusc[i] + nl
|
||||
if d = 0
|
||||
d = 1
|
||||
ok
|
||||
d = d*10
|
||||
ok
|
||||
next
|
||||
see "done..." + nl
|
||||
|
||||
func fuscseq(max)
|
||||
for n = 2 to 36000
|
||||
if n%2 = 1
|
||||
fusc[n] = fusc[(n-1)/2] + fusc[(n+1)/2]
|
||||
but n%2 = 0
|
||||
fusc[n] = fusc[n/2]
|
||||
ok
|
||||
next
|
||||
Loading…
Add table
Add a link
Reference in a new issue