OFFSET
1,1
COMMENTS
The sequence is well defined: for any n > 0:
- let x be such that 2*n-1 < 2^x,
- hence gcd(2*n-1, 2^x) = 1,
- and a(n) <= 1 + ord_{2^x}(2*n-1) (where ord_u(v) is the multiplicative order of v modulo u).
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8192
EXAMPLE
For n = 7:
- m = 2*7 - 1 = 13,
- 13 AND (13^2) = 9,
- 13 AND (13^3) = 5,
- 13 AND (13^4) = 1,
- 13 AND (13^5) = 13,
- hence a(7) = 5.
PROG
(PARI) a(n) = my (m=2*n-1, mk=m); for (k=2, oo, if (bitand(m, mk*=m)==m, return (k)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 09 2019
STATUS
approved