

A331985


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


2



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, 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, 16, 21, 32, 64, 2, 2, 2, 4, 2, 2, 4, 8, 2, 2, 2, 16, 4, 26, 40
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,2


COMMENTS

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.


LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..8192


FORMULA

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


EXAMPLE

For n = 3:
 3 AND floor(3/1) = 3,
 3 AND floor(3/2) = 1,
 3 AND floor(3/3) = 1,
 3 AND floor(3/4) = 0,
 hence a(3) = 4.


PROG

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


CROSSREFS

Cf. A003714, A261891, A332011.
Sequence in context: A115070 A064145 A213431 * A261891 A321320 A175462
Adjacent sequences: A331982 A331983 A331984 * A331986 A331987 A331988


KEYWORD

nonn,base


AUTHOR

Rémy Sigrist, Feb 03 2020


STATUS

approved



