login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A128311 Remainder upon division of 2^(n-1)-1 by n. 2
0, 1, 0, 3, 0, 1, 0, 7, 3, 1, 0, 7, 0, 1, 3, 15, 0, 13, 0, 7, 3, 1, 0, 7, 15, 1, 12, 7, 0, 1, 0, 31, 3, 1, 8, 31, 0, 1, 3, 7, 0, 31, 0, 7, 30, 1, 0, 31, 14, 11, 3, 7, 0, 13, 48, 15, 3, 1, 0, 7, 0, 1, 3, 63, 15, 31, 0, 7, 3, 21, 0, 31, 0, 1, 33, 7, 8, 31, 0, 47, 39, 1, 0, 31, 15, 1, 3, 39, 0, 31, 63 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

By Fermat's little theorem, if p>2 is prime, then 2^(p-1)=1 (mod p), thus a(p)=0. If a(n)=0, then n may be only pseudoprime, as for n = 341 = 11*31 [F. Sarrus, 1820].

LINKS

T. D. Noe, Table of n, a(n) for n=1..2048

Wikipedia, Fermat's little theorem

FORMULA

a(n) = M(n-1) - n floor( M(n-1)/n ) = M(n-1) - max{ k in nZ | k <= M(n-1) } where M(k)=2^k-1.

EXAMPLE

a(1)=0 since any integer = 0 (mod 1)

a(2)=1 since 2^1-1=1 (mod 2),

a(3)=0 since 3 is a prime > 2,

a(4)=3 since 2^3-1=7=3 (mod 4)

a(341)=0 since 341=11*31 is a Sarrus number.

MATHEMATICA

Table[Mod[2^(n-1)-1, n], {n, 100}] (* Harvey P. Dale, Dec 22 2012 *)

PROG

(PARI) a(n)=(1<<(n-1)-1)%n

CROSSREFS

Cf. A001348 (Mersenne numbers), A001567 (Sarrus numbers: pseudoprimes to base 2), A002997 (Carmichael numbers), A084653, A001220 (Wieferich primes).

Sequence in context: A180049 A244454 A238123 * A132884 A319234 A210473

Adjacent sequences:  A128308 A128309 A128310 * A128312 A128313 A128314

KEYWORD

nonn

AUTHOR

M. F. Hasler, May 04 2007

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 18 15:55 EST 2018. Contains 317323 sequences. (Running on oeis4.)