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.

A265759 Numerators of primes-only best approximates (POBAs) to 1; see Comments.

Original entry on oeis.org

3, 2, 5, 13, 11, 19, 17, 31, 29, 43, 41, 61, 59, 73, 71, 103, 101, 109, 107, 139, 137, 151, 149, 181, 179, 193, 191, 199, 197, 229, 227, 241, 239, 271, 269, 283, 281, 313, 311, 349, 347, 421, 419, 433, 431, 463, 461, 523, 521, 571, 569, 601, 599, 619, 617
Offset: 1

Views

Author

Clark Kimberling, Dec 15 2015

Keywords

Comments

Suppose that x > 0. A fraction p/q of primes is a primes-only best approximate (POBA), and we write "p/q in B(x)", if 0 < |x - p/q| < |x - u/v| for all primes u and v such that v < q. Note that for some choices of x, there are values of q for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...).
See A265772 and A265774 for definitions of lower POBA and upper POBA. In the following guide, for example, A001359/A006512 represents (conjecturally in some cases) the Lower POBAs p(n)/q(n) to 1, where p = A001359 and q = A006512 except for first terms in some cases. Every POBA is either a lower POBA or an upper POBA.
x Lower POBA Upper POBA POBA

Examples

			The POBAs for 1 start with 3/2, 2/3, 5/7, 13/11, 11/13, 19/17, 17/19, 31/29, 29/31, 43/41, 41/43, 61/59, 59/61. For example, if p and q are primes and q > 13, then 11/13 is closer to 1 than p/q is.
		

Crossrefs

