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 25 results. Next

A005109 Class 1- (or Pierpont) primes: primes of the form 2^t*3^u + 1.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 37, 73, 97, 109, 163, 193, 257, 433, 487, 577, 769, 1153, 1297, 1459, 2593, 2917, 3457, 3889, 10369, 12289, 17497, 18433, 39367, 52489, 65537, 139969, 147457, 209953, 331777, 472393, 629857, 746497, 786433, 839809, 995329, 1179649, 1492993, 1769473, 1990657
Offset: 1

Views

Author

Keywords

Comments

The definition is given by Guy: a prime p is in class 1- if the only prime divisors of p - 1 are 2 or 3; and p is in class r- if every prime factor of p - 1 is in some class <= r- - 1, with equality for at least one prime factor. - N. J. A. Sloane, Sep 22 2012
See A005105 for the definition of class r+ primes.
Gleason, p. 191: a regular polygon of n sides can be constructed by ruler, compass and angle-trisector iff n = 2^r * 3^s * p_1 * p_2 * ... * p_k, where p_1, p_2, ..., p_k are distinct elements of this sequence and > 3.
Sequence gives primes solutions to p == +1 (mod phi(p-1)). - Benoit Cloitre, Feb 22 2002
These are the primes p for which p-1 is 3-smooth. Primes for which either p+1 or p-1 have many small factors are more easily proved prime, so most of the largest primes found have this property. - Michael B. Porter, Feb 19 2013
For terms p > 3, omega(p-1) = 3 - p mod 3. Consider terms > 3. Clearly, t > 0. If p == 1 mod 3, u > 0: hence omega(p-1) = 2 because p-1 has two prime factors. If p == 2 mod 3, u = 0: hence omega(p-1) = 1 because p-1 is a power of 2. The latter case corresponds to terms that are Fermat primes > 3. Similar arguments demonstrate the converse, that for p > 3, if omega(p-1) = 3 - p mod 3, p is a term. - Chris Boyd, Mar 22 2014
The subset of A055600 which are prime. - Robert G. Wilson v, Jul 19 2014
Named after the American mathematician James Pierpont (1866-1938). - Amiram Eldar, Jun 09 2021

