Please in order to save solutions and appear on the leaderboards.

Recamán Authors

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 solution
All
Compiled from AT&T syntax to x86-64 Linux. Use syscalls to write output.
ctrl + enter or

Delete Solution

Are you sure you want to delete your solution(s) for Recamán?

If you have seperate bytes and chars solutions then both will be deleted.

This is irreversible, please backup any code you care about.

Type I understand and press confirm to continue.