OFFSET
1,2
COMMENTS
Fixed points of the transform A284797.
A b-adic "antipalindrome" is a string of digits x where the application of the map d -> b-1-d to each digit, followed by reversal of all digits, is equal to x. This sequence lists the integers whose base-3 representation (with no leading zeros) has this property.
LINKS
Lubomira Dvorakova, Stanislav Kruml, and David Ryzak, Antipalindromic numbers, arXiv preprint arXiv:2008.06864 [math.CO], August 16 2020.
EXAMPLE
34 is a term of the sequence because 34 in base 3 is 1021, its digit-by-digit complement in base 3 is 1201 and the digit reverse is again 1021.
MAPLE
P:=proc(q, h) local a, b, k, n; for n from 1 to q do a:=convert(n, base, h); b:=0;
for k from 1 to nops(a) do a[k]:=h-1-a[k]; b:=h*b+a[k]; od; if b=n then print(n); fi; od; end: P(10^2, 8);
PROG
(Python)
from itertools import count, islice
from gmpy2 import digits
def A284798_gen(): return (n for n in count(0) if not n+int((s:=digits(n, 3)[::-1]), 3)+1-3**len(s))
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Apr 03 2017
EXTENSIONS
New name from Jeffrey Shallit, Nov 04 2023
STATUS
approved