Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
38
Task/Fusc-sequence/Quackery/fusc-sequence.quackery
Normal file
38
Task/Fusc-sequence/Quackery/fusc-sequence.quackery
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
[ 1 & ] is odd ( n --> b )
|
||||
|
||||
[ 0 swap
|
||||
[ dip 1+
|
||||
10 / dup
|
||||
0 = until ]
|
||||
drop ] is digits ( n --> n )
|
||||
|
||||
[ dup dup size
|
||||
dup odd iff
|
||||
[ dup 1 - 2 /
|
||||
dip
|
||||
[ 1 + 2 / peek
|
||||
over ]
|
||||
peek + ]
|
||||
else
|
||||
[ 2 / peek ]
|
||||
join ] is nextfusc ( [ --> [ )
|
||||
|
||||
say "First 61 terms." cr
|
||||
' [ 0 1 ]
|
||||
59 times nextfusc
|
||||
witheach [ echo sp ]
|
||||
cr cr
|
||||
say "Terms where the digit count increases." cr
|
||||
say "fusc(0) = 0" cr
|
||||
1 ' [ 0 1 ]
|
||||
[ nextfusc
|
||||
dup -1 peek digits
|
||||
rot 2dup > iff
|
||||
[ drop swap
|
||||
say "fusc("
|
||||
dup -1 peek echo
|
||||
say ") = "
|
||||
dup size 1 - echo cr ]
|
||||
else [ nip swap ]
|
||||
dup size 1000000 = until ]
|
||||
2drop
|
||||
Loading…
Add table
Add a link
Reference in a new issue