editing
approved
editing
approved
(PARI) a(n) = {my(p=2); while (! isprime(n^2 + (n - p)^2), p = nextprime(p+1)); p; } \\ Michel Marcus, Jan 16 2017
proposed
editing
editing
proposed
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
Robert G. Wilson v, <a href="/A281158/b281158.txt">Table of n, a(n) for n = 1..10000</a>
proposed
editing
editing
proposed
Table[p = 2; While[! PrimeQ[n^2 + (n - p)^2], p = NextPrime@ p]; p, {n, 86}] (* Michael De Vlieger, Jan 21 2017 *)
proposed
editing
editing
proposed
Conjecture: such p a(n) < n for n > 3.
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, 5, 3, 13, 11, 17, 5, 11, 3, 3, 5, 7, 5, 5, 11