login
A160357
Sign of first differences of Recamán's sequence A005132.
11
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
OFFSET
0,1
FORMULA
a(n) = sign(A005132(n)-A005132(n-1)) = sign(A160356(n)) = (-1)^A160351(n) = -(-1)^A076213(n-1).
a(n) = (A005132(n)-A005132(n-1))/n. - N. J. A. Sloane, Jul 15 2011
A160357 = chi_A057165 - chi_A057166, where chi_A denotes the characteristic function of (the set of values of) A.
MAPLE
A160357 := proc(n)
sign( A005132(n)-A005132(n-1)) ;
end proc: # R. J. Mathar, Apr 01 2012
MATHEMATICA
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 *)
CROSSREFS
Sequence in context: A186032 A212157 A131554 * A186039 A332433 A376139
KEYWORD
sign
AUTHOR
M. F. Hasler, Jun 03 2009
EXTENSIONS
a(0)=1 added by N. J. A. Sloane, May 01 2020
STATUS
approved