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.

A199402 Binary XOR of 2^k - (-1)^k as k varies from 1 to n.

This page as a plain text file.
%I A199402 #11 Jan 10 2015 09:16:53
%S A199402 3,0,9,6,39,24,153,102,615,408,2457,1638,9831,6552,39321,26214,157287,
%T A199402 104856,629145,419430,2516583,1677720,10066329,6710886,40265319,
%U A199402 26843544,161061273,107374182,644245095,429496728,2576980377,1717986918,10307921511,6871947672
%N A199402 Binary XOR of 2^k - (-1)^k as k varies from 1 to n.
%C A199402 a(n) is divisible by 3; compare to A199403.
%H A199402 Alois P. Heinz, <a href="/A199402/b199402.txt">Table of n, a(n) for n = 1..1000</a>
%F A199402 G.f.: 3*(2*x^3-x^2+1)*x/(4*x^6-x^4-4*x^2+1). - _Alois P. Heinz_, Nov 05 2011
%e A199402 a(2) = 2^1+1 XOR 2^2-1 = 3 XOR 3 = 0;
%e A199402 a(3) = 2^1+1 XOR 2^2-1 XOR 2^3+1 = 3 XOR 3 XOR 9 = 9;
%e A199402 a(4) = 2^1+1 XOR 2^2-1 XOR 2^3+1 XOR 2^4-1 = 3 XOR 3 XOR 9 XOR 15 = 6.
%p A199402 a:= n-> (<<0|1|0>, <0|0|1>, <-4|1|4>>^iquo(n-1, 2, 'r'). `if`(r=0, <<3, 9, 39>>, <<0, 6, 24>>))[1, 1]: seq(a(n), n=1..100);  # _Alois P. Heinz_, Nov 05 2011
%o A199402 (PARI) {a(n)=if(n<0,0,bitxor(a(n-1),2^n-(-1)^n))}
%Y A199402 Cf. A199403.
%K A199402 nonn
%O A199402 1,1
%A A199402 _Paul D. Hanna_, Nov 05 2011