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

A051507 Primes p such that p*q+2 is prime, where q is next prime after p.

Original entry on oeis.org

3, 5, 7, 13, 19, 67, 149, 179, 229, 239, 241, 269, 277, 307, 313, 397, 401, 419, 439, 487, 569, 613, 643, 701, 823, 863, 887, 1051, 1289, 1319, 1489, 1609, 1693, 1783, 1873, 1999, 2143, 2239, 2309, 2423, 2539, 2549, 2593, 2617, 2729, 2753, 2819
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A048880.

Programs

  • Mathematica
    Prime[Select[Range[1000], PrimeQ[Prime[#]*Prime[# + 1] + 2] &]]
    Reap[Do[If[PrimeQ[(p=Prime[k])*Prime[k+1]+2],Sow[p]],{k,1,430}]][[2,1]] (* Zak Seidov, Dec 05 2010 *)
  • PARI
    p=2;forprime(q=3,1e4,if(isprime(p*q+2),print1(p", ")); p=q) \\ Charles R Greathouse IV, May 01 2011
  • Sage
    A051507 = list(p for p in primes(10**4) if is_prime(p*next_prime(p)+2)) # D. S. McNeil, Dec 04 2010
    

A123921 Primes of form p*q - 2 where p and q are consecutive primes.

Original entry on oeis.org

13, 25589, 47051, 67589, 136889, 313589, 960389, 1005971, 1932017, 2301251, 2362331, 6100889, 6310061, 6901091, 7745051, 8236817, 9332987, 10956089, 13104389, 16850987, 19009589, 19201841, 19386371, 19998701, 20566079
Offset: 1

Views

Author

Ville Saalo (vsaalo(AT)iki.fi), Nov 19 2006

Keywords

Examples

			211*223-2 = 47051.
		

Crossrefs

Programs

  • Haskell
    a123921 n = a123921_list !! (n-1)
    a123921_list = filter ((== 1) . a010051) $
       map (flip (-) 2) $ zipWith (*) a000040_list (tail a000040_list)
    -- Reinhard Zumkeller, Nov 11 2011
    
  • Maple
    with (numtheory): for n from 1 to 1000 do if (tau(ithprime(n)*ithprime(n+1)-2)=2) then print(ithprime(n), ithprime(n+1), ithprime(n)*ithprime(n+1)-2); fi; od;
  • Mathematica
    Select[Times@@@Partition[Prime[Range[1500]],2,1]-2,PrimeQ] (* Harvey P. Dale, Feb 23 2012 *)
  • PARI
    p=2; forprime(q=3,1e5, if(isprime(t=p*q-2), print1(t", ")); p=q) \\ Charles R Greathouse IV, Apr 29 2015

A051779 Primes of form pq + 2 where p and q are twin primes.

Original entry on oeis.org

17, 37, 22501, 32401, 57601, 72901, 176401, 324901, 1664101, 1742401, 5336101, 6502501, 7452901, 11289601, 11492101, 18147601, 21622501, 34222501, 34574401, 40449601, 45968401, 81000001, 85377601, 92736901, 110880901, 118592101
Offset: 1

Views

Author

Joe DeMaio (jdemaio(AT)kennesaw.edu), Dec 09 1999

Keywords

Comments

Starting with 3rd term, 22501, all terms are of the form 900n^2+1 with n=5, 6, 8, 9, 14, 19, 43, 44, 77, 85 (A125251). - Zak Seidov, Dec 07 2008
Primes of the form (p^2 + q^2)/2, where p and q are twin primes. - Thomas Ordowski and Altug Alkan, Mar 19 2017

Examples

			The third term 22501 is a member of the sequence because 22501=149*151+2, 22501 is prime and {149,151} is a twin prime pair.
		

Crossrefs

Programs

  • Maple
    with (numtheory): for n from 1 to 2000 do if (ithprime(n+1)-ithprime(n)=2) then if (tau(ithprime(n)*ithprime(n+1)+2)=2) then print(ithprime(n),ithprime(n+1), ithprime(n)*ithprime(n+1)+2); fi; fi; od;
  • Mathematica
    lst={};Do[p=Prime[n];If[Length[Divisors[p-2]]==4&&(Divisors[p-2][[3]]-Divisors[p-2][[2]])==2, AppendTo[lst, p]], {n, 6*10^5}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 08 2008 *)
    Select[(First[#]Last[#]+2)&/@Select[Partition[Prime[Range[2700]], 2,1], Last[#]-First[#]==2&],PrimeQ]  (* Harvey P. Dale, Mar 11 2011 *)
    Select[2 + Times @@@ Select[ Partition[ Prime@ Range@ 1350, 2, 1], First[#] + 2 == Last[#] &], PrimeQ] (* Robert G. Wilson v, Mar 12 2001 *)

Formula

{A037074(k) + 2} INTERSECT {A000040}. {A001359(k) * A006512(k) + 2} INTERSECT {A000040}. {A054735(k)^2 + 2*A054735(k) + 2} INTERSECT {A000040}. - Jonathan Vos Post, May 11 2006

Extensions

Edited by R. J. Mathar, Aug 08 2008

A240596 Primes of the form p*q*r + 2 where p, q and r are consecutive primes.

Original entry on oeis.org

107, 4201, 18181981, 29884303, 72147193, 81927499, 208506511, 383148631, 402473443, 1106558899, 1391119621, 1459314919, 1498299289, 1945171369, 4593570199, 7908301729, 8052037969, 9970592521, 10594343761, 11304695329, 14119758703, 15111907009, 23157107803
Offset: 1

Views

Author

K. D. Bajpai, Apr 08 2014

Keywords

Comments

All the terms in the sequence, except a(1), are congruent to 1 mod 6.

Examples

			107 is prime and appears in the sequence because 107 = (3*5*7)+2.
4201 is prime and appears in the sequence because 4201 = (13*17*19)+2.
		

Crossrefs

Programs

  • Maple
    KD := proc() local a, b; a:=ithprime(n)*ithprime(n+1)*ithprime(n+2); b:=a+2; if isprime(b) then RETURN (b); fi; end: seq(KD(), n=1..1000);
  • Mathematica
    Select[Table[Prime[k]*Prime[k+1]*Prime[k+2]+2,{k,1,300}],PrimeQ]
    Select[Times@@@Partition[Prime[Range[600]],3,1]+2,PrimeQ] (* Harvey P. Dale, Nov 21 2018 *)
  • PARI
    s=[]; for(k=1, 1000, t=prime(k)*prime(k+1)*prime(k+2)+2; if(isprime(t), s=concat(s, t))); s \\ Colin Barker, Apr 09 2014

A342564 Numbers k such that 6*k + 1 is a prime that can be written as p*q + 2, with p and q being consecutive primes.

Original entry on oeis.org

6, 13, 37, 73, 793, 3750, 5400, 8893, 9600, 10082, 12150, 12973, 15913, 16537, 26533, 27335, 29400, 32413, 39853, 54150, 63037, 69337, 82835, 113437, 126142, 134085, 185852, 277350, 290400, 370513, 432553, 478837, 531037, 585937, 667333, 768980, 837013, 889350
Offset: 1

Views

Author

Hugo Pfoertner, Jun 20 2021

Keywords

Examples

			a(1) = 6 because 6*6 + 1 = 37 can be written as 5*7 + 2.
		

Crossrefs

Cf. A048880, whose first term 17 = 3*5 + 2 cannot be written as 6*k + 1.

Programs

  • Maple
    alist := proc(upto) local L, q, p, n, r; L := []; q := 2;
    for n from 1 to upto do
        p := q; q := nextprime(p); r := p * q + 1 ;
        if modp(r, 6) = 0 and isprime(r + 1) then
           L := [op(L), iquo(r, 6)] fi od;
    L end: alist(350); # Peter Luschny, Jun 20 2021
  • Mathematica
    (Select[6Range[10^6]+1, PrimeQ[#] && MatchQ[FactorInteger[#-2], {{p_, 1}, {q_, 1}} /; q == NextPrime[p]]&]-1)/6 (* Jean-François Alcover, Jul 07 2021 *)
  • PARI
    a342564(plim)={my(p1=5);forprime(p2=7,plim,my(p=p1*p2+2);if(isprime(p),print1((p-1)/6,", "));p1=p2)};
    a342564(2400)
    
  • Python
    from primesieve.numpy import n_primes
    from numbthy import isprime
    primesarray = numpy.array(n_primes(10000,1))
    for i in range (0, 9999):
        totest = int(primesarray[i] * primesarray[i+1] + 2)
        if (isprime(totest)) and  (((totest-1)%6) == 0):
            print((totest-1)//6) # Karl-Heinz Hofmann, Jun 20 2021

Formula

a(n) = (A048880(n+1) - 1)/6, excluding A048880(1).

A240715 Primes p such that p*q*r + 6 and p*q*r - 6 are primes where q and r are the next two primes after p.

Original entry on oeis.org

569, 1531, 1549, 7103, 7451, 9013, 10627, 10853, 11779, 11783, 12671, 12941, 14821, 14851, 17489, 18493, 20717, 20959, 25237, 26309, 27739, 29669, 29873, 34549, 35977, 36251, 37591, 38351, 38639, 39551, 40129, 45589, 46957, 47317, 48781, 55163, 55259
Offset: 1

Views

Author

K. D. Bajpai, Apr 10 2014

Keywords

Examples

			569 is in the sequence because 569*571*577 + 6 = 187466729 and 569*571*577 - 6 = 187466717 are both prime where 571 and 577 are the next two primes after 569.
1531 is in the sequence because 1531*1543*1549 + 6 = 3659253823 and 1531*1543*1549 - 6 = 3659253811 are both prime where 1543 and 1549 are the next two primes after 1531.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^5) | IsPrime(t-6) and IsPrime(t+6) where t is p*NextPrime(p)*NextPrime(NextPrime(p))]; // Bruno Berselli, Apr 11 2014
  • Maple
    KD := proc(n) local a,b,d; a:=ithprime(n)*ithprime(n+1)*ithprime(n+2); b:=a+6; d:=a-6; if  isprime(b) and isprime(d) then RETURN (ithprime(n)); fi; end: seq(KD(n), n=1..10000);
  • Mathematica
    c = 0; Do[If[PrimeQ[Prime[n]*Prime[n+1]*Prime[n+2] +6] && PrimeQ[Prime[n]*Prime[n+1]*Prime[n+2] -6],c=c+1;Print[c, " ", Prime[n]]],{n,1,500000}];
    KD={};   f=Prime[n+1]*Prime[n+2];  Do[p=Prime[n]; If[ PrimeQ[p*f+6] && PrimeQ[p*f-6], AppendTo[KD,p]], {n,10000}]; KD
    Select[Partition[Prime[Range[6000]],3,1],AllTrue[Times@@#+{6,-6},PrimeQ]&][[All,1]] (* Harvey P. Dale, Oct 29 2022 *)

A342565 Numbers k such that 6*k - 1 is a prime that can be written as p*q - 2, with p and q being consecutive primes.

Original entry on oeis.org

4265, 7842, 11265, 22815, 52265, 160065, 167662, 322003, 383542, 393722, 1016815, 1051677, 1150182, 1290842, 1372803, 1555498, 1826015, 2184065, 2808498, 3168265, 3200307, 3231062, 3333117, 3427680, 3676962, 3913915, 4042598, 4323102, 4537907, 4623542, 4798955
Offset: 1

Views

Author

Hugo Pfoertner, Jun 20 2021

Keywords

Examples

			a(1) = 4265, because the prime 25589 = 6*4265 - 1 can be written as 157*163 - 2, with 157 and 163 being consecutive primes.
		

Crossrefs

Cf. A123921, whose first term 13 = 3*5 - 2 cannot be written as 6*k - 1.

Programs

  • PARI
    a342565(plim)={my(p1=5);forprime(p2=7,plim,my(p=p1*p2-2);if(isprime(p),print1((p+1)/6,", "));p1=p2)};
    a342565(5400)
    
  • Python
    from primesieve.numpy import n_primes
    from numbthy import isprime
    primesarray = numpy.array(n_primes(10000, 1))
    for i in range (0, 9999):
        totest = int(primesarray[i] * primesarray[i+1] - 2)
        if (isprime(totest)) and  (((totest+1)%6) == 0):
            print((totest+1)//6) # Karl-Heinz Hofmann, Jun 20 2021

Formula

a(n) = (A123921(n+1) + 1)/6, excluding A123921(1).

A078597 Primes of the form p*(p+4)+2 where p and p+4 are primes.

Original entry on oeis.org

23, 79, 223, 439, 4759, 53359, 77839, 95479, 99223, 159199, 194479, 239119, 378223, 416023, 680623, 2223079, 2595319, 2873023, 3186223, 3515623, 4003999, 5022079, 6456679, 6859159, 8732023, 9235519, 9492559, 10017223, 10595023
Offset: 1

Views

Author

Cino Hilliard, Dec 08 2002

Keywords

Comments

More generally, if a and b are even numbers, let Seq(a,b) be the sequence of primes of the form p*(p+a)+b where p and p+a are primes. Seq(a,b) is finite if either a^2+b == 2 (mod 3) or a^2-4*b is a square. Is it infinite in all other cases?

Crossrefs

Except for the term 23, this is a subsequence of A048880. A051779 is Seq(2, 2). A049002 is Seq(0, -2). A045637 is Seq(0, 4).

Programs

  • Mathematica
    Select[ #(#+4)+2&/@Select[Prime/@Range[500], PrimeQ[ #+4]&], PrimeQ]
  • PARI
    prodtp(n1,n2,a,b)=local(f,x); f=0; forprime(x=n1,n2,if(isprime(x+a),f=x*(x+a)+b; if(isprime(f),print(x" "x+a" "f" "); ); ); ); \ Computes that part of Seq(a,b) with n1<=p<=n2.

Extensions

Edited by Dean Hickerson, Dec 10 2002

A078622 Primes of the form prime(n)*prime(n*2)+2.

Original entry on oeis.org

23, 67, 733, 1009, 4603, 16519, 66301, 154459, 161221, 173713, 327079, 750679, 1694809, 1940683, 2023741, 2042281, 3012169, 3852973, 4011523, 4704199, 5407561, 5536213, 7292251, 7347229, 8484901, 11359939, 11633971, 12559189
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 11 2002

Keywords

Examples

			43 = prime(14), 107 = prime(14*2) and 43*107+2 = 4603 is prime, therefore 4603 is a term.
		

Crossrefs

Programs

  • Magma
    [ p: n in [1..400] | IsPrime(p) where p is NthPrime(n)*NthPrime(n*2)+2 ];
  • Mathematica
    Select[Table[Prime[n]Prime[2n]+2,{n,500}],PrimeQ] (* Harvey P. Dale, Nov 28 2011 *)
  • PARI
    for(n=1,1000,p=prime(n);p2=prime(2*n);Q=p*p2+2;if(isprime(Q),print1(Q,", ")))
    

A229570 Primes of form p*q + 30, where p and q are consecutive primes.

Original entry on oeis.org

107, 173, 251, 353, 467, 929, 2521, 4787, 7417, 8663, 10433, 12347, 17977, 19073, 25621, 28921, 32429, 39233, 42019, 50651, 55717, 60521, 77867, 95507, 97373, 99251, 111577, 116969, 126757, 131783, 141397, 159227, 164039, 171401, 186653, 194507, 198937, 205223
Offset: 1

Views

Author

K. D. Bajpai, Sep 26 2013

Keywords

Comments

Conjecture: The expression p*q + c with p and q consecutive primes and c = 30 generates more primes than any other value of c in the range 1 < c < 100 and p = 48611 which is 5000th prime. Hence, c = 30 is considered for this sequence.

Examples

			a(1)=107: prime(4)*prime(5)+30=107, which is prime.
a(6)=929: prime(10)*prime(11)+30=929, which is prime.
		

Crossrefs

Cf. A048880.

Programs

  • Maple
    KD:= proc() local a; a:= ithprime(n)*ithprime(n+1)+30; if isprime((a)) then RETURN((a)):fi;end: seq(KD(),n=1..500);
  • Mathematica
    Select[Table[Prime[n]*Prime[n+1]+30,{n,100}],PrimeQ]
Showing 1-10 of 13 results. Next