OFFSET
0,3
COMMENTS
This sequence is well defined: for any n such that n < 2^m:
- If n is even, then n^m = 0 mod 2^m, hence n AND (n^m) = 0, and a(n) <= m,
- If n is odd, then n^phi(2^m) = 1 mod 2^m according to Euler's totient theorem, hence n AND (n^phi(2^m)) = 1, and a(n) <= phi(2^m).
a(2*(2^m-1)) = m+1 for any m>=0. - Paul Tek, May 03 2015
LINKS
Paul Tek, Table of n, a(n) for n = 0..100000
EXAMPLE
11 AND (11^1) = 11,
11 AND (11^2) = 9,
11 AND (11^3) = 3,
11 AND (11^4) = 1,
hence a(11)=4.
PROG
(PARI) a(n) = my(k=1, nk=n); while (bitand(n, nk)>1, k=k+1; nk=nk*n); return (k)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paul Tek, May 02 2015
STATUS
approved