Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Fusc-sequence/M2000-Interpreter/fusc-sequence-1.m2000
Normal file
13
Task/Fusc-sequence/M2000-Interpreter/fusc-sequence-1.m2000
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
module Fusc_sequence (max as long) {
|
||||
long n, max_len=-1, m
|
||||
string fmt="#,##0", fs="{0:-10} : {1}"
|
||||
dim f(0 to max) as long
|
||||
f(0)=0, 1
|
||||
for n=2 To max{If binary.and(n,1) Then f(n)=f((n-1)/2)+f((n+1)/2) else f(n)=f(n/2)}
|
||||
print "First 61 terms:"
|
||||
print "["+f()#slice(0,60)#str$(", ")+"]"
|
||||
print "Points in the sequence where an item has more digits than any previous items:"
|
||||
print format$(fs, "index", "value")
|
||||
for n=0 to max{if f(n)>=max_len then m++:max_len=10&**m:print format$(fs,str$(n,fmt),str$(f(n),fmt)):refresh}
|
||||
}
|
||||
Fusc_sequence 700000
|
||||
Loading…
Add table
Add a link
Reference in a new issue