login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A199402 Binary XOR of 2^k - (-1)^k as k varies from 1 to n. 3

%I #11 Jan 10 2015 09:16:53

%S 3,0,9,6,39,24,153,102,615,408,2457,1638,9831,6552,39321,26214,157287,

%T 104856,629145,419430,2516583,1677720,10066329,6710886,40265319,

%U 26843544,161061273,107374182,644245095,429496728,2576980377,1717986918,10307921511,6871947672

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

%C a(n) is divisible by 3; compare to A199403.

%H Alois P. Heinz, <a href="/A199402/b199402.txt">Table of n, a(n) for n = 1..1000</a>

%F 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 a(2) = 2^1+1 XOR 2^2-1 = 3 XOR 3 = 0;

%e a(3) = 2^1+1 XOR 2^2-1 XOR 2^3+1 = 3 XOR 3 XOR 9 = 9;

%e 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 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 (PARI) {a(n)=if(n<0,0,bitxor(a(n-1),2^n-(-1)^n))}

%Y Cf. A199403.

%K nonn

%O 1,1

%A _Paul D. Hanna_, Nov 05 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 06:04 EDT 2024. Contains 371906 sequences. (Running on oeis4.)