OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
2 is prime; 2 * 2 = 4. 4 is composite; 4 - lpf(4) + 1 = 4 - 2 + 1 = 3. 3 is prime; 3 * 2 = 6. 6 is composite; 6 - lpf(6) + 1 = 6 - 2 + 1 = 5.
MATHEMATICA
Join[{s=2}, Table[If[PrimeQ[s], s=2s, s=s-FactorInteger[s][[1, 1]]+1]; s, {43}]]
NestList[If[PrimeQ[#], 2#, #-FactorInteger[#][[1, 1]]+1]&, 2, 50] (* Harvey P. Dale, May 02 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Grant Garcia, Jan 21 2011
STATUS
approved