OFFSET
1,1
COMMENTS
Similar to A212875 but reading the sum backwards.
If numbers ending in 0 are allowed, 1200 has factors 2,2,2,2,3,5,5 which add up to 21. - Chai Wah Wu, Sep 12 2014
EXAMPLE
Prime factors of 1994 are 2 and 997;
2 + 997 = 999;
997 + 999 = 1996;
999 + 1996 = 2995;
1996 + 2995 = 4991 that is the reverse of 1994.
Prime factors of 25656 are 2^3, 3 and 1069;
2 + 2 + 2 + 3 + 1069 = 1078;
2 + 2 + 3 + 1069 + 1078 = 2154;
2 + 3 + 1069 + 1078 + 2154 = 4306;
3 + 1069 + 1078 + 2154 + 4306 = 8610;
1069 + 1078 + 2154 + 4306 + 8610 = 17217;
1078 + 2154 + 4306 + 8610 + 17217 = 33365;
2154 + 4306 + 8610 + 17217 + 33365 = 65652 that is the reverse of 25656.
MAPLE
with(numtheory): R:=proc(w) local x, y; x:=w; y:=0;
while x>0 do y:=10*y+(x mod 10); x:=trunc(x/10); od: y; end:
P:=proc(q, h) local a, b, c, d, j, k, n, t, v; v:=array(1..h);
for n from 2 to q do if not isprime(n) then a:=ifactors(n)[2];
b:=nops(a); c:=ilog10(n)+1; t:=0; d:=[];
for k from 1 to b do for j from 1 to a[k, 2] do d:=[op(d), a[k, 1]]; od;
od; d:=sort(d); for k from 1 to nops(d) do v[k]:=d[k]; od; a:=nops(d);
t:=a; t:=t+1; v[t]:=add(v[k], k=1..t-1); if R(v[t])=n then print(n);
else while ilog10(v[t])+1<=c do t:=t+1; v[t]:=add(v[k], k=t-a..t-1);
if R(v[t])=n then print(n); break; fi; od; fi; fi; od; end:
P(10^6, 1000);
MATHEMATICA
A247013 = {};
For[n = 4, n <= 1000000, n++,
If[Mod[n, 10] == 0 || PrimeQ[n], Continue[]];
r = IntegerReverse[n];
a = Flatten[Map[Table[#[[1]], {#[[2]]}] &, FactorInteger[n]]];
sum = Total[a];
While[sum < r, sum = Total[a = Join[Rest[a], {sum}]]];
If[sum == r, AppendTo[A247013, n]];
]; A247013 (* Robert Price, Sep 08 2019 *)
PROG
(Python)
from itertools import chain
from sympy import isprime, factorint
A247013_list = []
for n in range(2, 10**8):
....m = int(str(n)[::-1])
....if n % 10 and not isprime(n):
........x = sorted(chain.from_iterable([p]*e for p, e in factorint(n).items()))
........y = sum(x)
........while y < m:
............x, y = x[1:]+[y], 2*y-x[0]
........if y == m:
............A247013_list.append(n) # Chai Wah Wu, Sep 12 2014
CROSSREFS
KEYWORD
nonn,more,base
AUTHOR
Paolo P. Lava, Sep 09 2014
EXTENSIONS
More terms and definition edited by Chai Wah Wu, Sep 12 2014
STATUS
approved