OFFSET
2,1
COMMENTS
This sequence is connected with a sufficient condition for the infinitude of twin primes.
Almost all numbers of the form a(n)-3 are primes. For composite numbers of such a form, see A242716.
Primes p for which a(p) = p^2+1 form sequence A062326 for p >= 3. - Vladimir Shevelev, May 21 2014
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 2..2501
FORMULA
a(n) >= prime(n)^2+1. - Vladimir Shevelev, May 21 2014
EXAMPLE
Let n=2, prime(2)=3. Then lpf(10-1)=3, but lpf(10-3)=7>3.
Since k=10 is the smallest such k, then a(2)=10.
MATHEMATICA
lpf[n_]:=lpf[n]=First[Select[Divisors[n], PrimeQ[#]&]];
Table[test=Prime[n]; NestWhile[#+2&, test^2+1, !((lpf[#-1]==test)&&(lpf[#-3]>test))&], {n, 2, 60}] (* Peter J. C. Moses, May 21 2014 *)
PROG
(PARI) a(n) = {k = 6; p = prime(n); while ((factor(k-1)[1, 1] != p) || (factor(k-3)[1, 1] <= p), k+= 2); k; } \\ Michel Marcus, May 16 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, May 16 2014
EXTENSIONS
More terms from Michel Marcus, May 16 2014
STATUS
approved