OFFSET

1,3

FORMULA

a(p) = p - 1 for p prime. - Petros Hadjicostas, May 11 2020

EXAMPLE

3 is the largest prime dividing 12. Among the first 11 terms of the sequence there are 8 terms (1, 1, 2, 2, 4, 5, 8, 10) that are not divisible by 3. So a(12) = 8.

MATHEMATICA

f[s_] := Append[s, Length@ Select[s, Mod[ #, FactorInteger[1 + Length@s] [[ -1, 1]]] != 0 &]]; Nest[f, {1}, 76] (* Robert G. Wilson v *)

PROG

(PARI) {m=75; print1(a=1, ", "); v=[a]; for(n=2, m, f=factor(n); p=f[matsize(f)[1], 1]; a=0; for(j=1, n-1, if(v[j]%p>0, a++)); print1(a, ", "); v=concat(v, a))} \\ Klaus Brockhaus, Aug 15 2006

CROSSREFS

KEYWORD

nonn

AUTHOR

Leroy Quet, Aug 09 2006

EXTENSIONS

More terms from Klaus Brockhaus and Robert G. Wilson v, Aug 15 2006

STATUS

approved