OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
4 is a term since its ternary and balanced ternary representation are both 11 which is a palindrome.
16 is a term since its ternary representation is 121 and its balanced ternary representation (with 2 standing for the -1 digit) is 1221, and both are palindromes.
MATHEMATICA
Select[Range[0, 10^4], PalindromeQ[IntegerDigits[#, 3]] && PalindromeQ @ balTernDigits[#] &] (* using balTernDigits by Robert G. Wilson v at A134027 *)
PROG
(PARI) is(n) = {my (t=digits(n, 3)); if (t==Vecrev(t), my (b=[], d); while (n, b=concat(d=[0, 1, -1][1+n%3], b); n=(n-d)/3); b==Vecrev(b), 0)} \\ Rémy Sigrist, Jun 10 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jun 10 2022
STATUS
approved