OFFSET
1,2
COMMENTS
First occurrence of k: 1, 2, 6, 20, 18, 12, 90, 24, 36, 96, 60, 72, 5670, 972, 120, 336, 180, 420, 540, 240, 600, 2352, 360, 480, 900, 3000, 840, 1080, 1260, 720, ..., . - Robert G. Wilson v
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
EXAMPLE
10 has 4 divisors (1,2,5,10). The number of divisors of each of these divisors of 10 form the sequence (1,2,2,4). Of these, three divide 10: 1,2,2. So a(10) = 3.
MAPLE
with(numtheory): a:=proc(n) local div, ct, j: div:=divisors(n): ct:=0: for j to tau(n) do if `mod`(n, tau(div[j]))=0 then ct:=ct+1 else end if end do: ct end proc: seq(a(n), n=1..80); # Emeric Deutsch, Mar 14 2008
MATHEMATICA
Table[Length[Select[Divisors[n], Mod[n, Length[Divisors[ # ]]] == 0 &]], {n, 1, 100}] (* Stefan Steinerberger *)
f[n_] := Count[Mod[n, DivisorSigma[0, Divisors@n]], 0]; Array[f, 104] (* Robert G. Wilson v *)
PROG
(PARI) A138012(n) = sumdiv(n, d, if(!(n%numdiv(d)), 1, 0)); \\ Antti Karttunen, May 25 2017
(Python)
from sympy import divisors, divisor_count
def a(n): return sum([1*(n%divisor_count(d)==0) for d in divisors(n)]) # Indranil Ghosh, May 25 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 27 2008
EXTENSIONS
More terms from Stefan Steinerberger and Robert G. Wilson v, Feb 29 2008
STATUS
approved