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

A051692 a(n) is twice the smallest k such that A051686(k) = prime(n).

Original entry on oeis.org

2, 4, 38, 16, 170, 72, 446, 58, 512, 282, 178, 148, 758, 856, 836, 1592, 1712, 388, 1906, 2606, 2034, 1918, 656, 5924, 1648, 13082, 652, 1514, 2758, 10922, 5758, 18986, 6764, 10570, 20918, 4936, 8188, 5842, 4094, 30710, 15212, 11482, 57932, 14626, 5624, 36232, 16018, 57874
Offset: 1

Views

Author

Keywords

Comments

The sequence is based on the first 50000 terms of A051686, in which the first 54 primes (2,3,...,251) appear along with 19 others, the largest of which is A051686(37976) = 823.

Examples

			The 25th term in this sequence is 1648. This means that prime(25) = 97 arises in A051686 as A051686(1648/2) = A051686(824). Thus, 1648 is the first term in the sequence {..., 2k, ...} = {1648, 1798, 4108, ...} with the property that 2k*97 + 1 = 194k + 1 is also a prime, moreover the smallest one: 159857.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := Module[{p = 2, i = 1}, While[! PrimeQ[2*n*p + 1], p = NextPrime[p]; i++]; i]; seq[len_] := Module[{v = Table[0, {len}], c = 0, k = 1, i}, While[c < len, i = s[k]; If[i <= len && v[[i]] == 0, v[[i]] = 2*k; c++]; k++]; v]; seq[48] (* Amiram Eldar, Feb 28 2025 *)
  • PARI
    a051686(n) = my(p=2); while(!isprime(2*n*p+1), p = nextprime(p+1)); p;
    a(n) = my(k=1); while(a051686(k) != prime(n), k++); 2*k; \\ Michel Marcus, Jun 08 2018
    
  • PARI
    s(n) = {my(p = 2, i = 1); while(!isprime(2*n*p + 1), p = nextprime(p+1); i++); i;}
    list(len) = {my(v = vector(len), c = 0, k = 1, i); while(c < len, i = s(k); if(i <= len && v[i] == 0, v[i] = 2*k; c++); k++); v;} \\ Amiram Eldar, Feb 28 2025

Extensions

More terms from Michel Marcus, Jun 08 2018

A051861 Twice the positions in A051686 at which new primes appear in that sequence.

Original entry on oeis.org

2, 4, 16, 38, 58, 72, 148, 170, 178, 282, 388, 446, 512, 652, 656, 758, 836, 856, 1514, 1592, 1648, 1712, 1906, 1918, 2034, 2606, 2758, 4094, 4936, 5624, 5758, 5842, 5924, 6764, 8188, 10570, 10922, 11072, 11482, 13082, 13972, 14626, 15212, 16018, 18986
Offset: 1

Views

Author

Labos Elemer, Dec 14 1999

Keywords

Comments

Halving this sequence gives 1, 2, 8, 19, ..., 256, 326, ..., 47764, ..., the indices in A051686 at which primes appear which have not appeared before.
This sequence lists the terms of A051692 in ascending order, whereas A051692 lists them in increasing order of the emerging primes in A051686.

Crossrefs

