login
This site is supported by donations 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
3, 0, 9, 6, 39, 24, 153, 102, 615, 408, 2457, 1638, 9831, 6552, 39321, 26214, 157287, 104856, 629145, 419430, 2516583, 1677720, 10066329, 6710886, 40265319, 26843544, 161061273, 107374182, 644245095, 429496728, 2576980377, 1717986918, 10307921511, 6871947672 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

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

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..1000

FORMULA

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

EXAMPLE

a(2) = 2^1+1 XOR 2^2-1 = 3 XOR 3 = 0;

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

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.

MAPLE

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

PROG

(PARI) {a(n)=if(n<0, 0, bitxor(a(n-1), 2^n-(-1)^n))}

CROSSREFS

Cf. A199403.

Sequence in context: A104780 A176109 A291252 * A011083 A197689 A201942

Adjacent sequences:  A199399 A199400 A199401 * A199403 A199404 A199405

KEYWORD

nonn

AUTHOR

Paul D. Hanna, Nov 05 2011

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified January 20 10:23 EST 2018. Contains 297960 sequences.