OFFSET
0,5
COMMENTS
Upon the observation that 5^2 + 4! = 7^2 and 7^2 + 5! = 13^2, it is natural to ask whether for all n >= 4, there are primes p, q such that p^2 + n! = q^2.
This sequence gives the indices (or "primepi" values) of the primes q.
At present, it appears to be much easier to compute the primes q = A394632(n) than a(n) = primepi(q) for primes as huge as prime(a(30) ~ 10^15) and beyond.
EXAMPLE
For n < 4 there are no primes p, q such that p^2 + n! = q^2, since 3^2 - 2^2 = 5 and 5^2 - 3^2 = 16 is already too large.
For n = 4 we have 5^2 + 4! = 7^2 and 7 is the 4th prime, so a(4) = 4.
For n = 5 we have 7^2 + 5! = 13^2 and 11 is the 6th prime, so a(5) = 6.
For n = 6 we have 11^2 + 6! = 29^2 and 29 is the 10th prime, so a(6) = 10.
See A394631 for more.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Apr 04 2026
EXTENSIONS
More terms from Daniel Suteu, Apr 07 2026
STATUS
approved
