OFFSET
1,1
LINKS
Filip Zaludek, Table of n, a(n) for n=1..1000
EXAMPLE
Primes p=13, q=7, and r=11 give 13^2 + 1 = 7^2 + 11^2 = 170, so 13 + 7 + 11 = 31 (prime) is a term.
Primes p=17, q=11, and r=13 give 17^2 + 1 = 11^2 + 13^2 = 290, so 17 + 11 + 13 = 41 (prime) is a term.
Primes p=23, q=13, and r=19 give 23^2 + 1 = 13^2 + 19^2 = 530, but 23 + 13 + 19 = 55 (composite), so 55 is not a term.
Primes p=31, q=11, and r=29 give 31^2 + 1 = 11^2 + 29^2 = 962, so 31 + 11 + 29 = 71 (prime) is a term.
MAPLE
A := {}: for i to 250 do for j to 250 do for k to 250 do x := ithprime(i): y := ithprime(j): z := ithprime(k): if `and`(isprime(x+y+z) = true, x^2+1 = y^2+z^2) then A := `union`(A, {x+y+z}) else end if end do end do end do: A; # Emeric Deutsch, Jun 21 2009
# Alternative: yields the pairs [x+y+z, [x, y, z]]
B := {}: for i to 20 do for j to 20 do for k to 20 do x := ithprime(i): y := ithprime(j): z := ithprime(k): if `and`(isprime(x+y+z) = true, x^2+1 = y^2+z^2) then B := `union`(B, {[x+y+z, [x, y, z]]}) else end if end do end do end do: B; # Emeric Deutsch, Jun 21 2009
PROG
(PARI) upto(lim)={my(L=List()); forprime(p=1, lim, forprime(r=1, p, my(q); if(issquare(p^2+1-r^2, &q) && isprime(q) && r <= q, my(s=p+q+r); if(isprime(s) && s<=lim, listput(L, s))))); Set(L)} \\ Andrew Howroyd, Nov 28 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladislav-Stepan Malakhovsky and Juri-Stepan Gerasimov, May 31 2009
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jun 21 2009
Edited by Jon E. Schoenfield, Feb 23 2019
STATUS
approved
