|
|
A352217
|
|
Smallest power of 2 that is one more than a multiple of 2n-1.
|
|
1
|
|
|
2, 4, 16, 8, 64, 1024, 4096, 16, 256, 262144, 64, 2048, 1048576, 262144, 268435456, 32, 1024, 4096, 68719476736, 4096, 1048576, 16384, 4096, 8388608, 2097152, 256, 4503599627370496, 1048576, 262144, 288230376151711744, 1152921504606846976, 64, 4096
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Every odd number is a divisor of a number of the form 2^n-1.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 1 + A165781(n-1)*(2*n-1). (End)
|
|
EXAMPLE
|
a(5)=64 because 63 is the smallest number of the form 2^n-1 that's a multiple of 9.
|
|
MAPLE
|
a:= n-> 2^`if`(n=1, 1, numtheory[order](2, 2*n-1)):
|
|
MATHEMATICA
|
Table[2^MultiplicativeOrder[2, 2*n - 1], {n, 1, 33}] (* Amiram Eldar, Mar 08 2022 *)
|
|
PROG
|
(Python)
def a(n):
if n == 1: return 2
p, m = 2, 2*n-1
while p <= m or p % m != 1: p *= 2
return p
(Python)
from sympy import n_order
def a(n): return 2**n_order(2, 2*n-1)
(PARI) a(n) = 1 << znorder(Mod(2, 2*n-1)); \\ Kevin Ryde, Mar 07 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|