OFFSET
1,1
COMMENTS
Embedded in this sequence are subsets based on the definition, for example {97,137}, and {3049,3881,5441,7481}. These arise when terms are both the length of the hypotenuse of one primitive Pythagorean triple and the sum of the two shorter legs of another.
EXAMPLE
13 is a term because 13^2 = 12^2 + 5^2 and 12 + 5 = 17 and 17^2 = 15^2 + 8^3 and 15 + 8 = 23.
PROG
(PARI) is(n) = {if((n%4 != 1) || !isprime(n), return(0)); my(v=thue(T, n^2), q); for(i=1, #v, if(v[i][1]>0 && v[i][2]>=v[i][1] && (q=vecsum(v[i])) && isprime(q), return(q)); ); 0; }
isok(p) = isprime(p) && (q=is(p)) && is(q);
lista(nn) = T=thueinit('x^2+1, 1); forprime(p=2, nn, if (isok(p), print1(p, ", "))); \\ Michel Marcus, May 01 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Torlach Rush, Apr 26 2019
STATUS
approved