login
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
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
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
KEYWORD
nonn
AUTHOR
Altug Alkan and Thomas Ordowski, Jan 16 2017
STATUS
approved