OFFSET
1,2
COMMENTS
The digit sum of these numbers equals the digit sum of their absolute difference with their reversal.
All terms have sum of digits divisible by 9 (see A056965). - Michael S. Branicky, Oct 21 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
18 is included because reverse(18) = 81, |18 - 81| = 63, and both have digit sum 9.
MATHEMATICA
Select[Range[0, 1300], DigitSum[#] == DigitSum[Abs[# - IntegerReverse[#]]] &] (* Amiram Eldar, Oct 21 2025 *)
PROG
(MATLAB)
seq = [];
for n = 0:2000
rev_n = str2num(fliplr(num2str(n)));
if sum(num2str(n)-'0') == sum(num2str(abs(n-rev_n))-'0')
seq = [seq, n];
end
end
seq
(Python)
def sd(s): return sum(map(int, s))
def ok(n): return sd(s:=str(n)) == sd(str(abs(n-int(s[::-1]))))
print([k for k in range(1252) if ok(k)]) # Michael S. Branicky, Oct 21 2025
(PARI) isok(k) = sumdigits(k) == sumdigits(abs(k-fromdigits(Vecrev(digits(k))))); \\ Michel Marcus, Oct 22 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Safwan Jaradat, Oct 21 2025
STATUS
approved
