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.

A055975 First differences of A003188 (decimal equivalent of the Gray Code).

This page as a plain text file.
%I A055975 #47 Mar 12 2023 16:25:38
%S A055975 1,2,-1,4,1,-2,-1,8,1,2,-1,-4,1,-2,-1,16,1,2,-1,4,1,-2,-1,-8,1,2,-1,
%T A055975 -4,1,-2,-1,32,1,2,-1,4,1,-2,-1,8,1,2,-1,-4,1,-2,-1,-16,1,2,-1,4,1,-2,
%U A055975 -1,-8,1,2,-1,-4,1,-2,-1,64,1,2,-1,4,1,-2,-1,8,1,2,-1,-4,1,-2,-1,16,1,2,-1,4,1,-2,-1,-8,1,2,-1,-4,1,-2,-1,-32,1,2,-1,4
%N A055975 First differences of A003188 (decimal equivalent of the Gray Code).
%C A055975 Multiplicative with a(2^e) = 2^e, a(p^e) = (-1)^((p^e-1)/2) otherwise. - _Mitch Harris_, May 17 2005
%C A055975 a(A091072(n)) > 0; a(A091067(n)) < 0. - _Reinhard Zumkeller_, Apr 28 2012
%C A055975 In the binary representation of n, clear everything left of the least significant 1 bit, and negate if the bit left of it was set originally. - _Ralf Stephan_, Aug 23 2013
%C A055975 This sequence is the trace of n in the minimal alternating binary representation of n (defined at A256696). - _Clark Kimberling_, Apr 07 2015
%H A055975 Reinhard Zumkeller, <a href="/A055975/b055975.txt">Table of n, a(n) for n = 1..10000</a>
%H A055975 N. J. A. Sloane, <a href="/transforms.txt">Transforms</a>
%H A055975 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A055975 a(2n) = 2a(n), a(2n+1) = (-1)^n. G.f. sum(k>=0, 2^k*t/(1+t^2), t=x^2^k). a(n) = 2^A007814(n) * (-1)^((n/2^A007814(n)-1)/2). - _Ralf Stephan_, Oct 29 2003
%F A055975 a((2*n-1)*2^p) = (-1)^(n+1)*2^p, p >= 0. - _Johannes W. Meijer_, Jan 27 2013
%e A055975 Since A003188 is 0, 1,  3, 2, 6,  7,  5, 4, 12, 13, 15, 14, 10, ...,
%e A055975 sequence begins  1, 2, -1, 4, 1, -2, -1, 8,  1,  2, -1,  4, ... .
%p A055975 nmax:=100: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := (-1)^(n+1)*2^p od: od: seq(a(n), n=1..nmax); # _Johannes W. Meijer_, Jan 27 2013
%t A055975 f[n_]:=BitXor[n,Floor[n/2]];Differences[Array[f,120,0]] (* _Harvey P. Dale_, Jul 18 2011, applying _Robert G. Wilson v_'s program from A003188 *)
%o A055975 (PARI)
%o A055975 a(n)=((-1)^((n/2^valuation(n,2)-1)/2)*2^valuation(n,2)) \\ _Ralf Stephan_
%o A055975 (Haskell)
%o A055975 a055975 n = a003188 n - a003188 (n-1)
%o A055975 a055975_list = zipWith (-) (tail a003188_list) a003188_list
%o A055975 -- _Reinhard Zumkeller_, Apr 28 2012
%o A055975 (Python)
%o A055975 def A055975(n): return (n^(n>>1))-((n-1)^(n-1>>1)) # _Chai Wah Wu_, Jun 29 2022
%Y A055975 Cf. A003188, A006519 (unsigned), A007814.
%Y A055975 MASKTRANSi transform of A053644 (conjectural).
%Y A055975 Cf. A119972, A119974, A220466.
%K A055975 easy,nice,sign,mult
%O A055975 1,2
%A A055975 _Alford Arnold_, Jul 22 2000
%E A055975 More terms from Larry Reeves (larryr(AT)acm.org), Sep 05 2000