This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A350989 #12 Feb 03 2022 04:54:34 %S A350989 0,1,5,9,17,21,33,65,129,257,341,513,693,1025,1365,1397,2049,4097, %T A350989 8193,16385,21845,32769,43605,65537,87125,87381,131073,262145,524289, %U A350989 1048577,1398101,2097153,2796885,4194305,5592405,5594453,8388609,16777217,33554433,67108865 %N A350989 Numbers k such that both k and the k-th triangular number are binary palindromes. %C A350989 This sequence is infinite since 2^k+1 is a term for all k>1. %H A350989 Amiram Eldar, <a href="/A350989/b350989.txt">Table of n, a(n) for n = 1..100</a> %e A350989 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. %t A350989 Select[Range[0, 10^6], And @@ PalindromeQ /@ IntegerDigits[{#, #*(# + 1)/2}, 2] &] %o A350989 (PARI) isok(k) = my(bt=binary(k*(k+1)/2), bk=binary(k)); (bt == Vecrev(bt)) && (bk==Vecrev(bk)); \\ _Michel Marcus_, Jan 28 2022 %o A350989 (Python) %o A350989 from itertools import count, islice %o A350989 def ispal(s): return s == s[::-1] %o A350989 def ok(n): return ispal(bin(n)[2:]) and ispal(bin(n*(n+1)//2)[2:]) %o A350989 print([k for k in range(10**6) if ok(k)]) # _Michael S. Branicky_, Jan 28 2022 %Y A350989 The binary version of A008510. %Y A350989 Intersection of A006995 and A350988. %Y A350989 A000051 \ {3} is a subsequence. %Y A350989 Cf. A229236, A350987. %K A350989 nonn,base %O A350989 1,3 %A A350989 _Amiram Eldar_, Jan 28 2022