OFFSET
1,3
COMMENTS
A118177(n) is the number of divisors of a(n).
LINKS
Michel Marcus, Table of n, a(n) for n = 1..10000 (terms 1 to 100 from M. F. Hasler)
EXAMPLE
11 has 2 divisors. So a(11) = the number of terms among the first 10 terms of the sequence which do not have 2 divisors. Only the four terms a(1) = 1, a(2) = 1, a(9) = 8 and a(10) = 8 each do not have 2 divisors. So a(11) = 4.
MAPLE
a:=proc(n)option remember; if n=1 then 1 else nops( subs( numtheory[tau](n)=NULL, [ 'numtheory[tau](a(i))', $i=1..n-1 ] )) fi end; # M. F. Hasler, Nov 06 2006
MATHEMATICA
a[n_] := a[n] = If[n == 1, 1, Count[Array[a, n-1], t_ /; DivisorSigma[0, n] != DivisorSigma[0, t]]];
Array[a, 100] (* Jean-François Alcover, Oct 01 2020 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn), vd = vector(nn)); va[1] = 1; vd[1] = numdiv(1); for (n=2, nn, va[n] = sum(k=1, n-1, vd[k] != numdiv(n)); vd[n] = numdiv(va[n]); ); va; } \\ Michel Marcus, Oct 01 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 13 2006
EXTENSIONS
More terms from M. F. Hasler, Nov 06 2006
STATUS
approved