editing
approved
editing
approved
T. D. Noe, <a href="/A160357/b160357.txt">Table of n, a(n) for n = 10..10000</a>
approved
editing
editing
approved
1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1
1,0,1
a(0)=1 added by N. J. A. Sloane, May 01 2020
approved
editing
proposed
approved
editing
proposed
f[s_List] := Module[{a = s[[-1]], n = Length[s]}, Append[s, If[a > n && FreeQ[s, a - n], a - n, a + n]]];
Nest[f, {0}, 100] // Differences // Sign (* Jean-François Alcover, Apr 19 2020, using Robert G. Wilson v's code for A005132 *)
approved
editing
proposed
approved
editing
proposed
Sign of first differences of RecamanRecamán's sequence A005132.
approved
editing