Programs

  • Mathematica
    x = 1; z = 200; p[k_] := p[k] = Prime[k];
    t = Table[Max[Table[NextPrime[x*p[k], -1]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tL = Select[d, # > 0 &] (* lower POBA *)
    t = Table[Min[Table[NextPrime[x*p[k]]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tU = Select[d, # > 0 &] (* upper POBA *)
    v = Sort[Union[tL, tU], Abs[#1 - x] > Abs[#2 - x] &];
    b = Denominator[v]; s = Select[Range[Length[b]], b[[#]] == Min[Drop[b, # - 1]] &];
    y = Table[v[[s[[n]]]], {n, 1, Length[s]}] (* POBA, A265759/A265760 *)
    Numerator[tL]   (* A001359 *)
    Denominator[tL] (* A006512 *)
    Numerator[tU]   (* A006512 *)
    Denominator[tU] (* A001359 *)
    Numerator[y]    (* A265759 *)
    Denominator[y]  (* A265760 *)

A007693 Primes p such that 6*p + 1 is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 23, 37, 47, 61, 73, 83, 101, 103, 107, 131, 137, 151, 173, 181, 233, 241, 257, 263, 271, 277, 283, 293, 311, 313, 331, 347, 367, 373, 397, 443, 461, 467, 503, 557, 577, 593, 601, 607, 641, 653, 661, 683, 727, 751, 761, 773, 787, 797, 853
Offset: 1

Views

Author

Keywords

References

  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 83.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002476, A016921, A024899, A051644, A091178, A023256 (subset: 6*(6p+1)+1 also prime).
Prime terms of A024899.

Programs

  • Magma
    [n: n in [0..1000] | IsPrime(n) and IsPrime(6*n+1)]; // Vincenzo Librandi, Nov 18 2010
    
  • Mathematica
    Select[Prime@Range[150], PrimeQ[6# + 1] &] (* Ray Chandler, Mar 14 2007  *)
  • PARI
    isok(k) = isprime(k) && isprime(6*k+1); \\ Amiram Eldar, Feb 24 2025

Formula

a(n) = (A051644(n)-1)/6.

Extensions

Extended by Ray Chandler, Mar 14 2007

A051686 Smallest prime p such that 2n*p+1 is also prime.

Original entry on oeis.org

2, 3, 2, 2, 3, 3, 2, 7, 2, 2, 3, 3, 2, 7, 2, 3, 3, 2, 5, 7, 3, 2, 3, 2, 2, 3, 2, 2, 19, 3, 5, 3, 3, 2, 3, 13, 2, 3, 2, 3, 19, 5, 2, 7, 2, 3, 3, 2, 2, 7, 3, 3, 7, 5, 3, 3, 2, 2, 7, 2, 3, 3, 3, 2, 7, 3, 2, 3, 2, 2, 13, 3, 2, 37, 5, 3, 3, 2, 2, 13, 3, 5, 3, 2, 11, 13, 2, 2, 31, 3, 3, 7, 2, 5, 3, 3, 2, 7, 2, 2
Offset: 1

Views

Author

Keywords

Comments

These are the primes arising in A051899.

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[k = 1; While[! PrimeQ[2 n Prime@ k + 1], k++]; Prime@ k, {n, 120}] (* Michael De Vlieger, Jul 26 2016 *)
  • PARI
    a(n) = p=2; while(!isprime(2*n*p+1), p = nextprime(p+1)); p; \\ Michel Marcus, Dec 10 2013

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

A265770 Numerators of primes-only best approximates (POBAs) to 6; see Comments.

Original entry on oeis.org

13, 11, 19, 17, 31, 29, 43, 41, 67, 79, 103, 101, 113, 139, 137, 173, 223, 257, 283, 281, 317, 353, 367, 401, 439, 499, 607, 619, 617, 643, 641, 653, 677, 761, 787, 823, 821, 907, 941, 977, 1039, 1087, 1181, 1193, 1361, 1373, 1399, 1433, 1447, 1543, 1579
Offset: 1

Views

Author

Clark Kimberling, Dec 20 2015

Keywords

Comments

Suppose that x > 0. A fraction p/q of primes is a primes-only best approximate (POBA), and we write "p/q in B(x)", if 0 < |x - p/q| < |x - u/v| for all primes u and v such that v < q, and also, |x - p/q| < |x - p'/q| for every prime p' except p. Note that for some choices of x, there are values of q for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...). See A265759 for a guide to related sequences.

Examples

			The POBAs to 6 start with 13/2, 11/2, 19/3, 17/3, 31/5, 29/5, 43/7, 41/7, 67/11, 79/13, 103/17, 101/17. For example, if p and q are primes and q > 17, then 103/17 (and 101/17) is closer to 6 than p/q is.
		

Crossrefs

Programs

  • Mathematica
    x = 6; z = 200; p[k_] := p[k] = Prime[k];
    t = Table[Max[Table[NextPrime[x*p[k], -1]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tL = Select[d, # > 0 &] (* lower POBA *)
    t = Table[Min[Table[NextPrime[x*p[k]]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tU = Select[d, # > 0 &] (* upper POBA *)
    v = Sort[Union[tL, tU], Abs[#1 - x] > Abs[#2 - x] &];
    b = Denominator[v]; s = Select[Range[Length[b]], b[[#]] == Min[Drop[b, # - 1]] &];
    y = Table[v[[s[[n]]]], {n, 1, Length[s]}] (* POBA, A265770/A265771 *)
    Numerator[tL]   (* A227756 *)
    Denominator[tL] (* A158015 *)
    Numerator[tU]   (* A051644 *)
    Denominator[tU] (* A007693 *)
    Numerator[y]    (* A222570 *)
    Denominator[y]  (* A265771 *)

A265771 Denominators of primes-only best approximates (POBAs) to 6; see Comments.

Original entry on oeis.org

2, 2, 3, 3, 5, 5, 7, 7, 11, 13, 17, 17, 19, 23, 23, 29, 37, 43, 47, 47, 53, 59, 61, 67, 73, 83, 101, 103, 103, 107, 107, 109, 113, 127, 131, 137, 137, 151, 157, 163, 173, 181, 197, 199, 227, 229, 233, 239, 241, 257, 263, 269, 271, 277, 283, 283, 293, 311
Offset: 1

Views

Author

Clark Kimberling, Dec 20 2015

Keywords

Comments

Suppose that x > 0. A fraction p/q of primes is a primes-only best approximate (POBA), and we write "p/q in B(x)", if 0 < |x - p/q| < |x - u/v| for all primes u and v such that v < q, and also, |x - p/q| < |x - p'/q| for every prime p' except p. Note that for some choices of x, there are values of q for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...). See A265759 for a guide to related sequences.

Examples

			The POBAs to 6 start with 13/2, 11/2, 19/3, 17/3, 31/5, 29/5, 43/7, 41/7, 67/11, 79/13, 103/17, 101/17. For example, if p and q are primes and q > 17, then 103/17 (and 101/17) is closer to 6 than p/q is.
		

Crossrefs

Programs

  • Mathematica
    x = 6; z = 200; p[k_] := p[k] = Prime[k];
    t = Table[Max[Table[NextPrime[x*p[k], -1]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tL = Select[d, # > 0 &] (* lower POBA *)
    t = Table[Min[Table[NextPrime[x*p[k]]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tU = Select[d, # > 0 &] (* upper POBA *)
    v = Sort[Union[tL, tU], Abs[#1 - x] > Abs[#2 - x] &];
    b = Denominator[v]; s = Select[Range[Length[b]], b[[#]] == Min[Drop[b, # - 1]] &];
    y = Table[v[[s[[n]]]], {n, 1, Length[s]}] (* POBA, A265770/A265771 *)
    Numerator[tL]   (* A227756 *)
    Denominator[tL] (* A158015 *)
    Numerator[tU]   (* A051644 *)
    Denominator[tU] (* A007693 *)
    Numerator[y]    (* A222570 *)
    Denominator[y]  (* A265771 *)

A051902 Minimal primorial safe primes: p and primorial*p + 1 are both primes.

Original entry on oeis.org

5, 13, 61, 421, 4621, 150151, 8678671, 106696591, 2454021571, 71166625531, 401120980261, 170676977100631, 2129751844690471, 562558737261811291, 11682905869181336791, 97767475431570134191, 9613801750771063195351, 234576762718813941966541, 55008250857561869391153631
Offset: 1

Views

Author

Labos Elemer, Dec 16 1999

Keywords

Comments

In A051888, 13 of the first 25 values are distinct, while here all corresponding min-primorial-safe-primes are different: {2,5,17,11,23,43,19,3,7,61,53,41,47}.

Examples

			The first five terms of A051887 are 2, so the first 5 terms have the form 1 + 2*A002110(n): 5, 13, 61, 421, 4621, which are smallest terms in A005385, A051644, A051646, A051648, A051649. The 6th term here is A051651(1) = A051887(6)*A002110(6) + 1 = 5*30030 + 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = 2, r =Times @@ Prime[Range[n]]}, While[!PrimeQ[p * r + 1], p = NextPrime[p]]; p * r + 1]; Array[a, 20] (* Amiram Eldar, Feb 25 2025 *)
  • PARI
    a(n) = {my(p = 2, r = vecprod(primes(n))); while(!isprime(p * r + 1), p = nextprime(p+1)); p * r + 1;} \\ Amiram Eldar, Feb 25 2025

Formula

a(n) = 1 + A002110(n)*A051887(n).

A158014 Primes p such that (p-1)/8 is also prime.

Original entry on oeis.org

17, 41, 89, 137, 233, 569, 809, 857, 1049, 1097, 1193, 1433, 1913, 2153, 2777, 3209, 3449, 3593, 3833, 3929, 4073, 4457, 4793, 4937, 5273, 5417, 6089, 6473, 6569, 6857, 7433, 7529, 7577, 7817, 9209, 9497, 9833
Offset: 1

Views

Author

Roger L. Bagula, Mar 11 2009

Keywords

Crossrefs

Cf. A005385 for (p-1)/2, A090866 for (p-1)/4, A051644 for (p-1)/6, A055781 for (p-1)/10.

Programs

  • Mathematica
    Flatten[Table[If[PrimeQ[n] && PrimeQ[(n - 1)/8], n, {}], {n, 1, 10000}]]
    Select[Prime[Range[1500]], PrimeQ[(# - 1) / 8]&] (* Vincenzo Librandi, Apr 14 2013 *)
  • PARI
    list(lim)=my(v=List()); forprime(p=2,(lim-1)\8, if(isprime(8*p+1), listput(v,8*p+1))); Vec(v) \\ Charles R Greathouse IV, Oct 20 2021

Formula

a(n)=8*A023228(n)+1. - R. J. Mathar, Mar 15 2009
a(n) >> n log^2 n. - Charles R Greathouse IV, Oct 21 2021

Extensions

Edited by the Associate Editors of the OEIS, Apr 22 2009

A158018 Primes p such that (p - 1)/12 is also prime.

Original entry on oeis.org

37, 61, 157, 229, 277, 349, 373, 709, 733, 853, 877, 997, 1069, 1213, 1237, 1669, 1789, 2293, 2389, 2677, 2749, 2797, 3229, 3253, 3373, 3517, 3733, 4549, 4597, 4813, 4909, 5197, 5557, 5749, 6037, 6277, 6829, 7213, 7573, 7717, 7933, 8293, 8629, 9013, 9133
Offset: 1

Views

Author

Roger L. Bagula, Mar 11 2009

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[If[PrimeQ[n] && PrimeQ[(n - 1)/12], n, {}], {n, 1, 10000}]]
    Select[Prime[Range[1500]], PrimeQ[(# - 1) / 12]&] (* Vincenzo Librandi, Apr 14 2013 *)

Formula

a(n)=12*A075704(n)+1. [From R. J. Mathar, Mar 15 2009]

Extensions

Definition slightly rephrased - The Assoc. Eds. of the OEIS, Aug 30 2010

A256172 Primes of the form 6*p + 1 with p prime that are also of the form x^2 + 27*y^2 and congruent to 7 mod 24.

Original entry on oeis.org

31, 223, 439, 1399, 2383, 2767, 3343, 3463, 3607, 4567, 6079, 7927, 8167, 8287, 8719, 10159, 10663, 11959, 14503, 15559, 15727, 17383, 18223, 19087, 20743, 21487, 21559, 24007, 25639, 26647, 27103, 27583, 28807, 28879, 29167, 29599, 31183, 32359, 33343
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jun 01 2015

Keywords

Comments

a(n) divides 2^m - 1, where m = (a(n) - 7)/6 + 1.

Crossrefs

Subsequence of A122094.

Formula

A014752 INTERSECT A051644 INTERSECT A107006.
Showing 1-10 of 10 results.