

A327649


Maximum value of powers of 2 mod n.


2



0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 10, 8, 12, 8, 8, 8, 16, 16, 18, 16, 16, 20, 18, 16, 24, 24, 26, 16, 28, 16, 16, 16, 32, 32, 32, 32, 36, 36, 32, 32, 40, 32, 42, 40, 38, 36, 42, 32, 46, 48, 32, 48, 52, 52, 52, 32, 56, 56, 58, 32, 60, 32, 32, 32, 64, 64, 66, 64, 64
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


LINKS

Rémy Sigrist, Table of n, a(n) for n = 1..8192
Rémy Sigrist, Colored scatterplot of the ordinal transform of the first 2^16 terms (colored pixels correspond to n's such that a(n) is a power of 2)


FORMULA

a(2^k) = 2^(k1) for any k > 0.
a(2^k+1) = 2^k for any k >= 0.
a(2^k1) = 2^(k1) for any k > 1.


EXAMPLE

For n = 10:
 the first powers of 2 mod 10 are:
k 2^k mod 10
 
0 1
1 2
2 4
3 8
4 6
5 2
 those values are eventually periodic, the maximum being 8,
 hence a(10) = 8.


PROG

(PARI) a(n) = { my (p=1%n, mx=p); while (1, p=(2*p)%n; if (mx<p, mx=p, mx==p  p==0, return (mx))) }


CROSSREFS

Cf. A000079, A062170, A047210, A327650.
Sequence in context: A292254 A292942 A039593 * A265529 A292597 A101656
Adjacent sequences: A327646 A327647 A327648 * A327650 A327651 A327652


KEYWORD

nonn,look


AUTHOR

Rémy Sigrist, Sep 21 2019


STATUS

approved



