login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A105455 Numbers n such that n*prime(n)+(n+1)*prime(n+1)+(n+2)*prime(n+2) is prime. 9

%I #14 Sep 08 2022 08:45:17

%S 1,6,12,20,22,24,28,30,34,56,60,142,144,148,168,192,196,230,252,260,

%T 276,282,304,322,334,344,346,352,366,374,380,386,394,404,418,424,432,

%U 440,444,470,478,484,572,590,610,612,630,642,662,684,754,766,784,790,840,842,874,886

%N Numbers n such that n*prime(n)+(n+1)*prime(n+1)+(n+2)*prime(n+2) is prime.

%H Michael S. Branicky, <a href="/A105455/b105455.txt">Table of n, a(n) for n = 1..10000</a>

%e n=1: 1*prime(1) + 2*prime(2) + 3*prime(3) = 1*2 + 2*3 + 3*5 = 23 prime,

%e n=6: 6*prime(6) + 7*prime(7) + 8*prime(8) = 6*13 + 7*17 + 8*19 = 349 prime. - _Zak Seidov_, Feb 18 2016

%t bb={};Do[If[PrimeQ[n Prime[n]+(n+1) Prime[n+1]+(n+2) Prime[n+2]], bb=Append[bb, n]], {n, 1, 400}];bb

%t Select[Range@ 900, PrimeQ[# Prime[#] + (# + 1) Prime[# + 1] + (# + 2) Prime[# + 2]] &] (* _Michael De Vlieger_, Feb 05 2016 *)

%o (PARI) lista(nn) = {for(n=1, nn, if(ispseudoprime(n*prime(n)+(n+1)*prime(n+1)+(n+2)*prime(n+2)), print1(n, ", "))); } \\ _Altug Alkan_, Feb 05 2016

%o (Magma) [n: n in [1..1000] | IsPrime(n*NthPrime(n)+(n+1)*NthPrime(n+1)+(n+2)*NthPrime(n+2))]; // _Vincenzo Librandi_, Feb 06 2016

%o (Python)

%o from itertools import islice

%o from sympy import isprime, nextprime

%o def agen(): # generator of terms

%o m, p, q, r = 1, 2, 3, 5

%o while True:

%o t = m*p + (m+1)*q + (m+2)*r

%o if isprime(t): yield m

%o m, p, q, r = m+1, q, r, nextprime(r)

%o print(list(islice(agen(), 58))) # _Michael S. Branicky_, May 17 2022

%Y Cf. A033286, A105454, A152117, A119487.

%K nonn

%O 1,2

%A _Zak Seidov_, May 02 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)