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!)
A078770 a(n) = the least positive integer k such that k^2 + k + N is prime, where N is the n-th positive odd integer. 1

%I #13 Sep 24 2017 17:28:41

%S 1,1,1,2,1,1,2,1,1,3,1,2,2,1,1,2,4,1,2,1,1,5,1,2,3,1,2,2,1,1,2,4,1,2,

%T 1,1,2,7,1,5,1,2,3,1,3,2,4,1,2,1,1,2,1,1,5,1,10,3,4,3,2,7,1,3,1,2,2,1,

%U 1,3,7,2,2,1,1,2,4,1,2,4,1,5,1,2,3,1

%N a(n) = the least positive integer k such that k^2 + k + N is prime, where N is the n-th positive odd integer.

%C k^2 + k + n for even n is always even and > 2, so is never prime.

%H Charles R Greathouse IV, <a href="/A078770/b078770.txt">Table of n, a(n) for n = 1..10000</a>

%e For n=1, k^2+k+1 is prime for k=1, since it is 3.

%e For n=7, k^2+k+7 is not prime for k=1, but is prime for k=2, since it is 13.

%t lpik[n_]:=Module[{k=1},While[!PrimeQ[k^2+k+n],k++];k]; Table[lpik[n],{n,1,181,2}] (* _Harvey P. Dale_, Sep 24 2017 *)

%o (PARI) lista(nn) = {forstep (n=1, nn, 2, k = 1; while(! isprime(k*k + k + n), k++); print1(k, ", "););} \\ _Michel Marcus_, May 18 2013

%o (PARI) a(n)=my(k=1);while(!isprime(k^2+k+2*n-1),k++);k \\ _Charles R Greathouse IV_, May 19 2013

%K nonn

%O 1,4

%A _Joseph L. Pe_, Jan 09 2003

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 June 20 11:12 EDT 2024. Contains 373527 sequences. (Running on oeis4.)