cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A348318 Number of n-digit Niven (or Harshad) numbers not containing the digit 0.

This page as a plain text file.
%I A348318 #31 Oct 22 2021 07:53:17
%S A348318 9,14,108,710,4978,35724,273032,2097356,16674554,135091242,1112325268,
%T A348318 9296413365,77991481271,654495034497,5420117473932
%N A348318 Number of n-digit Niven (or Harshad) numbers not containing the digit 0.
%C A348318 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).
%C A348318 This sequence gives the number of such n-digit Niven numbers not containing the digit 0.
%H A348318 Diophante, <a href="http://www.diophante.fr/problemes-par-themes/arithmetique-et-algebre/a1-pot-pourri/3455-a1960-bon-souvenir-de-buenos-aires">Bon souvenir de Buenos-Aires</a>.
%H A348318 John Scholes, <a href="https://prase.cz/kalva/short/sh98.html">39th IMO 1998 shortlisted problems, problem N7</a>.
%H A348318 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>.
%e A348318 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.
%t A348318 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 *)
%o A348318 (Python)
%o A348318 from itertools import product
%o A348318 def a(n): return sum(1 for p in product("123456789", repeat=n) if int("".join(p))%sum(map(int, p)) == 0)
%o A348318 print([a(n) for n in range(1, 8)]) # _Michael S. Branicky_, Oct 17 2021
%Y A348318 Cf. A005349, A009994, A140866, A217973, A348150, A348316, A348317.
%K A348318 nonn,base,more
%O A348318 1,1
%A A348318 _Bernard Schott_, Oct 17 2021
%E A348318 a(6)-a(10) from _Amiram Eldar_, Oct 17 2021
%E A348318 a(11)-a(15) from _Martin Ehrenstein_, Oct 22 2021