Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
10
Task/Hofstadter-Q-sequence/SETL/hofstadter-q-sequence.setl
Normal file
10
Task/Hofstadter-Q-sequence/SETL/hofstadter-q-sequence.setl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
program hofstadter_q;
|
||||
q := [1,1];
|
||||
loop for n in [3..100000] do
|
||||
q(n) := q(n-q(n-1)) + q(n-q(n-2));
|
||||
end loop;
|
||||
|
||||
print("First 10 terms: " + q(1..10));
|
||||
print("1000th term: " + q(1000));
|
||||
print("q(x) < q(x-1): " + #[x : x in [2..#q] | q(x) < q(x-1)]);
|
||||
end program;
|
||||
Loading…
Add table
Add a link
Reference in a new issue