OFFSET
1,2
COMMENTS
a(12) = gcd(12, A002808(12)) = gcd(12, 21) = gcd(2*2*3, 3*7) = 3.
LINKS
R. Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = gcd(n, A002808(n)).
MATHEMATICA
Composite[n_Integer] := FixedPoint[n + PrimePi[#] + 1 &, n + PrimePi[n] + 1]; Table[GCD[n, Composite[n]], {n, 100}] (* T. D. Noe, Feb 22 2012 *)
Module[{nn=150, comps}, comps=Complement[Range[2, nn], Prime[Range[ PrimePi[ nn]]]]; GCD@@@Thread[{comps, Range[Length[comps]]}]] (* Harvey P. Dale, Apr 23 2014 *)
PROG
(PARI) nextComp(n)= { if (!isprime(n), return(n)); return(n + 1) } { c=3; for (n=1, 1000, c=nextComp(c + 1); write("b064814.txt", n, " ", gcd(n, c)) ) } \\ Harry J. Smith, Sep 27 2009
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
Reinhard Zumkeller, Oct 22 2001
STATUS
approved