|
|
A048701
|
|
List of binary palindromes of even length (written in base 10).
|
|
15
|
|
|
0, 3, 9, 15, 33, 45, 51, 63, 129, 153, 165, 189, 195, 219, 231, 255, 513, 561, 585, 633, 645, 693, 717, 765, 771, 819, 843, 891, 903, 951, 975, 1023, 2049, 2145, 2193, 2289, 2313, 2409, 2457, 2553, 2565, 2661, 2709, 2805, 2829, 2925, 2973, 3069, 3075, 3171, 3219, 3315
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
a(n) is divisible by 3 and it is always an odd number for n > 0. Therefore a(n) is in A016945 for n > 0. - Altug Alkan, Dec 04 2015
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (2^(floor_log_2(n)+1))*n + Sum_{i=0..floor_log_2(n)} '(bit_i(n, i)*(2^(floor_log_2(n)-i)))'.
|
|
MATHEMATICA
|
Prepend[Select[Range@ 3315, Reverse@ # == # && EvenQ@ Length@ # &@ IntegerDigits[#, 2] &], 0] (* Michael De Vlieger, Dec 04 2015 *)
|
|
PROG
|
(Haskell)
a048701 n = foldr (\d v -> 2 * v + d) 0 (reverse bs ++ bs) where
bs = a030308_row (n)
(PARI) a048701(n) = my(f); f = length(binary(n)) - 1; 2^(f+1)*n + sum(i=0, f, bittest(n, i) * 2^(f-i)); \\ Altug Alkan, Dec 03 2015
(Python)
s = bin(n)[2:]
|
|
CROSSREFS
|
See also A048702 = this sequence divided by 3, A048700 = binary palindromes of odd length, A006995 = all binary palindromes, A048703 = quaternary (base 4) palindromes of even length.
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|