cp's OEIS Frontend

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.

A048701 List of binary palindromes of even length (written in base 10).

This page as a plain text file.
%I A048701 #47 Dec 26 2022 13:00:37
%S A048701 0,3,9,15,33,45,51,63,129,153,165,189,195,219,231,255,513,561,585,633,
%T A048701 645,693,717,765,771,819,843,891,903,951,975,1023,2049,2145,2193,2289,
%U A048701 2313,2409,2457,2553,2565,2661,2709,2805,2829,2925,2973,3069,3075,3171,3219,3315
%N A048701 List of binary palindromes of even length (written in base 10).
%C A048701 A178225(a(n)) = 1. - _Reinhard Zumkeller_, Oct 21 2011
%C A048701 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
%H A048701 Reinhard Zumkeller, <a href="/A048701/b048701.txt">Table of n, a(n) for n = 0..9999</a>
%F A048701 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)))'.
%t A048701 Prepend[Select[Range@ 3315, Reverse@ # == # && EvenQ@ Length@ # &@ IntegerDigits[#, 2] &], 0] (* _Michael De Vlieger_, Dec 04 2015 *)
%o A048701 (Haskell)
%o A048701 a048701 n = foldr (\d v -> 2 * v + d) 0 (reverse bs ++ bs) where
%o A048701    bs = a030308_row (n)
%o A048701 -- _Reinhard Zumkeller_, Feb 19 2003, Oct 21 2011
%o A048701 (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
%o A048701 (Python)
%o A048701 def A048701(n):
%o A048701     s = bin(n)[2:]
%o A048701     return int(s+s[::-1],2) # _Chai Wah Wu_, Feb 26 2021
%Y A048701 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.
%Y A048701 For first differences see A265026, A265027.
%Y A048701 Cf. A030308, A007088, A178225.
%K A048701 nonn,base
%O A048701 0,2
%A A048701 _Antti Karttunen_, Mar 07 1999
%E A048701 Offset corrected by _Reinhard Zumkeller_, Oct 21 2011
%E A048701 Offset changed back to 0 by _Andrey Zabolotskiy_, Dec 26 2022