OFFSET
1,1
COMMENTS
Trivial cases are those numbers which upon conversion result in a number which is palindromic (m = reverse(m)), or a palindrome plus trailing zeros such that m = reverse(m)*10^z where z=number of lost zeros. Nontrivial digit loss occurs when a converted number has trailing zeros that drop off when the number is reversed.
n/m must be either 2 or 4. - Robert Israel, Apr 22 2021
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
C. Seggelin, Numbers Divisible by Digit Permutations. [Broken link?]
EXAMPLE
a(1) = 16 because: 16 in base 5 is 31; 31 reversed is 13; 13 converted back to base 10 is 8 and 16 mod 8 = 0.
MAPLE
F:= proc(d) local eq, m, R;
R:= NULL;
for m in [2, 4] do
eq:= m*add(a[i]*5^i, i=0..d)-add(a[d-i]*5^i, i=0..d);
R:= R, F1(eq, [], d);
od;
sort([R]);
end proc:
F1:= proc(eq, A, d) local V, s, e1, i1, i2, vlo, R, v1, v2, Vp, Vm, emax, emin;
V:= indets(eq);
if nops(V) = 0 then
if eq = 0 then subs(A, add(a[d-i]*5^i, i=0..d))
else NULL
fi
elif nops(V) = 1 then
s:= solve(eq, V[1]);
if member(s, [$0..4]) then
subs([op(A), V[1]=s], add(a[d-i]*5^i, i=0..d));
fi
else
Vp, Vm:= selectremove(t -> coeff(eq, t)>0, V);
emax:= subs(map(`=`, Vp, 4), map(`=`, Vm, 0), eq);
if emax < 0 then return NULL fi;
emin:= subs(map(`=`, Vp, 0), map(`=`, Vm, 4), eq);
if emin > 0 then return NULL fi;
e1:= eq mod 5;
V:= indets(e1);
if nops(V) = 0 then procname(e1/5, A, d)
elif nops(V) = 1 then
s:= msolve(e1, 5);
procname(subs(s, eq)/5, [op(A), op(s)], d)
else
i1:= op(1, V[1]); i2:= op(1, V[2]);
if i1 = 0 or i2 = 0 then vlo:= 1 else vlo:= 0 fi;
R:= NULL;
for v1 from vlo to 4 do
s:= msolve(eval(e1, a[i1]=v1), 5);
R:= R, procname(subs(a[i1]=v1, op(s), eq)/5, [op(A), a[i1]=v1, op(s)], d)
od;
R
fi fi
end proc:
seq(op(F(d)), d=1..8); # Robert Israel, Apr 22 2021
PROG
(PARI) /* See A091077 and use PARI script with b=5 */
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Chuck Seggelin (barkeep(AT)plastereddragon.com), Dec 18 2003
EXTENSIONS
More terms from Michel Marcus, Oct 10 2014
STATUS
approved