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

 


Numbers n such that n*(n-1)-1 and n*(n+3)+1 are both prime.
0

%I #6 Sep 16 2015 13:27:50

%S 3,4,5,7,9,10,12,14,20,25,27,29,40,45,47,49,54,55,65,67,69,84,95,102,

%T 139,154,159,170,175,185,187,192,194,219,232,245,247,264,289,295,297,

%U 302,304,350,359,379,392,394,419,432,449,454,462,472,474,495,500

%N Numbers n such that n*(n-1)-1 and n*(n+3)+1 are both prime.

%e 3,s=3+4=7,t=3*4=12,t-s=12-7=5, prime, t+s=12+5=17, prime

%e 4,s=4+5=9,t=4*5=20,t-s=20-9=11, prime,t+s=20+9=29, prime

%p a:=proc(n) local s, t: s:= 2*n+1: t:= n*(n+1): if isprime(t-s)=true and isprime(t+s)=true then n else end if end proc: seq(a(n),n=1..400); # _Emeric Deutsch_, Mar 31 2008

%t a = ""; For[i = 1, i < 10^2, j = i + 1; s = i + j; m = i*j; p1 = m - s;p2 = m + s; If[PrimeQ[p1] && PrimeQ[p2], a = a <> ToString[i] <> ","];i++ ]; Print[a <> ".."]

%t Select[Range[500], PrimeQ[ #*(# - 1) - 1] && PrimeQ[ #*(# + 3) + 1] &] (* _Stefan Steinerberger_, Mar 24 2008 *)

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Mar 21 2008

%E Edited with more terms by _Stefan Steinerberger_ and _Emeric Deutsch_, Mar 24 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 September 24 00:34 EDT 2024. Contains 376185 sequences. (Running on oeis4.)