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!)
 A281158 Least prime p such that n^2 + (n - p)^2 is prime. 1
 2, 3, 5, 3, 3, 5, 5, 3, 5, 3, 5, 5, 3, 3, 11, 7, 5, 11, 3, 7, 11, 5, 3, 5, 3, 5, 5, 3, 13, 7, 5, 5, 5, 5, 11, 7, 5, 13, 5, 3, 7, 17, 3, 3, 7, 5, 17, 5, 3, 7, 11, 7, 3, 13, 13, 5, 5, 3, 5, 17, 5, 7, 5, 3, 3, 31, 7, 3, 29, 23, 5, 17, 11, 19, 11, 17, 5, 23, 5, 3, 7, 5, 5, 5, 7, 17 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Conjecture: a(n) < n for n > 3. Respectively, corresponding prime values of n^2 + (n - p)^2 are 2, 5, 13, 17, 29, 37, 53, 89, 97, 149, 157, 193, 269, 317, 241, 337, 433, 373, 617, 569, ... First occurrence of p: 1, 2, 3, 16, 15, 29, 42, 74, 70, 69, 66, 107, 186, 188, 237, 324, 304, 358, 651, 961, 1499, 892, 1259, 804, 831, 1133, 754, 727, 2007, 2908, 2556, 3793, 956, 1502, 847, 3093, 4191, 6578, 13386, 8753, 3064, 6566, 17091, etc. Robert G. Wilson v, Jan 29 2017 LINKS Robert G. Wilson v, Table of n, a(n) for n = 1..10000 EXAMPLE a(5) = 3 because 5^2 + (5 - 2)^2 = 34 is composite and 5^2 + (5 - 3)^2 = 29 is prime. MATHEMATICA Table[p = 2; While[! PrimeQ[n^2 + (n - p)^2], p = NextPrime@ p]; p, {n, 86}] (* Michael De Vlieger, Jan 21 2017 *) PROG (PARI) a(n)=my(p=2); while (! isprime(n^2 + (n - p)^2), p = nextprime(p+1)); p; \\ Michel Marcus, Jan 16 2017 CROSSREFS Cf. A000040, A002313, A069002. Sequence in context: A251542 A131971 A321882 * A100742 A001269 A201769 Adjacent sequences:  A281155 A281156 A281157 * A281159 A281160 A281161 KEYWORD nonn AUTHOR Altug Alkan and Thomas Ordowski, Jan 16 2017 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 April 8 04:26 EDT 2020. Contains 333312 sequences. (Running on oeis4.)