login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A281158 Least prime p such that n^2 + (n - p)^2 is prime. 1

%I #22 Feb 01 2017 13:53:34

%S 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,

%T 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,

%U 5,3,3,31,7,3,29,23,5,17,11,19,11,17,5,23,5,3,7,5,5,5,7,17

%N Least prime p such that n^2 + (n - p)^2 is prime.

%C Conjecture: a(n) < n for n > 3.

%C 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, ...

%C 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

%H Robert G. Wilson v, <a href="/A281158/b281158.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 3 because 5^2 + (5 - 2)^2 = 34 is composite and 5^2 + (5 - 3)^2 = 29 is prime.

%t Table[p = 2; While[! PrimeQ[n^2 + (n - p)^2], p = NextPrime@ p]; p, {n, 86}] (* _Michael De Vlieger_, Jan 21 2017 *)

%o (PARI) a(n)=my(p=2); while (! isprime(n^2 + (n - p)^2), p = nextprime(p+1)); p; \\ _Michel Marcus_, Jan 16 2017

%Y Cf. A000040, A002313, A069002.

%K nonn

%O 1,1

%A _Altug Alkan_ and _Thomas Ordowski_, Jan 16 2017

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)