This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A249112 Second smallest k > 0 such that n+(1+2+...+k) is prime. 3
 3, 2, 7, 2, 8, 10, 4, 5, 7, 2, 8, 10, 4, 5, 16, 2, 8, 10, 7, 6, 16, 5, 8, 22, 7, 5, 16, 2, 15, 22, 4, 6, 7, 9, 8, 13, 4, 5, 19, 2, 11, 10, 7, 5, 16, 5, 8, 13, 12, 6, 7, 5, 8, 22, 7, 5, 16, 2, 15, 13, 4, 9, 16, 5, 8, 13, 8, 5, 7, 2, 11, 10, 4, 14, 16, 6, 8 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Take the counting numbers and continue adding 1, 2, ..., a(n) until reaching a second prime. Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014 It appears that the minimum value reached by a(n) is 2, and this occurs for n= 2, 4, 10, 16, 28, 40, 58, 70, ... Is this A144834? - Michel Marcus, Oct 26 2014 LINKS Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 FORMULA n+A000217(k) is prime for k=a(n) and exactly one smaller positive value. - M. F. Hasler, Oct 21 2014 EXAMPLE a(3)=7 because 3+1+2+3+4+5+6+7=31 and one partial sum is prime. a(4)=2 because 4+1=5 and 4+1+2=7. MATHEMATICA Table[k = 0; Do[k++; While[! PrimeQ[n + Total@ Range@ k], k++], {x, 2}]; k, {n, 77}] (* Michael De Vlieger, Jan 03 2016 *) PROG (PARI) a(n)=my(k, s=2); while(s, if(isprime(n+=k++), s--)); k \\ Charles R Greathouse IV, Oct 21 2014 (PARI) a(n, s=2)=my(k); until(isprime(n+=k++)&&!s--, ); k \\ allows one to get A249113(n) as a(n, 3). - M. F. Hasler, Oct 21 2014 CROSSREFS Cf. A085415, A249113. Sequence in context: A174238 A175920 A200593 * A265219 A266664 A245601 Adjacent sequences:  A249109 A249110 A249111 * A249113 A249114 A249115 KEYWORD easy,nonn AUTHOR Gil Broussard, Oct 21 2014 STATUS approved

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

Last modified May 20 05:35 EDT 2019. Contains 323418 sequences. (Running on oeis4.)