login
A289052
a(1) = 1; a(n) = a(n-A006530(n-1)) + 1 for n > 1.
1
1, 2, 2, 2, 3, 2, 3, 2, 4, 4, 3, 2, 5, 2, 3, 4, 4, 2, 5, 2, 5, 4, 3, 2, 5, 6, 3, 6, 5, 2, 7, 2, 8, 4, 3, 6, 5, 2, 3, 4, 7, 2, 7, 2, 5, 8, 3, 2, 9, 8, 9, 4, 5, 2, 5, 6, 9, 4, 3, 2, 7, 2, 3, 10, 4, 6, 7, 2, 5, 4, 11, 2, 5, 2, 3, 12, 5, 8, 7, 2, 13, 8, 3, 2, 9, 6, 3, 4, 9, 2, 7, 8, 5, 4, 3, 6, 5
OFFSET
1,2
LINKS
MATHEMATICA
a[1] = 1; a[n_] := a[n] = 1 + a[n - FactorInteger[n - 1][[-1, 1]]]; Array[a, 97] (* Michael De Vlieger, Jun 26 2017 *)
PROG
(PARI) a006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1);
q=vector(100000); q[1]=1; for(n=2, #q, q[n]=q[n-a006530(n-1)]+1); q
(Python)
from sympy import primefactors
l=[0, 1, 2]
for n in range(3, 201): l.append(l[n - primefactors(n - 1)[-1]] + 1)
print(l[1:]) # Indranil Ghosh, Jun 23 2017
CROSSREFS
Sequence in context: A108053 A076221 A029235 * A329046 A281856 A106696
KEYWORD
nonn
AUTHOR
Altug Alkan, Jun 23 2017
STATUS
approved