The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A204065 Least nonnegative integer k with n+k and n+k^2 both prime. 7
 1, 0, 0, 1, 0, 1, 0, 3, 2, 1, 0, 1, 0, 3, 2, 1, 0, 1, 0, 3, 16, 1, 0, 7, 4, 15, 2, 1, 0, 1, 0, 9, 8, 3, 6, 1, 0, 3, 2, 1, 0, 1, 0, 3, 8, 1, 0, 5, 10, 3, 10, 1, 0, 5, 4, 15, 2, 1, 0, 1, 0, 21, 4, 3, 6, 1, 0, 15, 2, 1, 0, 1, 0, 33, 8, 25, 6, 1, 0, 3, 16, 1, 0, 5, 4, 15, 14, 1, 0, 7, 6, 9, 4, 3, 6, 1, 0, 3, 2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,8 COMMENTS Conjecture: For any n > 0 not among 1, 21, 326, 341, 626, we have a(n) < sqrt(n)*log(n). If n > 626 is not equal to 971, then n+k and n+k^2 are both prime for some 0< k < sqrt(n)*log(n). Also, n+k^2 is prime for some 0< k <= sqrt(n) if n > 43181. Obviously, a(n)=0 iff n is a prime. - M. F. Hasler, Jan 11 2013 LINKS Zhi-Wei Sun, Table of n, a(n) for n = 1..10000 Zhi-Wei Sun, Conjectures involving primes and quadratic forms, arXiv:1211.1588. EXAMPLE a(8)=3 since 8+3 and 8+3^2 are both prime, but none of 8, 8+1, 8+2 is prime. MATHEMATICA Do[Do[If[PrimeQ[n+k]==True&&PrimeQ[n+k^2]==True, Print[n, " ", k]; Goto[aa]], {k, 0, n}]; Label[aa]; Continue, {n, 1, 100}] PROG (PARI) a(n)=my(k=0); while(!isprime(n+k) || !isprime(n+k^2), k++); k \\ - M. F. Hasler, Jan 11 2013 CROSSREFS Cf. A185636, A071558. Sequence in context: A214845 A071960 A056898 * A275281 A204176 A062160 Adjacent sequences:  A204062 A204063 A204064 * A204066 A204067 A204068 KEYWORD nonn AUTHOR Zhi-Wei Sun, Jan 09 2013 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 September 27 16:20 EDT 2020. Contains 337383 sequences. (Running on oeis4.)