OFFSET
1,3
COMMENTS
A006995 is a subsequence of this sequence, because a palindrome plus its reverse is equivalent to itself times 2, which in base 2 is equivalent to appending a zero to the number. This zero is eliminated by the second reversal, leaving the reverse of the original number, which, since it is a palindrome, is the equivalent of the number itself, and 2x - x = x.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
rev2:= proc(n) local L, i;
L:= convert(n, base, 2);
add(L[-i]*2^(i-1), i=1..nops(L))
end proc:
filter:= k -> abs(k + rev2(k) - rev2(k + rev2(k))) = k:
select(filter, [$0..1000]); # Robert Israel, Dec 24 2025
MATHEMATICA
rev[x_, b_] := FromDigits[Reverse[IntegerDigits[x, b]], b]; revadd[x_, b_] := rev[x, b] + x; revsub[x_, b_] := Abs[x - rev[x, b]]; s = {}; Do [If[revsub[revadd[ x, 2], 2] == x, AppendTo[s, x]], {x, START, FINISH}]; s
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Dylan Hamilton, Aug 15 2010
EXTENSIONS
Offset corrected by Robert Israel, Dec 24 2025
STATUS
approved
