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!)
A162164 Primes p such that p-1 and p+1 can be written as a sum of 2 distinct nonzero squares. 1
179, 233, 467, 521, 739, 809, 1097, 1171, 1601, 1619, 1801, 1873, 1907, 2467, 3203, 3329, 3331, 3491, 3923, 4051, 4177, 4211, 4931, 5507, 5651, 6067, 6121, 6353, 6569, 6659, 7219, 8081, 8243, 8297, 8353, 8819, 9091, 9161, 9377, 10243, 10531, 10657 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
{p=A000040(i): p-1 in A004431 and p+1 in A004431}. - R. J. Mathar, Jul 02 2009
EXAMPLE
p=179 is a term because 179 - 1 = 3^2 + 13^2 and 179 + 1 = 6^2 + 12^2.
MAPLE
isA004431 := proc(n) local x, y ; for x from 1 do if x^2 > n then RETURN(false); fi; y := n-x^2 ; if y> 0 and issqr(y ) then y := sqrt(y) ; if y <> x then RETURN(true) ; fi; fi; od: end:
for n from 1 to 2000 do p := ithprime(n) ; if isA004431(p-1) and isA004431(p+1) then printf("%d, ", p) ; fi; od: # R. J. Mathar, Jul 02 2009
MATHEMATICA
f[n_]:=Module[{k=1}, While[(n-k^2)^(1/2)!=IntegerPart[(n-k^2)^(1/2)], k++; If[2*k^2>=n, k=0; Break[]]]; k]; lst={}; Do[p=Prime[n]; If[f[p-1]>0&&f[p+1]> 0, AppendTo[lst, p]], {n, 4*6!}]; lst
CROSSREFS
Sequence in context: A108384 A217550 A226928 * A238893 A230809 A335067
KEYWORD
nonn
AUTHOR
EXTENSIONS
Definition corrected, R. J. Mathar, Jul 02 2009
STATUS
approved

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 27 16:49 EDT 2024. Contains 372020 sequences. (Running on oeis4.)