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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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
Offset: 0

Views

Author

Antti Karttunen, Mar 07 1999

Keywords

Comments

A178225(a(n)) = 1. - Reinhard Zumkeller, Oct 21 2011
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

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.
For first differences see A265026, A265027.

Programs

  • Haskell
    a048701 n = foldr (\d v -> 2 * v + d) 0 (reverse bs ++ bs) where
       bs = a030308_row (n)
    -- Reinhard Zumkeller, Feb 19 2003, Oct 21 2011
    
  • Mathematica
    Prepend[Select[Range@ 3315, Reverse@ # == # && EvenQ@ Length@ # &@ IntegerDigits[#, 2] &], 0] (* Michael De Vlieger, Dec 04 2015 *)
  • 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
    def A048701(n):
        s = bin(n)[2:]
        return int(s+s[::-1],2) # Chai Wah Wu, Feb 26 2021

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)))'.

Extensions

Offset corrected by Reinhard Zumkeller, Oct 21 2011
Offset changed back to 0 by Andrey Zabolotskiy, Dec 26 2022

A265027 First differences of A048701 divided by 6.

Original entry on oeis.org

1, 1, 3, 2, 1, 2, 11, 4, 2, 4, 1, 4, 2, 4, 43, 8, 4, 8, 2, 8, 4, 8, 1, 8, 4, 8, 2, 8, 4, 8, 171, 16, 8, 16, 4, 16, 8, 16, 2, 16, 8, 16, 4, 16, 8, 16, 1, 16, 8, 16, 4, 16, 8, 16, 2, 16, 8, 16, 4, 16, 8, 16, 683, 32, 16, 32, 8, 32, 16, 32, 4, 32, 16, 32, 8, 32, 16, 32, 2, 32, 16, 32, 8, 32, 16, 32, 4, 32, 16, 32, 8
Offset: 2

Views

Author

N. J. A. Sloane, Nov 30 2015

Keywords

Comments

Indices n such that a(n) = 1 are equal to row sums of Lucas triangle. In other words, a(A042950(n)) = 1. Additionally, a(A070875(n)) = 2 and a(A123760(n)) = 4. - Altug Alkan, Dec 04 2015

Crossrefs

Programs

  • Mathematica
    Differences@ Select[Range@ 12000, Reverse@ # == # && EvenQ@ Length@ # &@ IntegerDigits[#, 2] &]/6 (* Michael De Vlieger, Dec 04 2015 *)
  • PARI
    a048701(n) = my(f); f = length(binary(n)) - 1; 2^(f+1)*n + sum(i=0, f, bittest(n, i) * 2^(f-i));
    vector(100, n, (a048701(n+1) - a048701(n)) / 6) \\ Altug Alkan, Dec 03 2015

Formula

a(n) = A265026(n) / 6, for n > 1. - Altug Alkan, Dec 03 2015
Showing 1-2 of 2 results.