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.

Previous Showing 11-20 of 60 results. Next

A005105 Class 1+ primes: primes of the form 2^i*3^j - 1 with i, j >= 0.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 31, 47, 53, 71, 107, 127, 191, 383, 431, 647, 863, 971, 1151, 2591, 4373, 6143, 6911, 8191, 8747, 13121, 15551, 23327, 27647, 62207, 73727, 131071, 139967, 165887, 294911, 314927, 442367, 472391, 497663, 524287, 786431, 995327
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 A005109 for the definition of class r- primes.
Odd terms are primes satisfying 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 n>1, x=2*a(n) is a solution to the equation phi(sigma(x)) = x-phi(x). Also all Mersenne primes are in the sequence. - Jahangeer Kholdi, Sep 28 2014

Examples

			23 is in the sequence since 23 is prime and 23 + 1 = 24 = 2^3 * 3 has all prime factors less than or equal to 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

  • GAP
    A:=Filtered([1..10^7],IsPrime);;     I:=[3];;
    B:=List(A,i->Elements(Factors(i+1)));;
    C:=List([0..Length(I)],j->List(Combinations(I,j),i->Concatenation([2],i)));;
    A005105:=Concatenation([2],List(Set(Flat(List([1..Length(C)],i->List([1..Length(C[i])],j->Positions(B,C[i][j]))))),i->A[i])); # Muniru A Asiru, Sep 28 2017
    
  • Magma
    [p: p in PrimesUpTo(6*10^6) | forall{d: d in PrimeDivisors(p+1) | d le 3}]; // Bruno Berselli, Sep 24 2012
    
  • Maple
    For Maple program see Mathar link.
    # Alternative:
    N:= 10^6: # to get all terms <= N
    select(isprime,{seq(seq(2^i*3^j-1, i=0..ilog2(N/3^j)), j=0..floor(log[3](N)))});
    # if using Maple 11 or earlier, uncomment the following line
    # sort(convert(%,list));  # Robert Israel, Sep 28 2014
  • Mathematica
    mx = 10^6; Select[ Sort@ Flatten@ Table[2^i*3^j - 1, {i, 0, Log[2, mx]}, {j, 0, Log[3, mx/2^i]}], PrimeQ] (* or *)
    Prime[ Select[ Range[78200], Mod[ Prime[ # ] + 1, EulerPhi[ Prime[ # ] + 1]] == 0 &]] (* or *)
    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]]; ClassPlusNbr[n_] := Length[ NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[3, 78200], ClassPlusNbr[ Prime[ # ]] == 1 &]]
  • PARI
    list(lim)=my(v=List(), N); lim=1+lim\1; for(n=0, logint(lim,3), N=3^n; while(N<=lim, if(ispseudoprime(N-1),listput(v, N-1)); N<<=1)); Set(v) \\ Charles R Greathouse IV, Jul 15 2011; corrected Sep 22 2015
    
  • Python
    from itertools import count, islice
    from sympy import integer_log, isprime
    def A069353(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x+1)//3**i).bit_length() for i in range(integer_log(x+1,3)[0]+1))
        return bisection(f,n-1,n-1)
    def A005105_gen(): # generator of terms
        return filter(lambda n:isprime(n), map(A069353,count(1)))
    A005105_list = list(islice(A005105_gen(),30)) # Chai Wah Wu, Mar 31 2025

Formula

{primes p : A126433(PrimePi(p)) = 1 }. - R. J. Mathar, Sep 24 2012

Extensions

More terms from Benoit Cloitre, Feb 22 2002
Edited and extended by Robert G. Wilson v, Mar 20 2003

A056637 a(n) is the least prime of class n-, according to the Erdős-Selfridge classification of primes.

Original entry on oeis.org

2, 11, 23, 47, 283, 719, 1439, 2879, 34549, 138197, 1266767, 14920303, 36449279, 377982107, 1432349099, 22111003847, 110874748763
Offset: 1

Views

Author

Robert G. Wilson v, Jan 31 2001

Keywords

Comments

A prime p is in class 1- if p-1 has no prime factor larger than 3. If p-1 has other prime factors, p is in class (c+1)-, where c- is the largest class of its prime factors. See also A005109.
1432349099 < a(16) <= 25782283783.
a(18) <= 619108107719, a(19) <= 19811459447009, a(20) <= 152772264735359. These upper limits can be found by generating class (n+1)- primes from a list of n- class primes; if the latter is sufficiently complete, one can deduce that there is no smaller (n+1)- prime. - M. F. Hasler, Apr 05 2007

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]]; ClassMinusNbr[n_] := Length[NestWhileList[f, n, UnsameQ, All]] - 3; a = Table[0, {15}]; a[[1]] = 2; k = 5; Do[c = ClassMinusNbr[ k]; If[ a[[c]] == 0, a[[c]] = k]; k = NextPrime[k], {n, 3, 7223000}]; a

Formula

a(n+1) >= 2*a(n)+1, since a(n+1)-1 is even and must have a factor of class n- which is odd (n>1) and >= a(n). a(n+1) <= min { p = 2*k*a(n)+1 | k=1,2,3... such that p is prime }, since a(n) is a prime of class n-. - M. F. Hasler, Apr 05 2007

Extensions

Extended by Robert G. Wilson v, Mar 20 2003
More terms from Don Reble, Apr 11 2003
a(16) and a(17) from M. F. Hasler, Apr 21 2007

A058383 Primes of form 1+(2^a)*(3^b), a>0, b>0.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Dec 20 2000

Keywords

Comments

Prime numbers n such that cos(2*Pi/n) is an algebraic number of a 3-smooth degree, but not a 2-smooth degree. - Artur Jasinski, Dec 13 2006
From Antonio M. Oller-Marcén, Sep 24 2009: (Start)
In this case gcd(a,b) is a power of 2.
A regular polygon of n sides is constructible by paper folding if and only if n=2^r3^sp_1...p_t with p_i being distinct primes of this kind. (End)
Primes in A005109 but not in A092506. - R. J. Mathar, Sep 28 2012
Conjecture: these are the only solutions >=7 to the equation A000010(x) + A000010(x-1) = floor((4*x-3)/3). - Benoit Cloitre, Mar 02 2018
These are also called Pierpont primes. - Harvey P. Dale, Apr 13 2019

Crossrefs

Programs

  • Maple
    N:= 10^10: # to get all terms <= N+1
    sort(select(isprime, [seq(seq(1+2^a*3^b, a=1..ilog2(N/3^b)), b=1..floor(log[3](N)))])); # Robert Israel, Mar 02 2018
  • Mathematica
    Do[If[Take[FactorInteger[EulerPhi[2n + 1]][[ -1]],1] == {3} && PrimeQ[2n + 1], Print[2n + 1]], {n, 1, 10000}] (* Artur Jasinski, Dec 13 2006 *)
    mx = 1500000; s = Sort@ Flatten@ Table[1 + 2^j*3^k, {j, Log[2, mx]}, {k, Log[3, mx/2^j]}]; Select[s, PrimeQ] (* Robert G. Wilson v, Sep 28 2012 *)
    Select[Prime[Range[114000]],FactorInteger[#-1][[All,1]]=={2,3}&] (* Harvey P. Dale, Apr 13 2019 *)

Formula

Primes of the form 1 + A033845(n).

A055600 Numbers of form 2^i*3^j + 1 with i, j >= 0.

Original entry on oeis.org

2, 3, 4, 5, 7, 9, 10, 13, 17, 19, 25, 28, 33, 37, 49, 55, 65, 73, 82, 97, 109, 129, 145, 163, 193, 217, 244, 257, 289, 325, 385, 433, 487, 513, 577, 649, 730, 769, 865, 973, 1025, 1153, 1297, 1459, 1537, 1729, 1945, 2049, 2188, 2305, 2593, 2917, 3073, 3457, 3889
Offset: 1

Views

Author

Henry Bottomley, Jun 01 2000

Keywords

Comments

If X is an n-set and Y a fixed (n-5)-subset of X then a(n-5) is equal to the number of 2-subsets of X intersecting Y. - Milan Janjic, Aug 15 2007

Examples

			a(7) = 13 since 13 = 2^2 * 3^1 + 1.
		

Crossrefs

Primes in this sequence give A005109 (Class 1- or Pierpoint primes).
Cf. A003586.

Programs

  • Mathematica
    mx = 4000; Sort@ Flatten@ Table[ 2^i*3^j + 1, {i, 0, Log[2, mx]}, {j, 0, Log[3, mx/2^i]}] (* Robert G. Wilson v, Aug 17 2012 *)
  • PARI
    is(k) = if(k == 2, 1, k > 2 && vecmax(factor(k - 1, 5)[, 1]) < 5); \\ Amiram Eldar, Sep 02 2024
    
  • Python
    from sympy import integer_log
    def A055600(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x,3)[0]+1))
        return bisection(f,n,n)+1 # Chai Wah Wu, Sep 15 2024

Formula

a(n) = A003586(n) + 1.

Extensions

Offset corrected by Amiram Eldar, Sep 02 2024

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 &]]

A216148 Primes of the form 2*k^k + 1 = A216147(k).

Original entry on oeis.org

3, 17832200896513, 78692816150593075150849
Offset: 1

Views

Author

M. F. Hasler, Sep 02 2012

Keywords

Comments

The sequence should be extended through A110932, which lists the corresponding values of k: The next term, 2*251^251 + 1 = A216147(A110932(4)) ~ 4.16*10^602, is too large to include here.

Crossrefs

Cf. A110932.
A subsequence of A133663, with b=a and c=1.

Programs

  • Mathematica
    Select[Table[2n^n+1,{n,20}],PrimeQ] (* Harvey P. Dale, Mar 27 2016 *)
  • PARI
    for(n=1,999, ispseudoprime(p=n^n*2+1) & print1(p","))

Formula

a(2) = A216147(12) = A005109(95) = A070855(12) = A058383(89) = A133663(18).
a(3) = A216147(18) = A005109(183)= A070855(18) = A058383(177)= A133663(36).

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 &]]

