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!)
A348150 a(n) is the smallest Niven (or Harshad) number with exactly n digits and not containing the digit 0. 5
1, 12, 111, 1116, 11112, 111114, 1111112, 11111112, 111111111, 1111111125, 11111111112, 111111111126, 1111111111116, 11111111111114, 111111111111114, 1111111111111122, 11111111111111112, 111111111111111132, 1111111111111111119, 11111111111111111121, 111111111111111111117 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This sequence is inspired by a problem, proposed by Argentina during the 39th International Mathematical Olympiad in 1998 at Taipei, Taiwan, but not used for the competition.
The problem asked for a proof that, for each positive integer n, there exists a n-digit number, not containing the digit 0 and that is divisible by the sum of its digits (see links: Diophante in French and Kalva in English).
This sequence lists the smallest such n-digit integer.
LINKS
FORMULA
a(n) = A002275(n) = R_n iff n is in A014950.
EXAMPLE
111114 has 6 digits, does not contain 0 and is divisible by 1+1+1+1+1+4 = 9 (111114 = 9*12346), while 111111, 111112, 111113 are not respectively divisible by sum of their digits: 6, 7, 8; hence, a(6) = 111114.
MATHEMATICA
hQ[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{k = (10^n - 1)/9}, While[! hQ[k], k++]; k]; Array[a, 30] (* Amiram Eldar, Oct 03 2021 *)
PROG
(PARI) a(n) = for(k=(10^n-1)/9, 10^n-1, if (vecmin(digits(k)) && !(k % sumdigits(k)), return (k))); \\ Michel Marcus, Oct 03 2021
(Python)
def niven(n):
s = str(n)
return '0' not in s and n%sum(map(int, s)) == 0
def a(n):
k = int("1"*n)
while not niven(k): k += 1
return k
print([a(n) for n in range(1, 22)]) # Michael S. Branicky, Oct 09 2021
CROSSREFS
Sequence in context: A253091 A123933 A199691 * A077754 A199357 A293872
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 03 2021
EXTENSIONS
More terms from Amiram Eldar, Oct 03 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 April 24 15:49 EDT 2024. Contains 371961 sequences. (Running on oeis4.)