The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A348318 Number of n-digit Niven (or Harshad) numbers not containing the digit 0. 2
9, 14, 108, 710, 4978, 35724, 273032, 2097356, 16674554, 135091242, 1112325268, 9296413365, 77991481271, 654495034497, 5420117473932 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
This sequence comes from a problem, proposed by Argentina during the 39th International Mathematical Olympiad in 1998 at Taipei, Taiwan, but not used for the competition. This problem asked for a proof that, for each positive integer n, there exists an n-digit number, not containing the digit 0 and that is divisible by the sum of its digits (see links: Diophante in French and Scholes in English).
This sequence gives the number of such n-digit Niven numbers not containing the digit 0.
LINKS
EXAMPLE
a(2) = 14 because there are 14 integers {12, 18, 21, 24, 27, 36, 42, 45, 48, 54, 63, 72, 81, 84} in the set of Niven numbers with 2 digits and not containing the digit 0.
MATHEMATICA
q[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{c = 0, k = (10^n - 1)/9}, While[k < 10^n, If[q[k], c++]; k++]; c]; Array[a, 6] (* Amiram Eldar, Oct 17 2021 *)
PROG
(Python)
from itertools import product
def a(n): return sum(1 for p in product("123456789", repeat=n) if int("".join(p))%sum(map(int, p)) == 0)
print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Oct 17 2021
CROSSREFS
Sequence in context: A272009 A298754 A166654 * A370674 A131224 A073920
KEYWORD
nonn,base,more
AUTHOR
Bernard Schott, Oct 17 2021
EXTENSIONS
a(6)-a(10) from Amiram Eldar, Oct 17 2021
a(11)-a(15) from Martin Ehrenstein, Oct 22 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 17 19:53 EDT 2024. Contains 372607 sequences. (Running on oeis4.)