Programs

  • Mathematica
    s[n_] := Module[{p = 2}, While[! PrimeQ[2*n*p + 1], p = NextPrime[p]]; p]; seq[len_] := Module[{t = {}, v = {}, n = 1, c = 0, p}, While[c < len, p = s[n]; If[FreeQ[t, p], c++; AppendTo[t, p]; AppendTo[v, 2*n]]; n++]; v]; seq[45] (* Amiram Eldar, Feb 28 2025 *)
  • PARI
    s(n) = {my(p = 2); while(!isprime(2*n*p + 1), p = nextprime(p+1)); p;}
    isin(list, k) = {for(i = 1, #list, if(list[i] == k, return(1))); 0};
    list(len) = {my(t = List(), n = 1, c = 0, p); while(c < len, p = s(n); if(!isin(t, p), c++; listput(t, p); print1(2*n, ", ")); n++);} \\ Amiram Eldar, Feb 28 2025

Extensions

Edited by Jon E. Schoenfield, May 28 2018

A051860 Distinct prime numbers in order of their appearance in A051686.

Original entry on oeis.org

2, 3, 7, 5, 19, 13, 37, 11, 31, 29, 61, 17, 23, 103, 83, 41, 47, 43, 107, 53, 97, 59, 67, 79, 73, 71, 109, 167, 151, 197, 127, 163, 89, 137, 157, 139, 113, 233, 181, 101, 229, 193, 179, 211, 131, 149, 373, 251, 271, 307, 173, 409, 199, 283, 227, 349, 263, 443, 313
Offset: 1

Views

Author

Labos Elemer, Dec 14 1999

Keywords

Comments

A051686 includes the minimal 2k-Germain primes, which show a special order of emergence as 2k increases. This sequence shows this order.
Each prime seems to appear several times.

Examples

			37 appears first in A051686 at the 148th position and it is the 7th new prime number which arises, sooner than smaller primes like 11, 31, 29, 17, 23, so a(7) = 37.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := Module[{p = 2}, While[! PrimeQ[2*n*p + 1], p = NextPrime[p]]; p]; seq[len_] := Module[{t = {}, n = 1, c = 0, p}, While[c < len, p = s[n]; If[FreeQ[t, p], c++; AppendTo[t, p]]; n++]; t]; seq[60] (* Amiram Eldar, Feb 28 2025 *)
  • PARI
    s(n) = {my(p = 2); while(!isprime(2*n*p + 1), p = nextprime(p+1)); p;}
    isin(list, k) = {for(i = 1, #list, if(list[i] == k, return(1))); 0};
    list(len) = {my(t = List(), n = 1, c = 0, p); while(c < len, p = s(n); if(!isin(t, p), c++; listput(t, p)); n++); Vec(t);} \\ Amiram Eldar, Feb 28 2025

A057192 Least m such that 1 + prime(n)*2^m is a prime, or -1 if no such m exists.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 6, 1, 1, 8, 2, 1, 2, 583, 1, 5, 4, 2, 3, 2, 2, 1, 1, 2, 3, 16, 3, 6, 1, 2, 1, 3, 2, 3, 4, 8, 2, 7, 1, 1, 4, 1, 2, 15, 2, 20, 8, 11, 6, 1, 1, 36, 1, 279, 29, 3, 4, 2, 1, 30, 1, 2, 9, 4, 7, 4, 4, 3, 10, 21, 1, 12, 2, 14, 6393, 11, 4, 3, 2, 1, 4, 1, 2, 6, 1, 3, 8, 5, 6, 19, 3, 2, 1, 2, 5
Offset: 1

Views

Author

Labos Elemer, Jan 10 2001

Keywords

Comments

Primes p such that p * 2^m + 1 is composite for all m are called Sierpiński numbers. The smallest known prime Sierpiński number is 271129. Currently, 10223 is the smallest prime whose status is unknown.
For 0 < k < a(n), prime(n)*2^k is a nontotient. See A005277. - T. D. Noe, Sep 13 2007
With the discovery of the primality of 10223 * 2^31172165 + 1 on November 6, 2016, we now know that 10223 is not a Sierpiński number. The smallest prime of unknown status is thus now 21181. The smallest confirmed instance of a(n) = -1 is for n = 78557. - Alonso del Arte, Dec 16 2016 [Since we only care about prime Sierpiński numbers in this sequence, 78557 should be replaced by primepi(271129) = 23738. - Jianing Song, Dec 15 2021]
Aguirre conjectured that, for every n > 1, a(n) is even if and only if prime(n) mod 3 = 1 (see the MathStackExchange link below). - Lorenzo Sauras Altuzarra, Feb 12 2021
If prime(n) is not a Fermat prime, then a(n) is also the least m such that prime(n)*2^m is a totient number, or -1 if no such m exists. If prime(n) = 2^2^e + 1 is a Fermat prime, then the least m such that prime(n)*2^m is a totient number is min{2^e, a(n)} if a(n) != -1 or 2^e if a(n) = -1, since 2^2^e * (2^2^e + 1) = phi((2^2^e+1)^2) is a totient number. For example, the least m such that 257*2^m is a totient number is m = 8, rather than a(primepi(257)) = 279; the least m such that 65537*2^m is a totient number is m = 16, rather than a(primepi(65537)) = 287. - Jianing Song, Dec 15 2021

Examples

			a(8) = 6 because prime(8) = 19 and the first prime in the sequence 1 + 19 * {2, 4, 8,1 6, 32, 64} = {39, 77, 153, 305, 609, 1217} is 1217 = 1 + 19 * 2^6.
		

References

Crossrefs

Cf. A046067 (least k such that (2n - 1) * 2^k + 1 is prime).
a(n) = -1 if and only if n is in A076336.

Programs

  • Maple
    a := proc(n)
       local m:
       m := 0:
       while not isprime(1+ithprime(n)*2^m) do m := m+1: od:
       m:
    end: # Lorenzo Sauras Altuzarra, Feb 12 2021
  • Mathematica
    Table[p = Prime[n]; k = 0; While[Not[PrimeQ[1 + p * 2^k]], k++]; k, {n, 100}] (* T. D. Noe *)
  • PARI
    a(n) = my(m=0, p=prime(n)); while (!isprime(1+p*2^m), m++); m; \\ Michel Marcus, Feb 12 2021

Extensions

Corrected by T. D. Noe, Aug 03 2005

A051888 a(n) is the smallest prime p such that p*n! + 1 is prime.

Original entry on oeis.org

2, 2, 2, 2, 3, 2, 3, 3, 7, 3, 3, 5, 2, 3, 13, 7, 31, 5, 2, 7, 17, 67, 41, 3, 13, 3, 43, 17, 97, 7, 29, 109, 3, 71, 5, 2, 7, 41, 3, 59, 3, 11, 29, 7, 107, 67, 79, 3, 743, 149, 163, 2, 211, 2, 19, 71, 73, 23, 37, 113, 149, 67, 41, 617, 107, 37, 107, 283, 113, 19, 239, 107, 73, 97, 5
Offset: 0

Views

Author

Labos Elemer, Dec 15 1999

Keywords

Comments

Analogous to or subset of A051686; generalization of A005384.
The PFGW program has been used to certify all the primes corresponding to the terms up to a(1000), using a deterministic test which exploits the factorization of a(n) - 1. - Giovanni Resta, May 30 2018

Crossrefs

Programs

  • Mathematica
    Do[k = 1; While[ !PrimeQ[ Prime[k]*n! + 1], k++ ]; Print[ Prime[k]], {n, 1, 75} ]
    spp[n_]:=Module[{p=2,nf=n!},While[!PrimeQ[p*nf+1],p=NextPrime[p]];p]; Array[ spp,80,0] (* Harvey P. Dale, May 17 2019 *)
  • PARI
    a(n) = {my(p=2); while (!isprime(p*n! + 1), p = nextprime(p+1)); p;} \\ Michel Marcus, May 28 2018

Formula

a(n) = (A051901(n)-1)/n!. - Amiram Eldar, Feb 25 2025

Extensions

More terms from James Sellers, Dec 16 1999

A051886 a(n) is the minimal prime p such that 2^n * p + 1 is prime.

Original entry on oeis.org

2, 2, 3, 2, 7, 3, 3, 2, 3, 23, 13, 29, 3, 5, 7, 2, 37, 53, 3, 11, 7, 11, 37, 71, 73, 5, 7, 17, 13, 23, 3, 239, 43, 113, 163, 59, 3, 89, 349, 5, 97, 3, 73, 11, 67, 101, 19, 101, 61, 23, 7, 17, 7, 233, 127, 5, 541, 29, 103, 71, 31, 53, 109, 179, 163, 71, 3, 929, 31, 23, 193, 101
Offset: 0

Views

Author

Labos Elemer, Dec 15 1999

Keywords

Comments

The minimal 2^n - Germain primes in order of increasing exponent n.

Examples

			The 10th term is 13, the first term in 1024-Germain prime sequence: {13,19,37,79,223,...}. The largest prime was found for 2^79: both 1427 and 604462909807314587353088*1427 + 1 = 862568572295037916152856577 are primes.
		

Crossrefs

Programs

  • Mathematica
    Table[p = 2; While[! PrimeQ[2^n*p + 1], p = NextPrime@ p]; p, {n, 0, 71}] (* Michael De Vlieger, Mar 05 2017 *)
  • PARI
    P=10^6;
    default(primelimit,P);
    a(n)={my(N=2^n);forprime(p=2,P,if(isprime(N*p+1),return(p)));}
    vector(66,n,a(n))
    /* Joerg Arndt, Jun 18 2012 */

Formula

a(n) = (A051900(n)-1)/2^n. - Amiram Eldar, Feb 28 2025

Extensions

Better name by Joerg Arndt, Jun 18 2012

A051887 Minimal and special 2k-Germain primes, where 2k is in A002110 (primorial numbers).

Original entry on oeis.org

2, 2, 2, 2, 2, 5, 17, 11, 11, 11, 2, 23, 7, 43, 19, 3, 5, 2, 7, 3, 61, 53, 2, 41, 47, 2, 5, 7, 31, 2, 47, 13, 113, 7, 137, 103, 43, 41, 97, 3, 173, 97, 41, 13, 97, 59, 29, 53, 3, 107, 127, 197, 3, 487, 433, 31, 281, 587, 7, 89, 41, 47, 193, 239, 41, 7, 31, 67
Offset: 1

Views

Author

Labos Elemer, Dec 15 1999

Keywords

Comments

a(n) is the minimal prime p such that primorial(n)*p + 1 is also prime.
While p is in A005384, the primorial(n)*p + 1 primes are in A051902 (primorial-safe primes).
Analogous to or subset of A051686, where the even numbers are 2, 6, ..., A002110(n), ...

Examples

			a(25) = 47 because primorial(25)*47 + 1 is also prime and minimal with this property: primorial(25)*47 + 1 = 47*2305567963945518424753102147331756070 + 1 = 108361694305439365963395800924592535291 is a minimal prime. The first 6 terms (2,2,2,2,2,5) correspond to first entries in A005384, A007693, A051645, A051647, A051653, A051654, respectively.
		

Crossrefs

Programs

  • Mathematica
    Table[p = 2; While[! PrimeQ[Product[Prime@ i, {i, n}] p + 1], p = NextPrime@ p]; p, {n, 68}] (* Michael De Vlieger, Jun 29 2017 *)
  • PARI
    a(n) = {my(p = 2, r = vecprod(primes(n))); while(!isprime(p * r + 1), p = nextprime(p+1)); p;} \\ Amiram Eldar, Feb 25 2025

Formula

a(n) = (A051902(n)-1)/A002110(n). - Amiram Eldar, Feb 25 2025

Extensions

More terms from Michael De Vlieger, Jun 29 2017

A051899 Smallest prime p such that (p-1)/(2*n) is also a prime.

Original entry on oeis.org

5, 13, 13, 17, 31, 37, 29, 113, 37, 41, 67, 73, 53, 197, 61, 97, 103, 73, 191, 281, 127, 89, 139, 97, 101, 157, 109, 113, 1103, 181, 311, 193, 199, 137, 211, 937, 149, 229, 157, 241, 1559, 421, 173, 617, 181, 277, 283, 193, 197, 701, 307, 313, 743, 541, 331
Offset: 1

Views

Author

Labos Elemer, Dec 16 1999

Keywords

Examples

			a(2) = 13 because (13 - 1)/4 = 3 = A051686(2).
a(3) = 13 as well, because (13 - 1)/6 = 2 = A051686(3).
a(8) = 113 because (113 - 1)/16 = 7 is a prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = 2}, While[!PrimeQ[2*n*p + 1], p = NextPrime[p]]; 2*n*p + 1]; Array[a, 55] (* Amiram Eldar, Feb 25 2025 *)
  • PARI
    isp(q) = (denominator(q)==1) && isprime(q);
    a(n) = {my(p = 2); while (!isp((p-1)/(2*n)), p = nextprime(p+1)); p;} \\ Michel Marcus, May 29 2018
    
  • PARI
    a(n) = forprime(p = 2, oo, q = 2 * p * n + 1; if(isprime(q), return(q))) \\ David A. Corneth, May 29 2018

Formula

(a(n)-1)/2n = A051686(n), the smallest 2k-Germain primes.

A376579 Least prime p such that p*n+1 is prime, or -1 if no such prime exists.

Original entry on oeis.org

2, 2, 2, 3, 2, 2, -1, 2, 2, 3, 2, 3, -1, 2, 2, 7, -1, 2, -1, 2, 2, 3, 2, 3, -1, 2, -1, 7, 2, 2, -1, 3, 2, 3, 2, 2, -1, 5, 2, 7, 2, 3, -1, 2, -1, 3, -1, 2, -1, 2, 2, 3, 2, 2, -1, 2, -1, 19, -1, 3, -1, 5, 2, 3, 2, 3, -1, 2, 2, 3, -1, 13, -1, 2, 2, 3, -1, 2, -1, 3, 2, 19
Offset: 1

Views

Author

Jean-Marc Rebert, Sep 29 2024

Keywords

Examples

			a(1) = 2 because 2 is the smallest prime p such that 1*p+1 is prime.
		

Crossrefs

Programs

  • PARI
    a(n) = if (n%2, if (isprime(2*n+1), 2, -1), my(p=2); while(!isprime(p*n+1), p = nextprime(p+1)); p); \\ Michel Marcus, Sep 29 2024
Showing 1-9 of 9 results.