login
A100892
a(n) = (2*n-1) XOR (2*n+1), bitwise.
3
2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 62, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 126, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 62, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 254, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 62, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2
OFFSET
1,1
LINKS
FORMULA
a(n) = 2 * ((n-1) XOR n) = 2*A038712(n).
a(n) = 4*2^A007814(n) - 2.
Recurrence: a(2n) = 2a(n) + 2, a(2n+1) = 2. - Ralf Stephan, Aug 21 2013
a(n) = A088837(n) - 1. - Filip Zaludek, Dec 10 2016
a(n) = A074400(n)/A000593(n) = 2*A000203(n)/A000593(n). - Ivan N. Ianakiev, Jul 04 2019
MATHEMATICA
a[n_]:=BitXor[2*n-1, 2*n+1]; a/@Range[100] (* Ivan N. Ianakiev, Jul 04 2019 *)
PROG
(PARI) a(n)=4*2^valuation(n, 2)-2; \\ Ralf Stephan, Aug 21 2013
(Haskell)
a100892 n = (2 * n - 1) `xor` (2 * n + 1)
a100892_list = zipWith xor (tail a005408_list) a005408_list
-- Reinhard Zumkeller, Sep 03 2013
(Python)
def A100892(n): return ((~n& n-1)<<2)+2 # Chai Wah Wu, Jul 07 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 10 2005
STATUS
approved