cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A160357 Sign of first differences of Recamán's sequence A005132.

This page as a plain text file.
%I A160357 #20 May 01 2020 22:25:02
%S A160357 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,
%T A160357 -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,
%U A160357 -1,1,-1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1
%N A160357 Sign of first differences of Recamán's sequence A005132.
%H A160357 T. D. Noe, <a href="/A160357/b160357.txt">Table of n, a(n) for n = 0..10000</a>
%F A160357 a(n) = sign(A005132(n)-A005132(n-1)) = sign(A160356(n)) = (-1)^A160351(n) = -(-1)^A076213(n-1).
%F A160357 a(n) = (A005132(n)-A005132(n-1))/n. - _N. J. A. Sloane_, Jul 15 2011
%F A160357 A160357 = chi_A057165 - chi_A057166, where chi_A denotes the characteristic function of (the set of values of) A.
%p A160357 A160357 := proc(n)
%p A160357         sign( A005132(n)-A005132(n-1)) ;
%p A160357 end proc: # _R. J. Mathar_, Apr 01 2012
%t A160357 f[s_List] := Module[{a = s[[-1]], n = Length[s]}, Append[s, If[a > n && FreeQ[s, a - n], a - n, a + n]]];
%t A160357 Nest[f, {0}, 100] // Differences // Sign (* _Jean-François Alcover_, Apr 19 2020, using _Robert G. Wilson v_'s code for A005132 *)
%Y A160357 Cf. A005132, A119632.
%K A160357 sign
%O A160357 0,1
%A A160357 _M. F. Hasler_, Jun 03 2009
%E A160357 a(0)=1 added by _N. J. A. Sloane_, May 01 2020