A342036 Palindromes of even length only using 0 or 1.
0, 11, 1001, 1111, 100001, 101101, 110011, 111111, 10000001, 10011001, 10100101, 10111101, 11000011, 11011011, 11100111, 11111111, 1000000001, 1000110001, 1001001001, 1001111001, 1010000101, 1010110101, 1011001101, 1011111101, 1100000011, 1100110011
Offset: 0
Examples
A006995|A057148|A048701|A342036|A048700|A342040 -------+-------+-------+-------+-------+------- 0 | 0 | 0 | 0 | | 1 | 1 | | | 1 | 1 3 | 11 | 3 | 11 | | 5 | 101 | | | 5 | 101 7 | 111 | | | 7 | 111 9 | 1001 | 9 | 1001 | | 15 | 1111 | 15 | 1111 | | 17 | 10001 | | | 17 | 10001
Programs
-
Mathematica
Array[FromDigits@ Join[#, Reverse[#]] &@ IntegerDigits[#, 2] &, 26, 0] (* Michael De Vlieger, Feb 26 2021 *)
-
Python
def a(n): b = bin(n)[2:]; return int(b+b[::-1]) print([a(n) for n in range(27)]) # Michael S. Branicky, Feb 26 2021
-
Ruby
def A(n) str = n.to_s(2) (str + str.reverse).to_i end def A342036(n) (0..n).map{|i| A(i)} end p A342036(30)
Formula
Extensions
Offset changed to 0 by Andrey Zabolotskiy, Dec 26 2022
Comments