OFFSET
1,3
COMMENTS
When n is prime, a(n) is the prime index (A000720).
LINKS
Samuel Harkness, Table of n, a(n) for n = 1..10000
Samuel Harkness, Log-log Scatterplot of the first 3000000 terms
Samuel Harkness, Scatterplot of the first 3000000 terms
EXAMPLE
For n = 6 the set of all divisors of 6 greater than 1 is {2, 3, 6}. Also, the set of all a(n < 6) is {0, 1, 2, 3}. The greatest divisor of 6 (excluding 1) that has been listed is 3, so a(6) = 3.
MATHEMATICA
a = 0; A = {a}; Do[s = Drop[Reverse[Divisors[n]], 1]; s = Drop[s, -1]; If[Length[s] >= 1, Do[If[MemberQ[A, Part[s, d]], AppendTo[A, Part[s, d]]; Break[]], {d, 1, Length[s]}], a++; AppendTo[A, a]], {n, 2, 77}] Print[A]
PROG
(PARI) first(n)=my(v=vector(n), m); forfactored(k=2, n, v[k[1]]=if(vecsum(k[2][, 2])==1, m++, my(t); fordiv(k, d, if(d<=m, t=d)); t)); v \\ Charles R Greathouse IV, Oct 14 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Samuel Harkness, Oct 14 2022
STATUS
approved