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 31-40 of 41 results. Next

A265764 Denominators of primes-only best approximates (POBAs) to 3; see Comments.

Original entry on oeis.org

2, 2, 5, 5, 7, 7, 11, 13, 13, 17, 19, 23, 23, 29, 37, 37, 43, 43, 47, 53, 59, 61, 67, 71, 79, 83, 89, 97, 103, 103, 113, 127, 127, 137, 139, 149, 163, 163, 167, 167, 173, 181, 191, 193, 197, 199, 211, 227, 233, 239, 251, 257, 257, 263, 269, 271, 277, 293
Offset: 1

Views

Author

Clark Kimberling, Dec 18 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 for 3 start with  7/2, 5/2, 17/5, 13/5, 23/7, 19/7, 31/11, 41/13, 37/13, 53/17. For example, if p and q are primes and q > 13, then 41/13 is closer to 3 than p/q is.
		

Crossrefs

Programs

  • Mathematica
    x = 3; 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, A265763/A265764 *)
    Numerator[tL]   (* A091180 *)
    Denominator[tL] (* A088878 *)
    Numerator[tU]   (* A094525 *)
    Denominator[tU] (* A023208 *)
    Numerator[y]    (* A265763 *)
    Denominator[y]  (* A265764 *)

A112391 Primes p such that 23*p + 2 is also prime.

Original entry on oeis.org

3, 7, 19, 37, 43, 67, 103, 157, 193, 277, 337, 367, 373, 379, 397, 439, 457, 463, 547, 607, 829, 859, 877, 919, 1009, 1033, 1039, 1117, 1129, 1213, 1249, 1297, 1429, 1543, 1579, 1627, 1657, 1699, 1723, 1759, 1783, 1789, 1867, 1993, 1999, 2053, 2083, 2089
Offset: 1

Views

Author

Parthasarathy Nambi, Dec 04 2005

Keywords

Examples

			If p=277 then 23*p + 2 = 6373 (prime).
		

Crossrefs

Cf. A023208.

