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 12 results. Next

A069142 Primes p such that p+2, 2p+1, and 2p+3 are also prime.

Original entry on oeis.org

5, 29, 659, 809, 2129, 2549, 3329, 3389, 5849, 6269, 10529, 33179, 41609, 44129, 53549, 55439, 57329, 63839, 65099, 70379, 70979, 72269, 74099, 74759, 78779, 80669, 81929, 87539, 93239, 102299, 115469, 124769, 133979, 136949, 156419
Offset: 1

Views

Author

Neil Fernandez, Apr 08 2002

Keywords

Comments

Previous name: Lower prime in a twin pair that yields another.
a(n) gives the terms for A005382(i)-A005384(j)=2. - J. M. Bergot, Mar 12 2015

Examples

			659 and 661 form a prime twin pair. Their sum is 1320. 1320 is sandwiched between 1319 and 1321, which form another prime twin pair. So 659 is in the sequence.
		

Crossrefs

Cf. A014574.
Cf. A066388.

Programs

  • Magma
    [p: p in PrimesUpTo(160000) | IsPrime(p+2) and IsPrime(2*p+1) and IsPrime(2*p+3)]; // Vincenzo Librandi, Apr 09 2013
    
  • Mathematica
    p = q = 1; Do[q = Prime[n]; If[p + 2 == q && PrimeQ[2p + 1] && PrimeQ[2p + 3], Print[p]]; p = q, {n, 1, 10^4}]
    Select[Prime[Range[15000]], PrimeQ[# + 2] && PrimeQ[2 # + 1] && PrimeQ[2 # + 3]&] (* Vincenzo Librandi, Apr 09 2013 *)
  • PARI
    forprime(p=1,10^5,if(isprime(p+2)&&isprime(2*p+1)&&isprime(2*p+3),print1(p,", "))) \\ Derek Orr, Mar 11 2015

Formula

a(n) = A066388(n)-1. - R. J. Mathar, Nov 02 2023

Extensions

Edited and extended by Robert G. Wilson v, Apr 11 2002

A118860 Numbers k such that k-1, k+1, 2k-1, 2k+1, 3k-1, 3k+1, 4k-1 and 4k+1 are all primes.

Original entry on oeis.org

21968100, 37674210, 81875220, 356467230, 416172330, 750662640, 1007393730, 1150070040, 1586271960, 1963954650, 3127171320, 3669568560, 4377895410, 4383541050, 5575083360, 5686935870, 5708418870, 7365234450, 7478474430, 7681046100, 8453862690, 8898688680
Offset: 1

Views

Author

Labos Elemer, May 03 2006

Keywords

Comments

All terms are multiples of 210, hence simpler code is possible.

Examples

			21968100 is a term because 21968099, 21968101, 43936199, 43936201, 65904299, 65904301, 87872399, 87872401 are all prime.
		

Crossrefs

Subsequence of A014574, A066388 and A118859.
Subsequence: A349321.

Programs

  • Mathematica
    tb={};Do[If[(PrimeQ[n-1]&&PrimeQ[n+1])&& (PrimeQ[2*n-1]&&PrimeQ[2*n+1])&& (PrimeQ[3*n-1]&&PrimeQ[3*n+1])&& (PrimeQ[4*n-1]&&PrimeQ[4*n+1]), Print[n];AppendTo[tb,n]], {n,21968100,10^8,210}];tb
    Select[210*Range[424*10^5],AllTrue[{#-1,#+1,2#-1,2#+1,3#-1,3#+1,4#-1,4#+1},PrimeQ]&] (* Harvey P. Dale, Jul 23 2024 *)
  • PARI
    isok(k) = if(k % 210, 0, for(i = 1, 4, forstep(j = -1, 1, 2, if(!isprime(i*k-j), return(0)))); 1); \\ Amiram Eldar, Mar 13 2025

Formula

a(n) = 210*A174293(n).

Extensions

Edited by Don Reble, May 16 2006
a(20)-a(22) from Pontus von Brömssen, Oct 14 2021

A118859 Numbers k such that k-1, k+1, 2*k-1, 2*k+1, 3*k-1 and 3*k+1 are primes.

Original entry on oeis.org

6, 53550, 420420, 422310, 1624350, 2130240, 3399900, 5199810, 5246010, 6549270, 7384440, 7775880, 9516570, 9565710, 10430280, 11845260, 13207950, 14562870, 14619990, 18747960, 20099940, 21596820, 21968100, 24358950, 24610740, 26916120, 28359240, 30838080
Offset: 1

Views

Author

Labos Elemer, May 03 2006

Keywords

Examples

			6 is a term because 5, 7, 11, 13, 17, 19 are all prime.
		

Crossrefs

Subsequence of A014574 and A066388.
Subsequences: A118860, A349321.

Programs

  • Mathematica
    Select[Range[25*10^6],AllTrue[Flatten[{#+{1,-1},2#+{1,-1},3#+{1,-1}}], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 13 2016 *)
  • PARI
    isok(k) = isprime(k-1) && isprime(k+1) && isprime(2*k-1) && isprime(2*k+1) && isprime(3*k-1) && isprime(3*k+1); \\ Amiram Eldar, Mar 13 2025

Formula

a(n) = 6*A290811(n).

Extensions

Edited by Don Reble, May 16 2006
a(26)-a(28) from Jon E. Schoenfield, Dec 07 2021

A348348 Smallest k such that the numbers j*k - 1 and j*k + 1 are prime for 1 <= j <= n.

Original entry on oeis.org

4, 6, 6, 21968100, 100803789240, 683751016938990, 1651735848676253340
Offset: 1

Views

Author

Pontus von Brömssen, Oct 13 2021

Keywords

Comments

The following heuristic argument suggests that a(n) exists for all n: For large (random) k and a specific j <= n, the probability that both j*k - 1 and j*k + 1 are prime should be of the order 1/(log k)^2 (a slight twist of the first Hardy-Littlewood conjecture). Assuming independence between different j, the probability that this holds for 1 <= j <= n is of the order 1/(log k)^(2*n). Since the sum over k of 1/(log k)^(2*n) diverges, this should hold for infinitely many k by the second Borel-Cantelli lemma (assuming independence between different k).

Examples

			a(1) = A014574(1) = 4.
a(2) = A066388(1) = 6.
a(3) = A118859(1) = 6.
a(4) = A118860(1) = 21968100.
a(5) = A349321(1) = 100803789240.
		

Crossrefs

Programs

  • PARI
    isok(k, n) = for (j=1, n, if (!isprime(j*k-1) || !isprime(j*k+1), return(0))); return(1);
    a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Jul 01 2022
  • Python
    from sympy import isprime,nextprime
    def A348348(n):
        p = 2
        while 1:
            p_next = nextprime(p)
            if p_next == p+2 and all(isprime(j*(p+1)-1) and isprime(j*(p+1)+1) for j in range(2,n+1)):
                return p+1
            p = p_next
    

Extensions

a(5), a(6) from Jon E. Schoenfield, Nov 14 2021
a(7) from Klaus Muuss, Jul 01 2022

A349321 Numbers k such that k-1, k+1, 2k-1, 2k+1, 3k-1, 3k+1, 4k-1, 4k+1, 5k-1, and 5k+1 are all primes.

Original entry on oeis.org

100803789240, 441913177860, 1768738337520, 3906037699410, 5988326187690, 6266477200830, 6905441609220, 6973884137220, 14323608903450, 17683172090430, 20047266723330, 23371434572640, 27904703386560, 29484744885750, 31141493827290, 33202639844220, 34645262968470
Offset: 1

Views

Author

Jon E. Schoenfield, Nov 14 2021

Keywords

Comments

All terms are multiples of 2*3*5*7*11 = 2310.
From Jon E. Schoenfield, Mar 21 2022: (Start)
Each term is congruent to one of only
1 residue modulo 2*3*5*7*11 = 2310 (0.04329%),
3 residues modulo 2*3*5*7*11*13 = 30030 (0.00999%),
21 residues modulo 2*3*5*7*...*17 = 510510 (0.00411%),
189 residues modulo 2*3*5*7*...*19 = 9699690 (0.00195%),
2457 residues modulo 2*3*5*7*...*23 = 223092870 (0.00110%),
46683 residues modulo 2*3*5*7*...*29 = 6469693230 (0.00072%),
980343 residues modulo 2*3*5*7*...*31 = 200560490130 (0.00049%), etc.;
making use of these can allow more efficient searching for terms of the sequence.
The Magma program (see Links) generates a list of the possible residues modulo 2*3*5*7*...*31 and tests only numbers having one of those residues. (Note that the program, when run on the Online Magma Calculator, generates only the first three terms of the sequence before being terminated on reaching the 120-second time limit.) (End)

Crossrefs

Programs

  • PARI
    is_ok(k)=for(j=1,5, if(!isprime(j*k-1), return(0)); if(!isprime(j*k+1), return(0));); return(1); \\ Joerg Arndt, Nov 15 2021

A117499 Number of subsets of {n-1, n, n+1} that sum up to a prime.

Original entry on oeis.org

4, 4, 4, 3, 2, 4, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 4, 2, 1, 1, 1, 1, 3, 2, 1, 1, 2, 2, 3, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 0, 2, 2, 1, 1, 2, 2, 2, 0, 1, 1, 1, 2, 3, 1, 0, 0, 0, 1, 3, 2, 2, 2, 2, 1, 2, 1, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 23 2006

Keywords

Comments

0 <= a(n) <= 4; a(A066388(n)) = 4.
a(A221309(n)) = 0; a(A221310(n)) = 4. - Reinhard Zumkeller, Jan 10 2013

Examples

			a(1) = #{2, 0+2=2, 1+2=3, 0+1+2=3} = 4;
a(2) = #{2, 3, 1+2=3, 2+3=5} = 4;
a(3) = #{2, 3, 2+3=5, 3+4=7} = 4;
a(4) = #{3, 5, 3+4=7} = 3;
a(5) = #{5, 5+6=11} = 2.
		

Crossrefs

Cf. A010051.

Programs

Formula

a(n) = A010051(n-1) + A010051(n) + A010051(n+1) + A010051(2*n-1) + A010051(2*n) + A010051(2*n+1).

A185145 Smallest average of twin prime pairs s such that n*s is also average of twin prime pairs.

Original entry on oeis.org

4, 6, 4, 18, 6, 12, 6, 30, 12, 6, 18, 6, 150, 30, 4, 12, 6, 4, 12, 12, 42, 30, 6, 18, 6, 12, 4, 270, 12, 6, 42, 6, 6, 30, 12, 12, 180, 6, 60, 6, 30, 150, 30, 30, 4, 18, 6, 4, 18, 12, 42, 6, 150, 30, 12, 60, 4, 6, 18, 4, 462, 180, 1230, 18, 30, 108, 60, 180, 12
Offset: 1

Views

Author

Manuel Valdivia, Mar 12 2012

Keywords

Comments

Probably for all n>1 and also for all average s there are at least an average n*s. Note that this is equivalent to the Twin Prime Conjecture. Verified n to 10^7. First consecutive averages: 4 to 34260.

Examples

			A014574(12) = 150, then 13*150 = 1950 = A014574(60).
		

Crossrefs

Programs

  • Mathematica
    t=Select[Table[Prime[n] + 1, {n, 10^4}], PrimeQ[#1 + 1] & ]; Table[s:=t[[m]]; m=1; While[!PrimeQ[n*s-1] || !PrimeQ[n*s+1], m++]; s, {n,1,100}]

Formula

a(n) = A014574(j) if n*A014574(j) = A014574(k).

A069175 Numbers k such that k-1, k+1, 2*k-1, 2*k+1, 4*k-1 and 4*k+1 are all prime.

Original entry on oeis.org

211050, 248640, 253680, 410340, 507360, 605640, 1121190, 1138830, 1262100, 2162580, 2172870, 2277660, 4070220, 6305460, 7671510, 11659410, 12577110, 14203770, 14862120, 17472840, 18728640, 18798360, 20520570, 21140700
Offset: 1

Views

Author

Don Reble, Apr 09 2002

Keywords

Examples

			211050 is in the sequence because 211049, 211051, 422099, 422101, 844199 and 844201 are all prime.
		

Crossrefs

Cf. A066388.

Programs

  • Maple
    isA069175 := proc(k)
        if isprime(k-1) and isprime(k+1) and isprime(2*k-1) and isprime(2*k+1) and isprime(4*k-1) and isprime(4*k+1) then
            true ;
        else
            false;
        end if;
    end proc:
    n := 1 :
    for k from 4 by 2 do # create b-file
        if isA069175(k) then
            printf("%d %d\n",n,k) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Nov 02 2023
  • Mathematica
    lst={};Do[If[PrimeQ[n-1]&&PrimeQ[n+1]&&PrimeQ[2*n-1]&&PrimeQ[2*n+1]&&PrimeQ[4*n-1]&&PrimeQ[4*n+1],Print[n];AppendTo[lst,n]],{n,11!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 05 2009 *)
    Select[Range[21150000],AllTrue[{#-1,#+1,2#-1,2#+1,4#-1,4#+1},PrimeQ]&] (* Harvey P. Dale, Aug 19 2025 *)

Extensions

Offset changed to 1 by Georg Fischer, Sep 23 2022

A076504 Numbers k such that (k-1, k+1) and (k/2-1, k/2+1) are both pairs of twin primes.

Original entry on oeis.org

12, 60, 1320, 1620, 4260, 5100, 6660, 6780, 11700, 12540, 21060, 66360, 83220, 88260, 107100, 110880, 114660, 127680, 130200, 140760, 141960, 144540, 148200, 149520, 157560, 161340, 163860, 175080, 186480, 204600, 230940, 249540
Offset: 1

Views

Author

Eric W. Weisstein, Oct 15 2002

Keywords

Comments

Terms after the first are multiples of 60. - Marc Morgenegg, Apr 19 2016

Crossrefs

Cf. A066388.

Programs

  • Mathematica
    Select[Mean /@ Select[Partition[Prime[Range[30000]], 2, 1], Last[#] - First[#] == 2 &], And @@ PrimeQ[#/2 + {1, -1}] &] (* Harvey P. Dale, Jan 23 2014 *)

Formula

a(n) = 2*A066388(n).

Extensions

Definition corrected by Jaroslav Krizek, Apr 12 2009

A363500 Numbers k between twin primes p, q where k+p and k+q are also twin primes, and k*p and k*q are between twin primes.

Original entry on oeis.org

6, 109505970, 1519435260, 22606027290, 25980888360, 33995114580, 42029719620, 45284475810, 56527358160, 63402770550, 73924546080, 82625597670, 121883654550, 150444654360, 192416460810, 210205659510, 258719413680, 270709718160, 284455564050, 309050171430
Offset: 1

Views

Author

Bryce Case, Jr. and Antonio Gimenez, Jun 05 2023

Keywords

Comments

Larger twin primes are found on either side of 6x, so my highly-unoptimized code simply keeps adding 6 and performing the requisite primality checks using golang's "ProbablyPrime" function, a combination of Miller-Rabin and Baillie-PSW, accurate up to 2^64. Based on seminal work by fellow OEIS contributor Antonio Gimenez.
To generate, k = 6x.
p = k-1, q = k+1, check the primality of k+p, k+q, then check the primality of ((k*p) +/- 1) and ((k*q) +/- 1).
If k > x+1 and x > 1, then all eight primes are not divisible by x. If k > 8, then k == 0 (mod 210). - Jason Yuen, Jun 02 2024

Crossrefs

Subsequence of A066388.
Cf. A364263.

Programs

  • Go
    // See link.

Formula

a(n) = 210*A364263(n-1) for n > 1. - Hugo Pfoertner, Jun 03 2024
Showing 1-10 of 12 results. Next