A261680
Number of ordered quadruples (u,v,w,x) of binary palindromes (see A006995) with u+v+w+x=n.
Original entry on oeis.org
1, 4, 6, 8, 13, 16, 22, 28, 34, 44, 50, 60, 59, 72, 70, 80, 92, 88, 114, 96, 125, 104, 152, 120, 172, 144, 188, 152, 215, 144, 242, 160, 272, 172, 302, 180, 329, 216, 352, 240, 388, 228, 430, 228, 442, 212, 476, 192, 506, 228, 496, 248, 540, 252, 582, 276, 592
Offset: 0
A264964
Numbers that are the sum of two binary palindromes of the same (binary) length.
Original entry on oeis.org
0, 2, 6, 10, 12, 14, 18, 24, 30, 34, 38, 42, 44, 48, 52, 54, 58, 62, 66, 78, 84, 90, 96, 102, 108, 114, 126, 130, 138, 146, 150, 158, 164, 166, 170, 172, 178, 180, 184, 186, 192, 198, 200, 204, 206, 212, 214, 218, 220, 226, 234, 238, 246, 254, 258, 282, 294, 306, 318, 324, 330, 342, 348, 354, 360, 372, 378, 384, 390, 396
Offset: 1
There are four binary palindromes of length 5, namely (written in base 10) 17, 21, 27, 31, and adding them in pairs gives nine distinct numbers: 34, 38, 42, 44, 48, 52, 54, 58, 62.
There are eight binary palindromes of length 7, namely (written in base 10) 65, 73, 85, 93, 99, 107, 119, 127, and adding them in pairs gives 27 distinct numbers: 130, 138, 146, 150, 158, 164, 166, 170, 172, 178, 180, 184, 186, 192, 198, 200, 204, 206, 212, 214, 218, 220, 226, 234, 238, 246, 254.
-
f[n_] := Select[Map[FromDigits /@ IntegerDigits[#, 2] &, Map[Function[k, {k, # - k}], Range@ Floor[#/2]] &@ n], AllTrue[#, Reverse@ # == # &@ IntegerDigits@ # &] && IntegerLength@ First@ # == IntegerLength@ Last@ # &]; Prepend[Select[Range@ 400, Length@ f@ # > 0 &], 0] (* Michael De Vlieger, Nov 29 2015, Mma version 10 *)
Join[{0},Table[Total/@Tuples[FromDigits[#,2]&/@Select[Tuples[{1,0},n], #[[1]] != 0&==Reverse[#]&],2]//Union,{n,8}]//Flatten] (* Harvey P. Dale, Apr 12 2017 *)
Showing 1-2 of 2 results.
Comments