Programs

  • Magma
    [p: p in PrimesUpTo(3000)|  IsPrime(23*p+2)]; // Vincenzo Librandi, Jan 29 2011
  • Mathematica
    Select[Prime[Range[400]],PrimeQ[23#+2]&] (* Harvey P. Dale, Sep 26 2021 *)
  • PARI
    forprime(p=2,5000,if(isprime(23*p+2),print1(p,","))) \\ Lambert Herrgesell, Dec 09 2005
    

Extensions

More terms from Lambert Herrgesell (zero815(AT)googlemail.com), Dec 09 2005

A370156 Primes p such that (p-2)/3 is prime and 3*p+2 is composite.

Original entry on oeis.org

11, 41, 53, 71, 113, 131, 179, 251, 311, 449, 491, 521, 593, 599, 683, 701, 719, 773, 809, 881, 941, 1049, 1061, 1103, 1151, 1229, 1301, 1319, 1373, 1439, 1499, 1511, 1571, 1709, 1733, 1931, 2273, 2309, 2393, 2579, 2591, 2663, 2843, 2861, 2903, 3041, 3119
Offset: 1

Views

Author

Clark Kimberling, Feb 10 2024

Keywords

Comments

None of these primes are lucky (A000959). - Davide Rotondo, Feb 12 2025

Examples

			(11-2)/3 is a prime and 3*11+2 isn't.
		

Crossrefs

Cf. A000040, A000959, A115058 (supersequence), A023208, A370157.

Programs

  • Maple
    filter:= proc(p) isprime(p) and isprime((p-2)/3) and not isprime(3*p+2) end proc:
    select(filter, [seq(i,i=5..10000,6)]); # Robert Israel, Feb 28 2025
  • Mathematica
    Select[Prime[Range[500]], ! PrimeQ[3 # + 2] && PrimeQ[(# - 2)/3] &]
  • PARI
    isok(p) = if (isprime(p), !isprime(3*p+2) && (((p%3) == 2) && isprime((p-2)/3))); \\ Michel Marcus, Feb 17 2024

A023307 Primes that remain prime through 4 iterations of function f(x) = 3x + 2.

Original entry on oeis.org

1129, 10009, 11489, 12539, 13859, 30029, 63079, 77359, 99119, 121039, 124669, 169409, 194749, 205589, 246329, 330329, 349519, 351829, 354839, 361279, 369539, 384589, 395719, 399769, 416989, 429109, 446819, 527599, 532489, 544259, 575119
Offset: 1

Views

Author

Keywords

Comments

Primes p such that 3*p+2, 9*p+8, 27*p+26, and 81*p+80 are also primes. - Vincenzo Librandi, Aug 04 2010

Crossrefs

Subsequence of A023208, A023246, A023277, and A024893.

Programs

  • Magma
    [n: n in [1..1000000] | IsPrime(n) and IsPrime(3*n+2) and IsPrime(9*n+8) and IsPrime(27*n+26) and IsPrime(81*n+80)] // Vincenzo Librandi, Aug 04 2010
  • Mathematica
    Select[Prime[Range[50000]],AllTrue[Rest[NestList[3#+2&,#,4]],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 13 2015 *)

Formula

a(n) == 9 or 69 (mod 70). - John Cerkan, Oct 04 2016

A162338 Primes q such that q = floor(p/3) for some prime p.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 37, 43, 59, 79, 83, 89, 97, 103, 127, 139, 149, 163, 167, 173, 197, 199, 227, 233, 239, 257, 269, 293, 313, 317, 337, 349, 353, 367, 383, 397, 409, 419, 433, 439, 457, 479, 499, 503, 523, 569, 577, 607, 643, 659, 709, 757, 769
Offset: 1

Views

Author

Keywords

Comments

Primes q such that 3*q+1 or 3*q+2 is prime. Agrees with A023208 except for initial term 2.
Essentially the same as A023208. - R. J. Mathar, Jul 05 2009

Examples

			3 is in the sequence since 11 is prime and floor(11/3) = 3; 11 is not in the sequence since 11 = floor(34/3) = floor(35/3) and neither 34 nor 35 is prime.
		

Crossrefs

Cf. A162337. Essentially the same as A023208 (n and 3n+2 are both prime).

Programs

  • Magma
    [ q: q in PrimesUpTo(800) | IsPrime(3*q+1) or IsPrime(3*q+2) ]; // Klaus Brockhaus, Jul 06 2009
    
  • Mathematica
    lst={};Do[r=Prime[n];If[PrimeQ[p=Floor[r/3]],AppendTo[lst,p]],{n,6!}];lst
    Select[Floor[Prime[Range[350]]/3],PrimeQ] (* Harvey P. Dale, Aug 26 2013 *)
    Select[Prime[Range[200]],AnyTrue[3#+{1,2},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 07 2019 *)
  • PARI
    isA162338(n) = isprime(n) && (isprime(3*n+1) || isprime(3*n+2)) \\ Michael B. Porter, Jan 30 2010

Extensions

Edited and listed terms verified by Klaus Brockhaus, Jul 06 2009

A163628 Integers such that the two adjacent integers are a prime and three times a prime.

Original entry on oeis.org

8, 10, 14, 16, 20, 22, 32, 38, 40, 52, 58, 68, 70, 88, 110, 112, 128, 130, 140, 158, 178, 182, 200, 212, 238, 250, 268, 292, 308, 310, 338, 380, 382, 410, 418, 448, 488, 490, 500, 502, 520, 542, 572, 578, 592, 598, 632, 682, 700, 718, 752, 770, 772, 788, 808
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 02 2009

Keywords

Comments

Union[3*A023208 + 1, 3*A088878 - 1]. [Zak Seidov, Aug 07 2009]

Examples

			a(1)=8 which lies between 7=A000040(4) and 9 = A001748(2).
a(2)=10 which lies between 9=A001748(2) and 11 = A000040(5).
		

Crossrefs

Programs

Extensions

Many terms like 44, 46, 62 etc. removed by R. J. Mathar, Aug 06 2009

A370157 Primes p such that both 3p+2 and (p-2)/3 are composite or 0.

Original entry on oeis.org

2, 31, 47, 61, 67, 73, 101, 107, 109, 137, 151, 157, 181, 191, 193, 211, 223, 229, 241, 263, 271, 277, 281, 283, 307, 331, 347, 359, 373, 379, 389, 401, 421, 431, 443, 461, 463, 467, 487, 509, 541, 547, 557, 563, 571, 587, 601, 613, 617, 619, 631, 641, 647
Offset: 1

Views

Author

Clark Kimberling, Feb 10 2024

Keywords

Crossrefs

Cf. A000040, A115058 (supersequence), A023208, A370156.

Programs

  • Mathematica
    Select[Prime[Range[200]], ! PrimeQ[3 # + 2] && ! PrimeQ[(# - 2)/3] &]
  • PARI
    isok(p) = if (isprime(p), !isprime(3*p+2) && !(((p%3) == 2) && isprime((p-2)/3))); \\ Michel Marcus, Feb 17 2024

A120637 Primes such that their triple is 2 away from a prime number.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 59, 61, 67, 71, 79, 83, 89, 97, 103, 113, 127, 137, 139, 149, 163, 167, 173, 181, 191, 193, 197, 199, 211, 227, 233, 239, 251, 257, 263, 269, 271, 277, 293, 307, 313, 317, 331, 337, 347, 349, 353, 367, 373, 383
Offset: 1

Views

Author

Cino Hilliard, Aug 17 2006

Keywords

Comments

This sequence is a variation of the sequence in the reference. However, this sequence should have an infinite number of terms.

Examples

			19 is a prime and 19*3 = 57 which is two away from 59 which is prime.
31 is not in the table because 31*3 = 93 which is 2 away from 91 and 95, both not prime.
		

References

  • R. Crandall and C. Pomerance, Prime Numbers A Computational Perspective, Springer Verlag 2002, p. 49, exercise 1.18.

Crossrefs

Cf. A125272.

Programs

  • Mathematica
    Select[Prime[Range[200]],PrimeQ[3#+2]||PrimeQ[3#-2]&] (* Harvey P. Dale, Aug 10 2011 *)
  • PARI
    primepm2(n,k) { local(x,p1,p2,f1,f2,r); if(k%2,r=2,r=1); for(x=1,n, p1=prime(x); p2=prime(x+1); if(isprime(p1*k+r)||isprime(p1*k-r), print1(p1",") ) ) }

Formula

Union of A023208 and A088878.

A120638 Primes such that their triple is not 2 away from a prime number.

Original entry on oeis.org

2, 31, 41, 73, 101, 107, 109, 131, 151, 157, 179, 223, 229, 241, 281, 283, 311, 359, 379, 389, 421, 449, 463, 509, 521, 547, 563, 571, 599, 613, 617, 619, 631, 641, 647, 653, 661, 683, 691, 701, 719, 733, 739, 743, 773, 787, 809, 811, 821, 827, 829, 839, 857
Offset: 1

Views

Author

Cino Hilliard, Aug 17 2006

Keywords

Comments

This sequence is a variation of the sequence in the reference. However, this sequence should have an infinite number of terms. k=2 in the PARI code.

Examples

			31*3 = 93 which is two away from 91 and 95 both not prime.
		

References

  • R. Crandall and C. Pomerance, Prime Numbers A Computational Perspective, Springer Verlag 2002, p. 49, exercise 1.18.

Crossrefs

Programs

  • Mathematica
    Select[Prime@Range@200,!PrimeQ[3#-2]&&!PrimeQ[3#+2]&] (* Vladimir Joseph Stephan Orlovsky, Apr 25 2011 *)
    Select[Prime[Range[200]],NoneTrue[3#+{2,-2},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Feb 01 2019 *)
  • PARI
    primepm3(n,k) = =number of iterations,k = factor { local(x,p1,p2,f1,f2,r); if(k%2,r=2,r=1); for(x=1,n, p1=prime(x); p2=prime(x+1); if(!isprime(p1*k+r)&!isprime(p1*k-r), print1(p1",") ) ) }

A348307 Primes p such that (p-1)/2, (p-2)/3, 2*p+1, 3*p+2 are all prime numbers.

Original entry on oeis.org

23, 21383, 26459, 28643, 111263, 137339, 217643, 333563, 342599, 423323, 486023, 540539, 548519, 567719, 658943, 671039, 755663, 829463, 865499, 890063, 903803, 976883, 1108259, 1168523, 1199183, 1308383, 1316699, 1318379, 1342403, 1349423, 1390199, 1501583, 1503059, 1558079, 1563119
Offset: 1

Views

Author

Marc Morgenegg, Oct 11 2021

Keywords

Comments

For (p-1)/2, those are the safe primes A005385.

Examples

			23 is a term because: (23-1)/2 = 11, (23-2)/3 = 7, 2*23+1 = 47, 3*23+2 = 71, {23, 11, 7, 47, 71} are all prime numbers.
		

Crossrefs

Cf. A005385 (safe primes).
Intersection of A005385 and A094524 and A005384 and A023208.

Programs

  • Mathematica
    Select[Range[1, 1.5*10^6, 2], AllTrue[{#, (# - 1)/2, (# - 2)/3, 2*# + 1, 3*# + 2}, PrimeQ] &] (* Amiram Eldar, Oct 11 2021 *)
  • PARI
    isok(p) = iferr(isprime(p) && isprime((p-1)/2) && isprime((p-2)/3) && isprime(2*p+1) && isprime(3*p+2), E, 0); \\ Michel Marcus, Oct 11 2021

Extensions

More terms from Michel Marcus, Oct 11 2021
Previous Showing 31-40 of 41 results. Next