OFFSET
1,4
COMMENTS
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
EXAMPLE
The divisors of 5 are [1, 5], and the divisors of 1 to 4 are [1], [1, 2], [1, 3], [1, 2, 4]. Among these, only the divisors of 1 begin like those of 5. Hence a(5) = 1.
The divisors of 6 are [1, 2, 3, 6], and the divisors of 1 to 5 are [1], [1, 2], [1, 3], [1, 2, 4], [1, 5]. Among these, only the divisors of 1 and 2 begin like those of 6. Hence a(6) = 2.
MATHEMATICA
a[n_] := Length@ Select[Union@ FoldList[LCM, 1, Most@(d = Divisors@n)], # < n && (e = Divisors@#; e == Take[d, Length@e]) &]; Array[a, 87] (* Giovanni Resta, Jan 16 2014 *)
PROG
(PARI) a(n) = {d = divisors(n); nb = 0; for (i = 1, n-1, di = divisors(i); if ((#di <= #d) && (sum(k=1, #di, di[k] == d[k]) == #di), nb++); ); nb; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jan 16 2014
STATUS
approved