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!)
A132378 Smallest integer that starts with n and is divisible by every nonzero digit of n. 1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 132, 140, 15, 162, 175, 184, 198, 20, 210, 22, 234, 24, 250, 264, 2702, 280, 2916, 30, 312, 324, 33, 348, 3510, 36, 378, 384, 396, 40, 412, 420, 432, 44, 4500, 468, 476, 48, 4932, 50, 510, 520, 5310, 540, 55, 5610, 5705, 5800, 5940 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Note that a number that starts with n and is divisible by lcm(1, 2, ..., 9) = 2520 always satisfies the conditions. And there is such a number between n0000 and n2519. Therefore a(n) < 10000n + 2520. Hence to find a(n) one needs to check numbers n, n0..n9, n00..n99, n000..n999, n0000..n2519.
LINKS
TopCoder problem DivisibleByDigits
MAPLE
f:= proc(n) local r, d, q ;
r:= ilcm(op(convert(convert(n, base, 10), set) minus {0, 1}));
if n mod r = 0 then return n fi;
for d from 1 do
q:= -(n*10^d) mod r;
if q < 10^d then return n*10^d+q fi;
od
end proc:
map(f, [$1..100]); # Robert Israel, Feb 01 2017
PROG
lcm = lcm(all nonzero digits of n) for (p10 = 1;; p10 *= 10) { for (suffix = 0; suffix < p10; suffix++) { m = n * p10 + suffix; if (m % lcm == 0) return m; } }
CROSSREFS
Sequence in context: A004863 A055648 A004874 * A043317 A044914 A004885
KEYWORD
base,easy,nonn
AUTHOR
Mikhail Dvorkin (mikhail.dvorkin(AT)gmail.com), Nov 10 2007
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 28 19:24 EDT 2024. Contains 372919 sequences. (Running on oeis4.)