Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Hofstadter-Q-sequence/Picat/hofstadter-q-sequence.picat
Normal file
11
Task/Hofstadter-Q-sequence/Picat/hofstadter-q-sequence.picat
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
go =>
|
||||
println([q(I) : I in 1..10]),
|
||||
println(q1000=q(1000)),
|
||||
Q = {q(I) : I in 1..100_000},
|
||||
println(flips=sum({1 : I in 2..100_000, Q[I-1] > Q[I]})),
|
||||
nl.
|
||||
|
||||
table
|
||||
q(1) = 1.
|
||||
q(2) = 1.
|
||||
q(N) = q(N-q(N-1)) + q(N-q(N-2)).
|
||||
Loading…
Add table
Add a link
Reference in a new issue