Recamán
Details
Starting from a(0) = 0, each term of the sequence is a(n) = a(n-1) − n but only if a(n) > 0 and it has not previously generated. In case the condition doesn't hold, a(n) = a(n-1) + n.
Print the first 250 terms of the sequence one per line.
0 bytes, 0 chars
Restore solutionCompiled from
AT&T syntax to x86-64 Linux. Use
syscalls to write output.
Arturo is an experimental language, no solutions will be saved.
Please leave feedback on the
GitHub issue.
Fennel is an experimental language, no solutions will be saved.
Please leave feedback on the
GitHub issue.
Uiua is an experimental language, no solutions will be saved.
Please leave feedback on the
GitHub issue.
ctrl + enter or