%I #16 Jan 18 2024 09:58:26
%S 0,1,2,5,6,9,17,21,25,33,42,65,90,129,170,257,341,357,450,513,693,893,
%T 1025,1365,1397,1445,1617,1670,1750,2049,2730,4097,5418,5985,8193,
%U 10397,10922,16385,17313,21717,21845,31749,32769,40637,43605,51537,63482,65537,76217
%N Numbers k such that the k-th triangular number is a binary palindrome.
%C This sequence is infinite since 2^k+1 is a term for all k>1 (Trigg, 1974).
%H Amiram Eldar, <a href="/A350988/b350988.txt">Table of n, a(n) for n = 1..128</a>
%H Charles W. Trigg, <a href="https://www.fq.math.ca/Scanned/12-2/trigg.pdf">Infinite sequences of palindromic triangular numbers</a>, The Fibonacci Quarterly, Vol. 12, No. 2 (1974), pp. 209-212.
%H Maciej Ulas, <a href="https://arxiv.org/abs/0811.2477">On certain diophantine equations related to triangular and tetrahedral numbers</a>, arXiv:0811.2477 [math.NT], 2008.
%F A000217(a(n)) = A350987(n).
%e 2 is a term since A000217(2) = 2*(2+1)/2 = 3 = 11_2 is a triangular number and also a binary palindromic number.
%e 5 is a term since A000217(5) = 5*(5+1)/2 = 15 = 1111_2 is a triangular number and also a binary palindromic number.
%t Select[Range[0, 10^5], PalindromeQ[IntegerDigits[#*(# + 1)/2, 2]] &]
%o (PARI) isok(k) = my(b=binary(k*(k+1)/2)); b == Vecrev(b); \\ _Michel Marcus_, Jan 28 2022
%o (Python)
%o def ok(n): b = bin(n*(n+1)//2)[2:]; return b == b[::-1]
%o print([k for k in range(80000) if ok(k)]) # _Michael S. Branicky_, Jan 28 2022
%Y The binary version of A008509.
%Y A000051 \ {3} is a subsequence.
%Y Cf. A000217, A003098, A006995, A350987.
%K nonn,base
%O 1,3
%A _Amiram Eldar_, Jan 28 2022