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.

A192776 Squares of binary palindromes.

This page as a plain text file.
%I A192776 #8 Jul 23 2024 20:21:48
%S A192776 0,1,1001,11001,110001,1010001,11100001,100100001,110111001,
%T A192776 1011011001,1111000001,10001000001,11111101001,101000101001,
%U A192776 111110000001,1000010000001,1010011010001,1110000111001,10000111001001,10011001001001,10110010111001,11011101010001,11111100000001,100000100000001,101101101110001,110101001011001,1000101110001001,1001010010001001,1011101101011001,1101000001110001,1111111000000001,10000001000000001,10010001100100001
%N A192776 Squares of binary palindromes.
%o A192776 (Python)
%o A192776 def A192776(n):
%o A192776     if n == 1: return 0
%o A192776     a = 1<<(l:=n.bit_length()-2)
%o A192776     m = a|(n&a-1)
%o A192776     return int(bin(((m<<l+1)+int(bin(m)[-1:1:-1]or'0', 2) if a&n else (m<<l)+int(bin(m)[-2:1:-1]or'0', 2))**2)[2:]) # _Chai Wah Wu_, Jul 23 2024
%Y A192776 This is A192775 written in base 2, also A006995 (or A057148) squared. Cf. A006995, A057148.
%K A192776 nonn,base
%O A192776 1,3
%A A192776 _N. J. A. Sloane_, Jul 09 2011