OFFSET
1,2
COMMENTS
The repunit A002275(k), for k >= 2, appears at position A254622(k-1) + 1. - Wolfdieter Lang, Feb 23 2015
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
MAPLE
extend:= proc(t, b, d)
local i, j, m, s, p;
p:= t[2];
s:= t[3];
if s = 0 then if b=2 then j:= 3 else j:= 2 fi
else for j from 0 to d-nops(t[1]) while p*b^j <= s + j*b do od
fi:
seq([[op(t[1]), b$i], p*b^i, s+i*b], i=0..j-1);
end proc:
f:= proc(d)
local j, b, Res;
Res:= [seq([[1$j], 1, j], j=0..d)];
for b from 2 to 9 do
Res:= map(extend, Res, b, d)
od:
Res:= map(t -> op(combinat:-permute(t[1])), Res);
subs(0=NULL, sort(map(t -> add(t[i]*10^(i-1), i=1..nops(t)), Res)));
end proc:
f(5); # Robert Israel, May 19 2015
MATHEMATICA
m[w_] := Flatten@Table[i, {i, 9}, {w[[i]]}]; a[upd_] := Union@ Flatten@ Table[ FromDigits /@ Flatten[Permutations /@ m /@ Select[ Flatten[ Permutations /@ (IntegerPartitions[d + 9, {9}, Range[d + 1]] - 1), 1], Times @@ (Range[9]^#) <= Total[# Range[9]] &], 1], {d, upd}]; a[12] (* terms with up to 12 digits, Giovanni Resta, May 19 2015 *)
zfnQ[n_]:=Module[{idn=IntegerDigits[n]}, FreeQ[idn, 0]&&Times@@idn <= Total[ idn]]; Select[Range[500], zfnQ] (* Harvey P. Dale, Jun 29 2019 *)
PROG
(PARI) is(n)={my(d=digits(n)); my(p=prod(i=1, #d, d[i])); 0 < p && p<=vecsum(d) } \\ David A. Corneth, May 15 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David A. Corneth, Feb 03 2015
STATUS
approved