A081430 Class 11- primes.

Original entry on oeis.org

1266767, 1520159, 2486717, 3316619, 4144541, 4512947, 4836779, 5389519, 5638379, 6218827, 6448979, 6633457, 6771419, 6907247, 7460149, 7462639, 7600597, 7739033, 7874627, 8153567, 8291573, 9110639, 9112319, 9121003
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[300000, 1000000], ClassMinusNbr[ Prime[ # ]] == 1 &]]

A077497 Primes of the form 2^r*5^s + 1.

Original entry on oeis.org

2, 3, 5, 11, 17, 41, 101, 251, 257, 401, 641, 1601, 4001, 16001, 25601, 40961, 62501, 65537, 160001, 163841, 16384001, 26214401, 40960001, 62500001, 104857601, 167772161, 256000001, 409600001, 655360001, 2441406251, 2500000001, 4194304001, 10485760001
Offset: 1

Views

Author

Amarnath Murthy, Nov 07 2002

Keywords

Comments

These are also the prime numbers p for which there is an integer solution x to the equation p*x = p*10^p + x, or equivalently, the prime numbers p for which (p*10^p)/(p-1) is an integer. - Vicente Izquierdo Gomez, Feb 20 2013
For n > 2, all terms are congruent to 5 (mod 6). - Muniru A Asiru, Sep 03 2017

Examples

			101 is in the sequence, since 101 = 2^2*5^2 + 1 and 101 is prime.
		

Crossrefs

Programs

  • GAP
    K:=10^7;; # to get all terms <= K.
    A:=Filtered(Filtered([1..K],i-> i mod 6=5),IsPrime);;
    B:=List(A,i->Factors(i-1));;
    C:=[];;  for i in B do if Elements(i)=[2] or Elements(i)=[2,5]  then Add(C,Position(B,i)); fi; od;
    A077497:=Concatenation([2,3],List(C,i->A[i])); # Muniru A Asiru, Sep 03 2017
  • Mathematica
    Do[p=Prime[k];s=FindInstance[p x == p 10^p+x,x,Integers];If[s!={},Print[p]],{k,10000}] (* Vicente Izquierdo Gomez, Feb 20 2013 *)
  • PARI
    list(lim)=my(v=List(),t);for(r=0,log(lim)\log(5),t=5^r;while(t<=lim,if(isprime(t+1),listput(v,t+1)); t<<=1)); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jan 29 2013
    

Extensions

Corrected and extended by Reinhard Zumkeller, Nov 19 2002
More terms from Ray Chandler, Aug 02 2003
Previous Showing 11-20 of 60 results. Next