OFFSET
1,3
COMMENTS
Since the largest of all prime factors of the numbers between prime p and the next prime is smaller than p, we have p > f(p) > f^2(p) > ... > 2, so a(n) is finite for all n.
EXAMPLE
prime(6) = 13, f(13) = 7, f(7) = 5, f(5) = 3, f(3) = 2, so f^4(13) = 2 and a(6) = 4.
PROG
(PARI) {forprime(k=2, 580, c=0; p=k; while(p>2, q=nextprime(p+1); m=0; for(j=p+1, q-1, f=factor(j); a=f[matsize(f)[1], 1]; if(m<a, m=a)); p=m; c++); print1(c, ", "))}
CROSSREFS
KEYWORD
nonn
AUTHOR
_Klaus Brockhaus_, Feb 10 2003
STATUS
approved