cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A178815 First base of a nonzero Fermat quotient mod the n-th prime.

Original entry on oeis.org

3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Jonathan Sondow, Jun 17 2010, Jun 24 2010, Jun 25 2010

Keywords

Comments

First number m coprime to p = p_n such that p does not divide q_p(m), where q_p(m) = (m^(p-1) - 1)/p is the Fermat quotient of p to the base m.
It is known that a(n) = O((log p_n)^2) as n -> oo. It is conjectured that a(n) = 3 if p_n is a Wieferich prime. See Section 1.1 in Ostafe-Shparlinski (2010).
Additional comments, references, links, and cross-refs are in A001220.
a(n) > 3 iff prime(n) is a term of both A001220 and A014127, i.e., iff A240987(n) = 2. - Felix Fröhlich, Jul 09 2016

Examples

			p_1 = 2 and 2^2 divides 1^(2-1) - 1 = 0 but not 3^(2-1) - 1 = 2, so a(1) = 3.
p_4 = 7 and 7^2 does not divide 2^(7-1) - 1 = 63, so a(4) = 2.
p_183 = 1093 and 1093^2 divides 2^1092 - 1 but not 3^1092 - 1, so a(183) = 3.
Similarly, p_490 = 3511 and a(490) = 3. See A001220.
		

Crossrefs

Programs

  • Mathematica
    Table[b = 2; While[PowerMod[b, Prime[n] - 1, #^2] == 1 || GCD[b, #] > 1, b++] &@ Prime@ n; b, {n, 120}] (* Michael De Vlieger, Jul 09 2016 *)
  • PARI
    a(n) = my(b=2, p=prime(n)); while(Mod(b, p^2)^(p-1)==1 || gcd(b, p) > 1, b++); b \\ Felix Fröhlich, Jul 09 2016

Formula

a(n) = 2 if n > 1 and p_n is not a Wieferich prime A001220.
a(n) > 2 if p_n is a Wieferich prime.
A178844(n) = ((a(n)^(p-1) - 1)/p) mod p, where p = p_n.