OFFSET
1,1
LINKS
Lars Blomberg, Table of n, a(n) for n = 1..663
EXAMPLE
14’ = 9 : 1 + 4 = 5; 4 + 5 = 9.
51’ = 20 : 5 + 1 = 6; 1 + 6 = 7; 6 + 7 = 13; 7 + 13 = 20.
MAPLE
with(numtheory): P:=proc(q, h) local a, b, c, k, n, p, t, v; v:=array(1..h);
for n from 1 to q do a:=n; b:=ilog10(a)+1; if b>1 then
for k from 1 to b do v[b-k+1]:=(a mod 10); a:=trunc(a/10); od; t:=b+1; v[t]:=add(v[k], k=1..b); c:=n*add(op(2, p)/op(1, p), p=ifactors(n)[2]);
while v[t]<c do t:=t+1; v[t]:=add(v[k], k=t-b..t-1); od;
if v[t]=c then print(n); fi; fi; od; end: P(10^9, 1000);
MATHEMATICA
dn[n_] := If[Abs@n < 2, 0, n Total[#2/#1 & @@@ FactorInteger[Abs@n]]]; (* after Michael Somos, Apr 12 2011 *)
Select[Range[10^5], # >= 10 && (s = dn[#]; d = IntegerDigits[#]; While[Total[d] < s, d = Join[Rest[d], {Total[d]}]]; Total[d] == s) &] (* Robert Price, May 22 2019 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Feb 24 2016
STATUS
approved