The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A116361 Smallest k such that n XOR n*2^k = n*(2^k + 1). 9

%I #11 Nov 19 2021 04:41:03

%S 0,1,1,2,1,1,2,3,1,1,1,4,2,4,3,4,1,1,1,2,1,1,4,5,2,2,4,5,3,5,4,5,1,1,

%T 1,2,1,1,2,6,1,1,1,6,4,4,5,6,2,2,2,2,4,6,5,6,3,6,5,6,4,6,5,6,1,1,1,2,

%U 1,1,2,3,1,1,1,4,2,5,6,7,1,1,1,7,1,1,6,7,4,5,4,7,5,5,6,7,2,2,2,2,2,7,2,7,4

%N Smallest k such that n XOR n*2^k = n*(2^k + 1).

%C a(A003714(n)) <= 1;

%C a(A048716(n)) <= 2;

%C a(A115845(n)) <= 3;

%C a(A115847(n)) <= 4;

%C a(A114086(n)) <= 5;

%C a(A116362(n)) = n and a(m) < n for m < A116362(n).

%H Charles R Greathouse IV, <a href="/A116361/b116361.txt">Table of n, a(n) for n = 0..10000</a>

%t a[n_] := Module[{k}, For[k = 0, True, k++,

%t If[BitXor[n, n*2^k] == n*(2^k+1), Return[k]]]];

%t Table[a[n], {n, 0, 104}] (* _Jean-François Alcover_, Nov 19 2021 *)

%o (PARI) a(n)=my(k);while(bitxor(n,n<<k)-n!=n<<k,k++);k \\ _Charles R Greathouse IV_, Mar 07 2013

%K nonn,easy

%O 0,4

%A _Reinhard Zumkeller_, Feb 04 2006

%E Offset corrected by _Charles R Greathouse IV_, Mar 07 2013

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 May 16 12:10 EDT 2024. Contains 372552 sequences. (Running on oeis4.)