OFFSET
1,3
COMMENTS
This sequence is infinite since 2^k+1 is a term for all k>1.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..100
EXAMPLE
5 is a term since 5 = 101_2 is a binary palindromic number and A000217(5) = 5*(5+1)/2 = 15 = 1111_2 is a triangular number and also a binary palindromic number.
MATHEMATICA
Select[Range[0, 10^6], And @@ PalindromeQ /@ IntegerDigits[{#, #*(# + 1)/2}, 2] &]
PROG
(PARI) isok(k) = my(bt=binary(k*(k+1)/2), bk=binary(k)); (bt == Vecrev(bt)) && (bk==Vecrev(bk)); \\ Michel Marcus, Jan 28 2022
(Python)
from itertools import count, islice
def ispal(s): return s == s[::-1]
def ok(n): return ispal(bin(n)[2:]) and ispal(bin(n*(n+1)//2)[2:])
print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jan 28 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jan 28 2022
STATUS
approved