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-7 of 7 results.

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

A005106 Class 2+ primes (for definition see A005105).

Original entry on oeis.org

13, 19, 29, 41, 43, 59, 61, 67, 79, 83, 89, 97, 101, 109, 131, 137, 139, 149, 167, 179, 197, 199, 211, 223, 229, 239, 241, 251, 263, 269, 271, 281, 283, 293, 307, 317, 349, 359, 367, 373, 419, 433, 439, 449, 461, 479, 499, 503, 509, 557, 563, 577, 587, 593
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

  • Maple
    For Maple program see Mathar link in A005105.
  • 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]]; ClassPlusNbr[n_] := Length[ NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[120], ClassPlusNbr[ Prime[ # ]] == 2 &]]

Formula

{prime(n): A126433(n) = 2}. - R. J. Mathar, Mar 26 2024

Extensions

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

A126435 Primes of the form n^7-n-1.

Original entry on oeis.org

2097143, 1801088519, 21869999969, 42618442943, 78364164059, 137231006639, 194754273839, 435817657169, 678223072799, 1174711139783, 1727094849479, 3938980639103, 4398046511039, 4902227890559, 6722988818363, 19203908986079
Offset: 1

Views

Author

Artur Jasinski, Dec 26 2006

Keywords

Comments

All terms end in 3 or 9. - Robert Israel, Jul 22 2019

Crossrefs

Programs

  • Maple
    map(t -> t^7-t-1, select(t -> isprime(t^7-t-1), [$1..10^4])); # Robert Israel, Jul 22 2019
  • Mathematica
    k = 7; a = {}; Do[If[PrimeQ[x^k - x - 1], AppendTo[a, x^k - x - 1]], {x, 1, 100}]; a
    Select[Table[n^7-n-1,{n,80}],PrimeQ] (* Harvey P. Dale, Jun 20 2020 *)

A126437 Primes of the form k^8-k-1.

Original entry on oeis.org

1679609, 5764793, 99999989, 4294967279, 282429536453, 377801998307, 5352009260441, 16815125390579, 39062499999949, 72301961339081, 83733937890569, 281474976710591, 513798374428571, 1113034787454899
Offset: 1

Views

Author

Artur Jasinski, Dec 26 2006

Keywords

Crossrefs

Programs

  • Mathematica
    k = 8; a = {}; Do[If[PrimeQ[x^k - x - 1], AppendTo[a, x^k - x - 1]], {x, 1, 100}]; a
    Select[Table[k^8-k-1,{k,80}],PrimeQ] (* Harvey P. Dale, Nov 06 2021 *)

A126438 Primes of the form n^9-n-1.

Original entry on oeis.org

509, 262139, 10077689, 387420479, 68719476719, 118587876479, 1207269217769, 7625597484959, 10578455953379, 129961739795039, 327381934393919, 1628413597910399, 1953124999999949, 5416169448144839, 10077695999999939
Offset: 1

Views

Author

Artur Jasinski, Dec 26 2006

Keywords

Crossrefs

Programs

  • Mathematica
    k = 9; a = {}; Do[If[PrimeQ[x^k - x - 1], AppendTo[a, x^k - x - 1]], {x, 1, 100}]; a
    Select[Table[n^9-n-1,{n,100}],PrimeQ] (* Harvey P. Dale, Mar 09 2016 *)

A126439 Least prime of the form x^n-x-1.

Original entry on oeis.org

5, 5, 13, 29, 61, 2097143, 1679609, 509, 1021, 8589934583, 4093, 67108859, 16381, 470184984569, 4294967291, 2218611106740436979, 68719476731, 1350851717672992079, 1048573, 10460353199, 4194301, 20013311644049280264138724244295359, 16777213, 108347059433883722041830239, 20282409603651670423947251285999, 58149737003040059690390159, 72057594037927931, 536870909, 999999999999999999999999999989
Offset: 2

Views

Author

Artur Jasinski, Dec 26 2006, Jan 19 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; Do[k = 2; While[ ! PrimeQ[k^n -k - 1], k++ ]; AppendTo[a, k^n - k - 1], {n, 2, 30}]; a (*Artur Jasinski*)

A178382 Primes that are in classes k+ and k- for some k in the Erdős-Selfridge classification of primes.

Original entry on oeis.org

2, 3, 5, 7, 17, 29, 41, 43, 61, 79, 101, 131, 137, 149, 173, 197, 211, 223, 227, 229, 233, 239, 241, 251, 271, 281, 293, 307, 311, 331, 353, 397, 439, 449, 463, 523, 569, 593, 607, 641, 683, 691, 727, 733, 751, 761, 787, 821, 853, 859, 919, 947, 953, 983, 1031
Offset: 1

Views

Author

T. D. Noe, May 26 2010

Keywords

Comments

The first five terms are the only primes in both class 1+ and class 1-. The Mathematica program assigns 2 and 3 to class 0 in order to simplify the algorithm; they are actually in classes 1- and 1+.

Programs

  • Mathematica
    classp[2]=0; classp[3]=0; SetAttributes[classp, Listable]; classp[p_] := classp[p] = 1+Max@@classp[First/@FactorInteger[p+1]]; classm[2]=0; classm[3]=0; SetAttributes[classm, Listable]; classm[p_] := classm[p] = 1+Max@@classm[First/@FactorInteger[p-1]]; Select[Prime[Range[1000]], classp[ # ]==classm[ # ]&]

Formula

Prime(n) such that A126433(n) = A126805(n).
Showing 1-7 of 7 results.