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.

Showing 1-10 of 10 results.

A134307 Primes p such that A^(p-1) == 1 (mod p^2) for some A in the range 2 <= A <= p-1.

Original entry on oeis.org

11, 29, 37, 43, 59, 71, 79, 97, 103, 109, 113, 127, 131, 137, 151, 163, 181, 191, 197, 199, 211, 223, 229, 233, 241, 257, 263, 269, 281, 283, 293, 307, 313, 331, 347, 349, 353, 359, 367, 373, 379, 397, 401, 419, 421, 433, 439, 449, 461, 463, 487, 499, 509
Offset: 1

Views

Author

Joerg Arndt, Aug 27 2008

Keywords

Comments

It's worth observing that there are p-1 elements of order dividing p-1 modulo p^2 that are of the form r^(k*p) mod p^2 where r is a primitive element modulo p and k=0,1,...,p-2. Heuristically, one can expect that at least one of them belongs to the interval [2,p-1] with probability about 1 - (1 - 1/p)^(p-1) ~= 1 - 1/e.
Numerically, among the primes below 1000 (out of the total number pi(1000)=168) there are 103 terms of the sequence, and the ratio 103/168 = 0.613 which is already somewhat close to 1-1/e ~= 0.632.
If we replace p^2 with p^3, heuristically it is likely that the sequence is finite (since 1 - (1 - 1/p^2)^(p-1) tends to 0 as p grows). - Max Alekseyev, Jan 09 2009
Replacing p^2 with p^3 gives just the one term (113) for p < 10^6. - Joerg Arndt, Jan 07 2011
If furthermore the number A can be taken to be a primitive root modulo p, i.e., A is a generator of (Z/pZ)*, then that p belongs to A060503. - Jeppe Stig Nielsen, Jul 31 2015
The number of terms not exceeding prime(10^k), for k=1,2,..., are 2, 55, 652, 6303, 63219, ... - Amiram Eldar, May 08 2021

Examples

			Examples (pairs [p, A]):
[11, 3]
[11, 9]
[29, 14]
[37, 18]
[43, 19]
[59, 53]
[71, 11]
[71, 26]
[79, 31]
[97, 53]
		

References

  • L. E. Dickson, History of the theory of numbers, vol. 1, p. 105.

Crossrefs

