Recamans sequence

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

A005132

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

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.

Sample output:

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 42, 17, 43, 16, 44, 15, 45, 14, 46, 79, 113, 78, 114, 77, 39, 78, 38, 79, 37, 80, 36, 81, 35, 82, 34, 83, 33, 84, 32, 85, 31, 86, 30, 87, 29, 88, 28, 89, 27, 90, 26, 91, 157, 224, 156, 225, 155

Ranking

JavaScript _

RankUserSizeTimeDateStatistics
1teebee600.02152026/08/22 05:37:140B / 29B / 30B
2JOrE20710.01922026/08/21 22:26:130B / ?B / ?B
3JOrE20 (please use newline-separated format instead)2390.02832026/08/21 22:32:290B / ?B / ?B

C _

RankUserSizeTimeDateStatistics
1chocobi890.01372026/08/22 07:00:020B / 42B / 46B

Nibbles _

RankUserSizeTimeDateStatistics
1whio180.00922026/08/30 03:09:098B / 9B / 1B

Language Ranking_

RankLangUserSizeScore
1Nibbleswhio1810000
2JavaScriptteebee603000
3Cchocobi892022

return to the top page