Examples

			97 = 2^5*3 + 1 is a term.
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, section A18, p. 66.
  • George E. Martin, Geometric Constructions, Springer, 1998. ISBN 0-387-98276-0.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    K:=10^7;; # to get all terms <= K.
    A:=Filtered([1..K],IsPrime);;
    B:=List(A,i->Factors(i-1));;
    C:=[];;  for i in B do if Elements(i)=[2] or Elements(i)=[2,3]  then Add(C,Position(B,i)); fi; od;
    A005109:=Concatenation([2],List(C,i->A[i])); # Muniru A Asiru, Sep 10 2017
    
  • Magma
    [p: p in PrimesUpTo(10^8) | forall{d: d in PrimeDivisors(p-1) | d le 3}]; // Bruno Berselli, Sep 24 2012
    
  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[3, 6300], ClassMinusNbr[ Prime[ # ]] == 1 &]]
    Select[Prime /@ Range[10^5], Max @@ First /@ FactorInteger[ # - 1] < 5 &] (* Ray Chandler, Nov 01 2005 *)
    mx = 2*10^6; Select[Sort@ Flatten@ Table[2^i*3^j + 1, {i, 0, Log[2, mx]}, {j, 0, Log[3, mx/2^i]}], PrimeQ] (* Robert G. Wilson v, Jul 16 2014, edited by Michael De Vlieger, Aug 23 2017 *)
  • PARI
    N=10^8; default(primelimit,N);
    pq(p)={p-=1; (p/(2^valuation(p,2)*3^valuation(p,3)))==1;}
    forprime(p=2,N,if(pq(p),print1(p,", ")));
    /* Joerg Arndt, Sep 22 2012 */
    
  • PARI
    /* much more efficient: */
    A005109_upto(lim=1e10)={my(L=List(), k2=1);
    until ( lim <= k2 *= 2, my(k23 = k2);
        until ( lim <= k23 *= 3, isprime(k23+1) && listput(L, k23+1));
    ); Set(L) } /* Joerg Arndt, Sep 22 2012, edited by M. F. Hasler, Mar 17 2024 */
    
  • PARI
    N=10^8; default(primelimit, N);
    print1("2, 3, ");forprime(p=5,N,if(omega(p-1)==3-p%3,print1(p", "))) \\ Chris Boyd, Mar 22 2014
    
  • Python
    from itertools import islice
    from sympy import nextprime
    def A005109_gen(): # generator of terms
        p = 2
        while True:
            q = p-1
            q >>= (~q&q-1).bit_length()
            a, b = divmod(q,3)
            while not b:
                a, b = divmod(q:=a,3)
            if q==1:
                yield p
            p = nextprime(p)
    A005109_list = list(islice(A005109_gen(),30)) # Chai Wah Wu, Mar 17 2023

Formula

A122257(a(n)) = 1; A122258(n) = number of Pierpont primes <= n; A122260 gives numbers having only Pierpont primes as factors. - Reinhard Zumkeller, Aug 29 2006
{primes p: A126805(PrimePi(p)) = 1}. - R. J. Mathar, Sep 24 2012
a(n) = 2^A374577(n) * 3^A374578(n) + 1. - Amiram Eldar, Sep 02 2024

Extensions

Comments and additional references from Antreas P. Hatzipolakis (xpolakis(AT)otenet.gr)
More terms from David W. Wilson
More terms from Benoit Cloitre, Feb 22 2002
More terms from Robert G. Wilson v, Mar 20 2003

A005113 Smallest prime in class n (sometimes written n+) according to the Erdős-Selfridge classification of primes.

Original entry on oeis.org

2, 13, 37, 73, 1021, 2917, 15013, 49681, 532801, 1065601, 8524807, 68198461, 545587687, 1704961513, 23869461181, 288310406533
Offset: 1

Views

Author

Keywords

Comments

A prime p is in class 1 if (p+1)'s largest prime factor is 2 or 3. If (p+1) has other prime factors, p's class is one more than the largest class of its prime factors. See also A005105.
John W. Layman observes that for n=10..13, the ratios r(n)= a(n)/a(n-1) are increasingly close to an integer, being 1.9999981, 7.99999906, 8.00000059 and 7.999999985.
Layman's observation is a consequence of a(n+1) = m*a(n)-1 for (n,m)=(1,7),(3,2),(4,14),(9,2),(10,8),(12,8),(14,14), while a(12) = 8 a(11)+5 is a coincidence which does not fit into that scheme. This relationship is not unusual since any N+ prime p is by definition such that p+1 = m*q where q is a (N-1)+ prime and m = (p+1)/q must be even since p,q are odd (except for q=2, allowing the odd m=7 for n=1 above) and the least N+ prime has good chances of having q equal to the least (N-1)+ prime. - M. F. Hasler, Apr 09 2007
a(n+1) >= 2*a(n)-1 since a(n+1)+1 = p*q with p of class n+ (thus >= a(n) and odd) and thus q >= 2 (even and positive). a(n+1) <= min { p = 2*k*a(n)-1 | k=1,2,3,... such that p is prime }. - M. F. Hasler, Apr 02 2007
a(17) <= 1833174628057, with equality if 916587314029 is the 10th 16+ prime; a(18) <= 3666349256113, with equality if a(17) = 1833174628057; a(19) <= 65994286610033, with equality if 41431295033731 is the third 18+ prime; a(20) <= 764276710625653, with equality if 382138355312827 is the third 19+ prime. - M. F. Hasler, Apr 09 2007

Examples

			1553 is in class 4 because 1553+1 = 2*3*7*37; 7 is in class 1 and 37 is in class 3. 37 is in class 3 because 37+1 = 2*19 and 19 is in class 2. 19 is in class 2 because 19+1 = 2*2*5 and 5 is in class 1. 5 is in class 1 because 5+1=2*3.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; NextPrime[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] + 1]]; ClassPlusNbr[n_] := Length[ NestWhileList[f, n, UnsameQ, All]] - 3; a = Table[0, {15}]; a[[1]] = 2; k = 5; Do[c = ClassPlusNbr[ k]; If[ a[[c]] == 0, a[[c]] = k]; k = NextPrime[k], {n, 1, 28700000}]; a
  • PARI
    checkclass(n,p)={ n=factor(n+1)[,1]; n[#n] <= 3 && return(1); (#p <= 1 || n[#n] < p[#p]) && return(2); n[1]=p[#p]; p=vecextract(p,"^-1"); forstep( i=#n,2,-1, n[i] < n[1] && break; checkclass(n[i],p) > #p && return(2+#p)) }
    A005113(n,p,a=[])={ while( #a #a, p=nextprime(p+1)); a=concat(a,p); p=a[#a]*2-2); a } \\ A005113(11) takes < 10 sec @ 2 GHz in 2007; less than 2.5 sec @ 2 GHz in 2013. \\ M. F. Hasler, Apr 02 2007
    
  • PARI
    class(n, s=+1 /* for n+ class; -1 for n- class */)={ isprime(n) || return; (( n=factor(n+s)[,1] ) && n[ #n]>3 ) || return(1); vecsort( vector( #n,i,class( n[i],s )))[#n]+1 }
    someofnextclass( a, limit=0, s=0, b=[], p)={ if(!s,/* guess + or - */ s=( class(a[1]) && class(a[1])==class(a[2]) )*2-1 ); print("looking for primes of class ", 1+class( a[1], s), ["+","-"][1+(s<0)] ); for( i=1,#a, p=-s; until( p>=limit, until( isprime(p), p+=a[i]<<1 ); b=concat(b,p); if( !limit, limit=p)) ); vecsort(b) };
    c=A090468; for(i=15,20,c=someofnextclass(c,9e12);print("least prime of class ",i,"+ is <= ",c[1])) \\  M. F. Hasler, Apr 09 2007

Extensions

Extended through a(12) by Robert G. Wilson v
a(13) from John W. Layman
a(14) from Don Reble, Apr 11 2003
a(15) from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Aug 17 2006
a(7) corrected by Tomás Oliveira e Silva, Oct 27 2006
a(16) calculated using A129475(n) up to n=19 by M. F. Hasler, Apr 16 2007
Edited by Max Alekseyev, Aug 17 2013

A005110 Class 2- primes (for definition see A005109).

Original entry on oeis.org

11, 29, 31, 41, 43, 53, 61, 71, 79, 101, 103, 113, 127, 131, 137, 149, 151, 157, 181, 191, 197, 211, 223, 229, 239, 241, 251, 271, 281, 293, 307, 313, 337, 379, 389, 401, 409, 421, 439, 443, 449, 457, 491, 521, 541, 547, 571, 593, 601, 613, 631, 641, 647, 653, 673
Offset: 1

Views

Author

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]];
    f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2];
    While[ IntegerQ[m/3], m /= 3]];
    Apply[Times, PrimeFactors[m] - 1]];
    ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3;
    Prime[ Select[ Range[122], ClassMinusNbr[ Prime[ # ]] == 2 &] ] (* Robert G. Wilson v *)

Extensions

Edited and extended by Robert G. Wilson v, Mar 20 2003
Corrected by R. J. Mathar, Feb 01 2007

A005111 Class 3- primes (for definition see A005109).

Original entry on oeis.org

23, 59, 67, 83, 89, 107, 173, 199, 227, 233, 263, 311, 317, 331, 349, 353, 367, 373, 383, 397, 419, 431, 463, 479, 503, 509, 523, 563, 569, 587, 607, 617, 619, 661, 683, 727, 733, 739, 743, 787, 809, 821, 823, 853, 859, 881, 887, 907, 929, 947, 977, 983, 991, 1031, 1033
Offset: 1

Views

Author

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[175], ClassMinusNbr[ Prime[ # ]] == 3 &]]

Extensions

Edited and extended by Robert G. Wilson v, Mar 20 2003
Corrected by R. J. Mathar, Feb 01 2007

A081426 Class 7- primes.

Original entry on oeis.org

1439, 8629, 10067, 14683, 17257, 19577, 20389, 22643, 23743, 27103, 28219, 29399, 31657, 32633, 33107, 33113, 33863, 34259, 34513, 35951, 36137, 36887, 37379, 40127, 40637, 40759, 42179, 42209, 42767, 44519, 44579, 45139, 49019, 49669
Offset: 1

Views

Author

Robert G. Wilson v, Mar 20 2003

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[5200], ClassMinusNbr[ Prime[ # ]] == 7 &]]

A081427 Class 8- primes.

Original entry on oeis.org

2879, 20147, 25903, 34537, 46049, 58733, 63317, 65267, 69029, 69073, 74759, 80537, 86291, 86341, 103549, 106487, 108413, 112877, 120877, 131687, 135859, 138053, 140939, 141023, 147647, 155413, 157427, 165527, 172681, 187163, 189949, 207079
Offset: 1

Views

Author

Robert G. Wilson v, Mar 20 2003

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[20000], ClassMinusNbr[ Prime[ # ]] == 8 &]]

A005112 Class 4- primes (for definition see A005109).

Original entry on oeis.org

47, 139, 167, 179, 269, 277, 347, 461, 467, 499, 599, 643, 691, 709, 797, 827, 829, 839, 857, 863, 967, 997, 1013, 1019, 1039, 1063, 1069, 1151, 1163, 1181, 1289, 1367, 1381, 1399, 1427, 1487, 1493, 1499, 1579, 1609, 1619, 1657, 1867, 1877, 1889, 1933, 1979
Offset: 1

Views

Author

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[300], ClassMinusNbr[ Prime[ # ]] == 4 &]]

Extensions

Edited and extended by Robert G. Wilson v, Mar 20 2003

A081424 Class 5- primes (for definition see A005109).

Original entry on oeis.org

283, 359, 557, 659, 941, 1109, 1129, 1223, 1433, 1663, 1669, 1693, 1787, 1997, 2027, 2039, 2069, 2083, 2153, 2339, 2351, 2503, 2539, 2579, 2633, 2767, 2777, 2803, 2837, 2999, 3229, 3581, 3761, 3767, 3779, 3989, 4127, 4157, 4231, 4253, 4283, 4297, 4513
Offset: 1

Views

Author

Robert G. Wilson v, Mar 20 2003

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[700], ClassMinusNbr[ Prime[ # ]] == 5 &]]

A081425 Class 6- primes (for definition see A005109).

Original entry on oeis.org

719, 1319, 1699, 2447, 3343, 4079, 4139, 4457, 4517, 4679, 4703, 5273, 5647, 6653, 6793, 7523, 7529, 7559, 8599, 9227, 9587, 9623, 9839, 10159, 10343, 10723, 10771, 11069, 11213, 11279, 11321, 11489, 11863, 11887, 12163, 12917, 12919, 13163
Offset: 1

Views

Author

Robert G. Wilson v, Mar 20 2003

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[1700], ClassMinusNbr[ Prime[ # ]] == 6 &]]

A081429 Class 10- primes.

Original entry on oeis.org

138197, 207227, 621679, 621883, 633383, 760079, 829177, 863711, 898253, 978863, 1035499, 1036471, 1209191, 1451059, 1566179, 1658309, 1658353, 1761407, 1794229, 1796503, 1827479, 1900147, 2015303, 2029439, 2070997, 2072893
Offset: 1

Views

Author

Robert G. Wilson v, Mar 20 2003

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] - 1]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[200000], ClassMinusNbr[ Prime[ # ]] == 10 &]]
Showing 1-10 of 25 results. Next