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!)
A217001 Numbers k such that (k^2 + k + 2)/4 is prime. 2

%I #20 Mar 24 2020 06:38:27

%S 2,6,9,14,22,25,30,33,41,46,49,54,57,62,86,89,97,113,118,121,126,134,

%T 142,161,177,198,201,209,214,217,222,225,238,254,265,273,278,286,294,

%U 302,305,310,313,321,329,337,342,350,366,393,414,417,425,441,449,470

%N Numbers k such that (k^2 + k + 2)/4 is prime.

%C (A000217(a(n))+1)/2 is prime.

%H Daniel Starodubtsev, <a href="/A217001/b217001.txt">Table of n, a(n) for n = 1..10000</a>

%e For k=2, (k^2 + k + 2)/4 = 2 is prime. Then 2 is in the sequence.

%e For k=6, (k^2 + k + 2)/4 = 11 is prime. Then 6 is in the sequence.

%e For k=5, (k^2 + k + 2)/4 = 8 is not prime. Then 5 is not in the sequence.

%p tn := unapply(n*(n+1)/2,n):

%p f := unapply((t+1)/2,t):

%p T := []: N := []: P := []:

%p for k from 0 to 5000 do

%p t:=tn(k):

%p p := f(k):

%p if p = floor(p) then

%p p = floor(p):

%p if isprime(p) then

%p T := [op(T), t]:

%p N := [op(N), k]:

%p P := [op(P), p]:

%p end if:

%p end if:

%p if nops(T) = 50 then

%p break:

%p end if:

%p end do:

%p N := N;

%t Select[Range[500], PrimeQ[(#^2 + # + 2)/4] &] (* _T. D. Noe_, Sep 24 2012 *)

%o (PARI) is(n)=isprime((n^2+n+2)/4) \\ _Charles R Greathouse IV_, Jun 13 2017

%Y Cf. A000040.

%K nonn,easy

%O 1,1

%A _César Eliud Lozada_, Sep 22 2012

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 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)