OFFSET
1,1
COMMENTS
Note that p - q must be <= 12. Also note that there can be corresponding prime pairs (q, p) more than one way, i.e., (7, 13), (13, 17), (29, 31): (13^2 - 7^2)/24 = (17^2 - 13^2)/24 = (31^2 - 29^2)/24 = 5.
There are no terms of A045468 > 11.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
For n > 5, a(n) == {3,7} mod 10.
EXAMPLE
3 is a term since (11^2 - 7^2)/24 = 3 and 3, 7, 11 are prime numbers.
MAPLE
select(r -> isprime(r) and ((isprime(3*r+2) and isprime(3*r-2))
or (isprime(6*r+1) and isprime(6*r-1))
or (isprime(2*r+3) and isprime(2*r-3))
or (isprime(r+6) and isprime(r-6))), [2, seq(i, i=3..1000, 2)]); # Robert Israel, Mar 13 2017
MATHEMATICA
ok[n_] := PrimeQ[n] && Block[{p, q, s = Reduce[p^2-q^2 == 24 n && p>3 && q>3, {p, q}, Integers]}, If[s === {}, False, Or @@ And @@@ PrimeQ[{p, q} /. List@ ToRules@s]]]; Select[Range@1000, ok] (* Giovanni Resta, Mar 11 2017 *)
PROG
(PARI) isA124865(n) = if(n%24, isprimepower(n+4)==2 || isprimepower(n+9)==2, fordiv(n/4, d, if(isprime(n/d/4+d) && isprime(n/d/4-d), return(1))); 0)
lista(nn) = forprime(p=2, nn, if(isA124865(24*p), print1(p", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan and Thomas Ordowski, Mar 11 2017
STATUS
approved