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!)
A331985 a(n) is the least positive k such that n AND floor(n/k) = 0 (where AND denotes the bitwise AND operator). 2

%I #10 Feb 05 2020 08:58:54

%S 1,2,2,4,2,2,4,8,2,2,2,12,4,5,8,16,2,2,2,4,2,2,12,24,4,4,5,6,8,10,16,

%T 32,2,2,2,4,2,2,4,40,2,2,2,9,12,16,24,48,4,4,4,4,5,5,6,56,8,9,10,12,

%U 16,21,32,64,2,2,2,4,2,2,4,8,2,2,2,16,4,26,40

%N a(n) is the least positive k such that n AND floor(n/k) = 0 (where AND denotes the bitwise AND operator).

%C This sequence has similarities with A261891; here we divide and round down, there we multiply, in order to obtain a number with no common bit with the original.

%H Rémy Sigrist, <a href="/A331985/b331985.txt">Table of n, a(n) for n = 0..8192</a>

%F a(n) = 2 iff n is a positive Fibbinary number (A003714).

%e For n = 3:

%e - 3 AND floor(3/1) = 3,

%e - 3 AND floor(3/2) = 1,

%e - 3 AND floor(3/3) = 1,

%e - 3 AND floor(3/4) = 0,

%e - hence a(3) = 4.

%o (PARI) a(n) = for (k=1, oo, if (bitand(n,n\k)==0, return (k)))

%Y Cf. A003714, A261891, A332011.

%K nonn,base

%O 0,2

%A _Rémy Sigrist_, Feb 03 2020

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