A005132Recamán's sequence (or Recaman's sequence): a(0) = 0; for n > 0, a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.
0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, …
The first 2 terms appear at position 167.
…5358979323846264338327950288419716939937510582097…
…59408128481117450284102701938521105559644622948954…
…947826848260147699090264013639443745530506820349625…
…9478268482601476990902640136394437455305068203496252…
…86035529533292457523888101362023476246690558164389678…
…650536877318647994501208013627596942246481664909607919…
…61170709889409803582170601362713290455426473174902218708…
| terms | string | first position | occurrences |
|---|---|---|---|
| 1 | 0 | 32 | 99,993,942 |
| 2 | 01 | 167 | 9,998,250 |
| 3 | 013 | 2,079 | 1,000,932 |
| 4 | 0136 | 2,079 | 100,221 |
| 5 | 01362 | 27,754 | 9,938 |
| 6 | 013627 | 8,358,632 | 940 |
| 7 | 01362713 | 376,501,687 | 14 |
| 8 | 0136271320 | not within 1,000,000,000 | 0 |
| 9 | 013627132012 | not within 1,000,000,000 | 0 |
Searched the first 1,000,000,000 digits. Strings longer than 12 digits are not indexed.