Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Fusc-sequence/Arturo/fusc-sequence.arturo
Normal file
27
Task/Fusc-sequence/Arturo/fusc-sequence.arturo
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
fusc: function [n][
|
||||
if? or? n=0 n=1 -> n
|
||||
else [
|
||||
if? 0=n%2 -> fusc n/2
|
||||
else -> (fusc (n-1)/2) + fusc (n+1)/2
|
||||
]
|
||||
]
|
||||
|
||||
print "The first 61 Fusc numbers:"
|
||||
print map 0..61 => fusc
|
||||
|
||||
print "\nThe Fusc numbers whose lengths are greater than those of previous Fusc numbers:"
|
||||
print " n fusc(n)"
|
||||
print "--------- ---------"
|
||||
maxLength: 0
|
||||
|
||||
loop 0..40000 'i [
|
||||
f: fusc i
|
||||
l: size to :string f
|
||||
if l > maxLength [
|
||||
maxLength: l
|
||||
print [
|
||||
pad to :string i 9
|
||||
pad to :string f 9
|
||||
]
|
||||
]
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue