OFFSET
1,2
COMMENTS
For odd n, n^2 is odd so the two primes must be opposite in parity. Lesser prime must be 2 and greater prime must be n^2+2. Thus for odd n, n^2 is the difference of two primes iff n^2+2 is prime.
An odd difference can be obtained only by subtracting 2 from some prime > 2, hence a(n) = 0 if n is odd and n^2+2 is composite.
FORMULA
n^2 - A106546 gives perfect squares which are not the difference of two primes (otherwise 0).
EXAMPLE
a(6) = 6^2 = 36 = 41-5 (two primes).
a(5) = 0 and a(7) = 0 because 5^2+2 =27 = 3*3*3 and 7^2+2 =51 = 3*17 are composite.
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alexandre Wajnberg, May 08 2005
EXTENSIONS
Edited and extended by Klaus Brockhaus and Ray Chandler, May 12 2005
STATUS
approved