login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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^(k-1) for any k > 0.

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

a(2^k-1) = 2^(k-1) 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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 19 12:36 EST 2020. Contains 331049 sequences. (Running on oeis4.)