Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Hofstadter-Q-sequence/BCPL/hofstadter-q-sequence.bcpl
Normal file
15
Task/Hofstadter-Q-sequence/BCPL/hofstadter-q-sequence.bcpl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
get "libhdr"
|
||||
|
||||
let start() be
|
||||
$( let Q = vec 1000
|
||||
Q!1 := 1
|
||||
Q!2 := 1
|
||||
|
||||
for n = 3 to 1000 do
|
||||
Q!n := Q!(n-Q!(n-1)) + Q!(n-Q!(n-2))
|
||||
|
||||
writes("The first 10 terms are:")
|
||||
for n = 1 to 10 do writef(" %N", Q!n)
|
||||
|
||||
writef("*NThe 1000th term is: %N*N", Q!1000)
|
||||
$)
|
||||
Loading…
Add table
Add a link
Reference in a new issue