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!)
A100892 a(n) = (2*n-1) XOR (2*n+1), bitwise. 3

%I #31 Jul 08 2022 08:23:14

%S 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,

%T 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,

%U 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

%N a(n) = (2*n-1) XOR (2*n+1), bitwise.

%H Reinhard Zumkeller, <a href="/A100892/b100892.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = 2 * ((n-1) XOR n) = 2*A038712(n).

%F a(n) = 4*2^A007814(n) - 2.

%F Recurrence: a(2n) = 2a(n) + 2, a(2n+1) = 2. - _Ralf Stephan_, Aug 21 2013

%F a(n) = A088837(n) - 1. - _Filip Zaludek_, Dec 10 2016

%F a(n) = A074400(n)/A000593(n) = 2*A000203(n)/A000593(n). - _Ivan N. Ianakiev_, Jul 04 2019

%t a[n_]:=BitXor[2*n-1,2*n+1]; a/@Range[100] (* _Ivan N. Ianakiev_, Jul 04 2019 *)

%o (PARI) a(n)=4*2^valuation(n,2)-2; \\ _Ralf Stephan_, Aug 21 2013

%o (Haskell)

%o a100892 n = (2 * n - 1) `xor` (2 * n + 1)

%o a100892_list = zipWith xor (tail a005408_list) a005408_list

%o -- _Reinhard Zumkeller_, Sep 03 2013

%o (Python)

%o def A100892(n): return ((~n& n-1)<<2)+2 # _Chai Wah Wu_, Jul 07 2022

%Y Cf. A006519, A099820, A007088.

%Y Cf. A005408.

%K nonn

%O 1,1

%A _Reinhard Zumkeller_, Jan 10 2005

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 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)