OFFSET
1,1
COMMENTS
Includes 25*10^k+52, 33*10^k+33, 42*10^k+24 and 61*10^k+16 for k >= 2. - Robert Israel, Jul 12 2019
LINKS
EXAMPLE
2552 = k + reverse(k) for k = 1051, 1141, 1231, 1321, 1411, 1501, 2050, 2140, 2230, 2320, 2410, 2500.
MAPLE
N:= 10^5:
revdigs:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
V:= Vector(N):
for x from 1 to N do
v:= x + revdigs(x);
if v <= N then V[v]:= V[v]+1 fi;
od:
select(t -> V[t]=12, [$1..N]); # Robert Israel, Jul 12 2019
MATHEMATICA
Module[{nn=40000}, Select[Tally[Table[n+IntegerReverse[n], {n, nn}]], #[[2]] == 12&&#[[1]]<nn&]][[All, 1]]//Sort(* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 25 2020 *)
PROG
(ARIBAS) var n, k, c, i, rev: integer; st, nst: string; end; m := 12; for n := 0 to 34200 do k := n div 2; c := 0; while k <= n and c < m + 1 do st := itoa(k); nst := ""; for i := 0 to length(st) - 1 do nst := concat(st[i], nst); end; rev := atoi(nst); if n = k + rev then inc(c); if k mod 10 <> 0 and k <> rev then inc(c); end; end; inc(k); end; if c = m then write(n, ", "); end; end;
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Klaus Brockhaus, Jun 17 2002
STATUS
approved