Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #26 Jul 30 2022 12:45:10
%S 1,2,2,3,2,4,2,4,3,4,1,6,1,3,3,4,1,6,1,6,4,2,1,8,2,2,4,4,1,7,1,4,2,2,
%T 3,9,1,2,2,8,1,7,1,3,5,2,1,9,2,5,2,3,1,8,2,5,2,2,1,11,1,2,6,4,2,4,1,3,
%U 2,6,1,12,1,2,3,3,2,4,1,9,5,2,1,10,2,2
%N a(n) is the number of divisors of n that are Niven numbers.
%C If p is a prime number, p >= 11, then a(p) = 1.
%C Numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 36, 40, 54, 63, 72, 81, 108, 162, 216, 243, 324, 486, 648, 972, 1944, have all divisors Niven numbers. There are only finitely many numbers all of whose divisors are Niven numbers. (A337741).
%C A333456(n) is the least number k such that a(k) = n. - _Bernard Schott_, Jul 30 2022
%H Giovanni Resta, <a href="/A332268/b332268.txt">Table of n, a(n) for n = 1..10000</a>
%F a(A333456(n)) = n. - _Bernard Schott_, Jul 30 2022
%e For n = 4 the divisors are 1, 2, 4 and they are all Niven numbers, so a(4) = 3.
%e For n = 14 the divisors are 1, 2, 7 and 14. Only 1, 2 and 7 are Niven numbers, so a(14) = 3.
%t a[n_] := DivisorSum[n, 1 &, Divisible[#, Plus @@ IntegerDigits[#]] &]; Array[a, 100] (* _Amiram Eldar_, May 04 2020 *)
%o (Magma) [#[d:d in Divisors(k)|d mod &+Intseq(d) eq 0]:k in [1..100]];
%o (PARI) a(n) = sumdiv(n, d, !(d % sumdigits(d))); \\ _Michel Marcus_, May 04 2020
%Y Cf. A000005, A005349, A333456, A337741, A340637.
%K nonn,base
%O 1,2
%A _Marius A. Burtea_, May 04 2020