Programs

  • Mathematica
    Select[ Prime[ Range[100]], Product[ (PowerMod[a, # - 1, #^2] - 1), {a, 2, # - 1}] == 0 &] (* Jonathan Sondow, Feb 11 2013 *)
  • PARI
    { forprime (p=2, 1000,
       for (a=2, p-1, p2 = p^2;
         if( Mod(a, p2)^(p-1) == Mod(1, p2), print1(p, ", ") ;break() );
      ); ); }

A222184 Primes p such that q^(p-1) == 1 (mod p^2) for some prime q < p.

Original entry on oeis.org

11, 43, 59, 71, 79, 97, 103, 137, 263, 331, 349, 359, 421, 433, 487, 523, 653, 659, 743, 859, 863, 907, 919, 983, 1069, 1087, 1091, 1093, 1163, 1223, 1229, 1279, 1381, 1483, 1499, 1549, 1657, 1663, 1667, 1697, 1747, 1777, 1787, 1789, 1877, 1993, 2011, 2213, 2221, 2251, 2281, 2309, 2371, 2393, 2473, 2671, 2719, 2777, 2791, 2803, 2833, 2861, 3037, 3079, 3163, 3251, 3257, 3463, 3511, 3557
Offset: 1

Views

Author

Jonathan Sondow, Feb 11 2013

Keywords

Comments

Subsequence of A134307; see its interesting heuristics. (What is the analogous heuristic for the present sequence?)
The smallest corresponding primes q are A222185.

Examples

			3 is a prime < 11, and 11^2 divides 3^(11-1)-1 = 59048 = 121*488, so 11 is a member.
		

References

  • L. E. Dickson, History of the Theory of Numbers, vol. 1, chap. IV.

Crossrefs

Programs

  • Mathematica
    Select[ Prime[ Range[500]], Product[ PowerMod[ Prime[k], # - 1, #^2] - 1, {k, 1, PrimePi[#] - 1}] == 0 &]
  • PARI
    lista(nn) = {forprime (p=2, nn, ok = 0; forprime(q=2, p-1, if (Mod(q, p^2)^(p-1) == 1, ok=1; break);); if (ok, print1(p, ", ")););} \\ Michel Marcus, Nov 24 2014

Formula

A222185(n)^(a(n)-1) == 1 (mod a(n)^2).

A222185 Least prime q with q^(p-1) == 1 (mod p^2), where p = A222184(n).

Original entry on oeis.org

3, 19, 53, 11, 31, 53, 43, 19, 79, 71, 223, 257, 251, 349, 307, 241, 197, 503, 467, 643, 13, 127, 457, 419, 487, 617, 691, 2, 241, 997, 821, 683, 653, 421, 941, 1069, 1481, 709, 463, 461, 1153, 1381, 631, 449, 1091, 277, 1993, 367, 659, 151, 1657, 823, 1493, 431, 1787, 2063, 1487, 59, 2389, 2131, 479, 1907, 79, 173, 1151, 1831, 419, 1193, 2, 3319
Offset: 1

Views

Author

Jonathan Sondow, Feb 12 2013

Keywords

Examples

			3 is the smallest prime < A222184(1) = 11 such that 11^2 divides 3^(11-1)-1 = 59048 = 121*488, so a(1) = 3.
		

References

  • L. E. Dickson, History of the Theory of Numbers, vol. 1, chap. IV.

Crossrefs

Programs

  • Mathematica
    L = Select[ Prime[ Range[500]], Product[ PowerMod[ Prime[k], # - 1, #^2] - 1, {k, 1, PrimePi[#] - 1}] == 0 &]; Table[  Min[ Select[ Prime[ Range[ PrimePi[L[[n]]] - 1]], PowerMod[#, L[[n]] - 1, L[[n]]^2] == 1 &]], {n, 1, Length[L]}]

A247072 Smallest Wieferich prime (> sqrt(n)) in base n.

Original entry on oeis.org

2, 1093, 11, 1093, 20771, 66161, 5, 3, 11, 487, 71, 2693, 863, 29, 29131, 1093, 46021, 5, 7, 281
Offset: 1

Views

Author

Eric Chen, Nov 16 2014

Keywords

Comments

a(n) = Smallest prime such that n appears in A143548. - Eric Chen, Nov 26 2014
The square of a(n) is the smallest squared prime that is a pseudoprime (> n) in base n; for example, a(2) = 1093, and 1093^2 = 1194649 is the smallest squared prime that is pseudoprime in base 2. - Eric Chen, Nov 26 2014
Is a(n) defined for all n? - Eric Chen, Nov 26 2014
Does every prime appear in this sequence? - Eric Chen, Nov 26 2014
a(22)..a(28) = {13, 13, 5, 20771, 71, 11, 19}, a(30)..a(46) = {7, 7, 1093, 233, 46145917691, 1613, 66161, 77867, 17, 8039, 11, 29, 23, 103, 229, 1283, 829}, a(48)..a(49) = {7, 491531}, a(51)..a(60) = {41, 461, 47, 19, 30109, 647, 47699, 131, 2777, 29}, a(62)..a(71) = {19, 23, 1093, 17, 89351671, 47, 19, 19, 13, 47}, a(74)..a(81) = {1251922253819, 17, 37, 32687, 43, 263, 13, 11}, a(83)..a(100) = {4871, 163, 11779, 68239, 1999, 2535619637, 13, 6590291053, 293, 727, 509, 11, 2137, 109, 2914393, 28627, 13, 487}; a(n) is currently unknown for n = {21, 29, 47, 50, 61, 72, 73, 82, 126, 132, 154, 186, 187, 188, 200, 203, 222, 231, 237, 301, 304, 309, 311, 327, 335, 347, 351, 355, 357, 435, 441, 454, 458, 496, 541, 542, 546, 554, 570, 593, 609, 610, 639, 640, 654, 662, 668, 674, 692, 697, 698, 701, 718, 724, 725, 727, 733, 743, 760, 772, 775, 777, 784, 798, 807, 808, 812, 829, 841, 858, 860, 871, 883, 912, 919, 944, 980, 983, 986, ...}. - Eric Chen, Nov 26 2014
a(21) > 3.4 * 10^13. - Eric Chen, Nov 26 2014

Examples

			a(12) = 2693 because the Wieferich primes to base 12 are 2693, 123653, ..., and 2693 is greater than sqrt(12), so a(12) = 2693.
a(17) = 46021 because the Wieferich primes to base 17 are 2, 3, 46021, 48947, 478225523351, ..., but neither 2 nor 3 is greater than sqrt(17), so a(17) = 46021.
		

Crossrefs

Programs

  • Mathematica
    a247072[n_] := Block[{p = Int[Sqrt[n]]+1}, While[!PrimeQ[p] || [p < 10^8 && PowerMod[n, p - 1, p^2] != 1], p++]; If[p == 10^8, 0, p]]; Table[ a247072[n], {n, 100}] (* Eric Chen, Nov 27 2014 *)
  • PARI
    a(n)=forprime(p=sqrtint(n)+1,,if(Mod(n^(p-1),p^2)==1,return(p)))
    n=1; while(n<101, print1(a(n), ", "); n++) \\ Charles R Greathouse IV, Nov 16 2014

A320535 Number of solutions to (x+1)^p - x^p == 1 (mod p^2) in the range 1 <= x <= p - 2, p = prime(n).

Original entry on oeis.org

0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 12, 2, 2, 0, 2, 8, 6, 0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0, 2, 2, 2, 0, 0, 6, 2, 0, 8, 0, 2, 2, 2, 6, 2, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 2, 0, 2, 0, 2, 0, 2, 8, 0, 2, 0, 0, 2, 2, 2, 0, 0, 2, 0, 2, 6, 8, 0, 2, 2, 6, 0
Offset: 1

Views

Author

Jianing Song, Oct 15 2018

Keywords

Comments

For primes p > 2, (x+1)^p - x^p == 1 (mod p^2) has trivial solutions x == 0, -1 (mod p) so they are excluded.
Equivalently, a(n) is the number of solutions to x^(p-1) == (x+1)^(p-1) == 1 (mod p^2) in the range 1 <= x <= p^2 - 2, p = prime(n), that is, number of x such that both x and x + 1 occurs in the n-th row of A143548.
All terms shown here are even. The first odd terms are a(183) = 17 and a(490) = 5, with corresponding primes prime(183) = 1093 and prime(490) = 3511. a(n) is odd iff prime(n) is in A001220.
Let g be a primitive root modulo p^2, then (x+1)^p - x^p == 1 (mod p^2) has nontrivial solutions x == g^((p-1)/3) or g^(2*(p-1)/3) (mod p), and x^(p-1) == (x+1)^(p-1) == 1 (mod p^2) has nontrivial solutions x == g^(p*(p-1)/3) or g^(2*p*(p-1)/3) (mod p^2). As a result, if prime(n) == 1 (mod 6) then a(n) > 0. Primes p == 5 (mod 6) such that the equations have nontrivial solutions are listed in A068209.
a(17) = 12 is surprisingly large comparing with its nearby terms. Among the first 1000 terms there are only 7 that are larger than 12. They are a(183) = 17 and a(385) = a(552) = a(582) = a(593) = a(739) = a(922) = 14 (the corresponding primes are 1093, 2659, 4003, 4243, 4339, 5623 and 7213).

Examples

			The nontrivial solutions to (x+1)^7 - x^7 == 1 (mod 49) are x == 2, 4 (mod 7); the solutions to x^6 == (x+1)^6 == 1 (mod 49) are x == 18, 30 (mod 49), so a(4) = 2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p; p:= ithprime(n);
      nops(select(t -> (t+1)^p - t^p  mod p^2 = 1, [$1 .. p - 2]))
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 18 2024
  • PARI
    a(n) = my(p=prime(n)); sum(x=1, p-2, Mod(x+1, p^2)^p-Mod(x, p^2)^p==1);

Extensions

Name corrected by Robert Israel, Mar 18 2024

A222206 Least prime p such that q^(p-1) == 1 (mod p^2) for n primes q < p.

Original entry on oeis.org

2, 11, 349, 13691, 24329
Offset: 0

Views

Author

Jonathan Sondow, Feb 12 2013

Keywords

Comments

I found no new terms < 5*10^6. - J. Stauduhar, Mar 23 2013
a(5) > 13*10^6, if it exists. Note that, up to 13*10^6, the only other prime p (apart 24329) such that the congruence is satisfied for 4 primes q < p is 9656869. - Giovanni Resta, May 23 2017

Examples

			For the prime p = 349, but for no smaller prime, there are 2 primes q = 223 and 317 < p with  q^(p-1) == 1 (mod p^2), so a(2) = 349.
		

References

  • L. E. Dickson, History of the Theory of Numbers, vol. 1, chap. IV.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 2, q = {}}, While[ Count[ PowerMod[ q, p - 1, p^2], 1] != n, q = Join[q, {p}]; p = NextPrime@ p]; p]; Array[f, 5, 0] (* Robert G. Wilson v, Mar 09 2015 *)
  • PARI
    a(n) = {nb = 0; p = 2; while (nb != n, p = nextprime(p+1); nb = 0; forprime(q=2, p-1, if (Mod(q, p^2)^(p-1) == 1, nb ++); if (nb > n, break););); p;} \\ Michel Marcus, Mar 08 2015

A320161 Irregular triangle read by rows: row n lists 0 <= k < p^2 such that p^2 divides A316269(k, p-Kronecker(k^2-4, p)), p = prime(n).

Original entry on oeis.org

0, 1, 3, 0, 1, 8, 0, 1, 24, 0, 1, 10, 39, 48, 0, 1, 27, 36, 37, 84, 85, 94, 120, 0, 1, 6, 29, 34, 61, 108, 135, 140, 163, 168, 0, 1, 25, 45, 56, 75, 82, 132, 157, 207, 214, 233, 244, 264, 288, 0, 1, 42, 43, 73, 88, 106, 120, 161, 200, 241, 255, 273, 288, 318, 319, 360
Offset: 1

Views

Author

Jianing Song, Oct 06 2018

Keywords

Comments

p always divides A316269(k, p-Kronecker(k^2-4, p)), so it's interesting to see when p^2 also divides A316269(k, p-Kronecker(k^2-4, p)).
In the following comments, let p = prime(n). Note that A316269(0, m) and A316269(1, m) is not defined, so here k must be understood as a remainder modulo p^2. because A316269(k+s*p^2, m) == A316269(k, m) (mod p^2).
Let p = prime(n). Every row contains 0, 1 and p^2 - 1. For n >= 3, the n-th row contains p - 2 numbers, whose remainders modulo p form a permutation of {0, 1, 3, 4, ..., p - 3, p - 1}.
Every row is antisymmetric, that is, k is a member iff p^2 - k is, k > 0. As a result, the sum of the n-th row is prime(n)^2*(prime(n) - 3)/2.
Equivalently, for n >= 2, row n lists 0 <= k < p^2 such that p^2 divides A316269(k, (p-Kronecker(k^2-4, p))/2), p = prime(n).

Examples

			Table starts
p = 2: 0, 1, 3,
p = 3: 0, 1, 8,
p = 5: 0, 1, 24,
p = 7: 0, 1, 10, 39, 48,
p = 11: 0, 1, 27, 36, 37, 84, 85, 94, 120,
p = 13: 0, 1, 6, 29, 34, 61, 108, 135, 140, 163, 168,
p = 17: 0, 1, 25, 45, 56, 75, 82, 132, 157, 207, 214, 233, 244, 264, 288,
p = 19: 0, 1, 42, 43, 73, 88, 106, 120, 161, 200, 241, 255, 273, 288, 318, 319, 360,
p = 23: 0, 1, 12, 15, 60, 86, 105, 141, 142, 156, 223, 306, 373, 387, 388, 424, 443, 469, 514, 517, 528,
p = 29: 0, 1, 42, 46, 80, 101, 107, 120, 226, 227, 327, 330, 358, 409, 432, 483, 511, 514, 614, 615, 721, 734, 740, 761, 795, 799, 840,
...
		

Crossrefs

Cf. A143548, A316269, A320162 (discriminant k^2+4, a more studied case).
Cf. A238490 (primes p such that 4 occurs in the corresponding row), A238736 (primes p such that 6 occurs in the corresponding row).

Programs

  • PARI
    B(k, p) = (([k, -1; 1, 0]^(p-kronecker(k^2-4,p)))[1,2])%(p^2)
    forprime(p=2, 50, for(k=0, p^2-1, if(!B(k, p), print1(k, ", ")));print)

A320162 Irregular triangle read by rows: row n lists 0 <= k < p^2 such that p^2 divides A172236(k, p-Kronecker(k^2+4, p)), p = prime(n).

Original entry on oeis.org

0, 0, 4, 5, 0, 7, 18, 0, 12, 20, 24, 25, 29, 37, 0, 5, 18, 19, 24, 43, 78, 97, 102, 103, 116, 0, 2, 14, 45, 70, 82, 87, 99, 124, 155, 167, 0, 24, 38, 40, 63, 83, 103, 105, 184, 186, 206, 226, 249, 251, 265, 0, 31, 37, 63, 79, 100, 137, 144, 150, 180, 181, 211, 217, 224, 261, 282, 298, 324, 330
Offset: 1

Views

Author

Jianing Song, Oct 06 2018

Keywords

Comments

p always divides A172236(k, p-Kronecker(k^2+4, p)), so it's interesting to see when p^2 also divides A172236(k, p-Kronecker(k^2+4, p)). If this holds, then p is called a k-Wall-Sun-Sun prime (and thus being a (k + s*p^2)-Wall-Sun-Sun prime for all integer s). Specially, there is no Wall-Sun-Sun prime below 10^14 implies that there is no 1 in the first pi(10^14) rows.
Note that A172236(0, m) is not defined, so here k must be understood as a remainder modulo p^2. because A172236(k+s*p^2, m) == A172236(k, m) (mod p^2).
Let p = prime(n). Every row contains 0. For n >= 2, if p == 3 (mod 4), then the n-th row contains p numbers, whose remainders modulo p form a permutation of {0, 1, 2, 3, ..., p - 2, p - 1}. If p == 1 (mod 4), then the n-th row contains p - 2 numbers, whose remainders modulo p form a permutation of {0, 1, 2, 3, ..., p - 2, p - 1} \ {+-2*((p - 1)/2)! mod p}.
Every row is antisymmetric, that is, k is a member iff p^2 - k is, k > 0. As a result, the sum of the n-th row is prime(n)^2*(prime(n) - 1)/2 if prime(n) == 3 (mod 4) and prime(n)^2*(prime(n) - 3)/2 if prime(n) == 1 (mod 4).
Equivalently, if p = prime(n) == 1 (mod 4), then row n lists 0 <= k < p^2 such that p^2 divides A172236(k, (p-Kronecker(k^2+4, p))/2). - Jianing Song, Jul 06 2019

Examples

			Table starts
p = 2: 0,
p = 3: 0, 4, 5,
p = 5: 0, 7, 18,
p = 7: 0, 12, 20, 24, 25, 29, 37,
p = 11: 0, 5, 18, 19, 24, 43, 78, 97, 102, 103, 116,
p = 13: 0, 2, 14, 45, 70, 82, 87, 99, 124, 155, 167,
p = 17: 0, 24, 38, 40, 63, 83, 103, 105, 184, 186, 206, 226, 249, 251, 265,
p = 19: 0, 31, 37, 63, 79, 100, 137, 144, 150, 180, 181, 211, 217, 224, 261, 282, 298, 324, 330,
p = 23: 0, 21, 30, 38, 40, 70, 79, 89, 111, 149, 198, 248, 281, 331, 380, 418, 440, 450, 459, 489, 491, 499, 508,
p = 29: 0, 15, 40, 41, 49, 51, 56, 64, 74, 84, 126, 182, 204, 381, 460, 637, 659, 715, 757, 767, 777, 785, 790, 792, 800, 801, 826,
...
		

Crossrefs

Cf. A143548, A172236, A320161 (discriminant k^2-4).
Cf. A238736 (primes p such that 2 occurs in the corresponding row).

Programs

  • PARI
    B(k, p) = (([k, 1; 1, 0]^(p-kronecker(k^2+4, p)))[1, 2])%(p^2)
    forprime(p=2, 50, for(k=0, p^2-1, if(!B(k, p), print1(k, ", "))); print)

A143811 Number of numbers k

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 3, 3, 2, 1, 1, 2, 1, 3, 1, 1, 1, 2, 2, 1, 2, 2, 3, 2, 1, 3, 2, 1, 2, 1, 2, 2, 4, 1, 1, 2, 2, 2, 2, 1, 3, 1, 4, 1, 3, 3, 3, 3, 3, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 3, 1, 1, 5, 1, 2, 1, 3, 2, 2, 1, 2, 2, 2, 1, 4
Offset: 1

Views

Author

T. D. Noe, Sep 02 2008

Keywords

Comments

Note that a(n)>0 because k=1 is always a solution. The primes for which a(n)>1 are given in A134307. The values of k are the terms

Programs

  • Mathematica
    Table[p=Prime[n]; s=Select[Range[p-1], PowerMod[ #,p-1,p^2]==1&]; Length[s], {n,100}]

A317706 Irregular triangle of numbers k < p^2 such that k is a primitive root modulo p but not p^2, p = prime(n).

Original entry on oeis.org

1, 8, 7, 18, 19, 31, 40, 94, 112, 118, 19, 80, 89, 150, 40, 65, 75, 131, 158, 214, 224, 249, 116, 127, 262, 299, 307, 333, 28, 42, 63, 130, 195, 263, 274, 352, 359, 411, 14, 60, 137, 221, 374, 416, 425, 467, 620, 704, 781, 827, 115, 117, 145, 229, 414, 513, 623, 726
Offset: 1

Views

Author

Jianing Song, Aug 05 2018

Keywords

Comments

Also row n lists numbers k < p^2 such that the multiplicative order of k modulo p^2 is p - 1.
Row n has phi(prime(n) - 1) = A008330(n) terms.
Row sum is congruent to mu(prime(n) - 1) = A089451(n) modulo prime(n)^2, where mu is the Moebius function. For n >= 3, the product of n-th row is congruent to 1 modulo prime(n)^2.
Does every integer appear in this sequence? For example, 3 does not appear until the prime 1006003 and 5 does not appear until the prime 40487. Where does 2 first appear?

Examples

			(2)   1,
(3)   8,
(5)   7, 18,
(7)   19, 31,
(11)  40, 94, 112, 118,
(13)  19, 80, 89, 150,
(17)  40, 65, 75, 131, 158, 214, 224, 249,
(19)  116, 127, 262, 299, 307, 333,
(23)  28, 42, 63, 130, 195, 263, 274, 352, 359, 411,
		

Crossrefs

Programs

  • Mathematica
    Table[Select[Range[p^2 - 1], MultiplicativeOrder[#, p^2] == p - 1 &], {p, Prime@ Range@ 11}] // Flatten (* Michael De Vlieger, Aug 05 2018 *)
  • PARI
    forprime(p=2,100,for(i=1,p^2,if(Mod(i,p)!=0,if(znorder(Mod(i,p^2))==p-1,print1(i, ", ")))))
Showing 1-10 of 10 results.