OFFSET
1,12
COMMENTS
Suppose a = a(n)+prime(n), b = |a(n)-prime(n)|, when a(n) > prime(n), prime(n) = (a - b)/2, and gcd(a,b) = 2 since a(n) and prime(n) are coprime. When a*b = |a(n)^2-prime(n)^2|, (a - b)/2 is a primality proof of prime(n) since the prime factors of a and b contains all prime numbers less than sqrt(prime(n)) and gcd(a,b) = 2. - corrected by Eric M. Schmidt, Feb 02 2013
When a(n) is prime, a(n)=A210529(n); when a(n) is composite, a(n) does not have any prime factors less than sqrt(prime(n)).
If the primes less than sqrt(prime(n)) are p_1, ..., p_r, then k = |prime(n) - p_1*...*p_r| is coprime to prime(n), and k^2 - prime(n)^2 is divisible by all of p_1, ..., p_r. So the sequence is defined for all positive integers n. - Eric M. Schmidt, Feb 02 2013
LINKS
Lei Zhou, Table of n, a(n) for n = 1..219
A. Granville, T. Agoh, and P. Erdős, Primes at a (somewhat lengthy) glance, American Mathematical Monthly, 104(10):943-945, December 1997.
R. K. Guy, C. B. Lacampagne and J. L. Selfridge, Primes at a glance, Math. Comp. 48 (1987), 183-202.
MATHEMATICA
Table[p = Prime[n]; t = Product[Prime[k], {k, 1, PrimePi[NextPrime[Floor[Sqrt[p]] + 1, -1]]}]; p1 = 1; While[r = Abs[p^2 - p1^2]; (r == 0) || (Mod[r, t] != 0), p1++]; p1, {n, 1, 60}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Jan 29 2013
STATUS
approved