login
A078283
a(1) = 1, a(n) is the smallest multiple of n which is obtained by inserting/prefixing or suffixing at least one digit in a(n-1).
6
1, 10, 102, 1012, 10120, 101202, 1012025, 10120256, 101120256, 1011202560, 10112002560, 100112002560, 1001120025360, 10010120025360, 100010120025360, 1000010120025360, 10000101020025360, 100001010200253606
OFFSET
1,2
LINKS
MAPLE
f:= proc(m, n)
local L, nL, d, r, K, Kp, tmin, t, V, Vt, x;
L:= convert(m, base, 10);
nL:= nops(L);
L:= Vector(L);
for d from 1 do
r:= infinity;
V:= Vector(nL+d);
for K in combinat:-choose(nL+d, nL) do
V[K]:= L;
Kp:= sort(convert({$1..nL+d} minus convert(K, set), list));
if Kp[-1] = nL+d then tmin:= 10^(d-1) else tmin:= 0 fi;
for t from tmin to 10^d-1 do
Vt:= convert(10^d+t, base, 10);
V[Kp]:= Vector(Vt[1..-2]);
x:= add(10^(i-1)*V[i], i=1..nL+d);
if x > r then break fi;
if x mod n = 0 then r:= x; break fi;
od;
od;
if r < infinity then return r fi
od;
end proc:
A[1]:= 1:
for n from 2 to 30 do A[n]:= f(A[n-1], n) od:
seq(A[i], i=1..30); # Robert Israel, Jul 21 2020
CROSSREFS
Sequence in context: A220491 A088644 A080502 * A045874 A214437 A078282
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 25 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 04 2003
STATUS
approved