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.

A243589 Numbers returned when each binary digit of n is replaced by the sum modulo 2 of the digits to its (wrapped) left and (wrapped) right.

This page as a plain text file.
%I A243589 #17 Jun 01 2025 22:15:10
%S A243589 0,0,0,3,5,6,0,5,15,0,10,15,5,10,0,9,27,12,30,3,17,6,20,29,15,24,10,
%T A243589 23,5,18,0,17,51,20,54,27,57,30,60,5,39,0,34,15,45,10,40,57,27,60,30,
%U A243589 51,17,54,20,45,15,40,10,39,5,34,0,33,99,36,102,43,105,46
%N A243589 Numbers returned when each binary digit of n is replaced by the sum modulo 2 of the digits to its (wrapped) left and (wrapped) right.
%C A243589 a(n) = ror(n) XOR rol(n), where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left, and XOR is the binary exclusive-or operator. - _Alex Ratushnyak_, May 24 2016
%C A243589 Numbers returned by the following function: take the t binary digits of n, d(1)..d(t), and replace each with the sum d(i) = (d(i-1) + d(i+1)) mod 2, where (i-1 = 0) maps to t and (i+1 > t) maps to 1.
%H A243589 Anthony Sand, <a href="/A243589/b243589.txt">Table of n, a(n) for n = 1..1000</a>
%F A243589 for digits d(1)..d(t), d(i) = (d(i-1) + d(i+1)) mod 2, where (i-1 = 0) -> t, (i+1 > t) -> 1.
%e A243589 For 1, the function returns d(1) = (d(1) + d(1)) mod 2 = (1 + 1) mod 2 = 0.
%e A243589 For 5, the initial digits are (1,0,1).
%e A243589 d(1) = (d(3) + d(2)) mod 2 = (1 + 0) mod 2 = 1; d(2) = (d(1) + d(3)) mod 2 = (1 + 1) mod 2 = 0; d(3) = (d(2) + d(1)) mod 2 = (0 + 1) mod 2 = 1.
%e A243589 The function returns (1,0,1) = 101 = 5 in base 10.
%o A243589 (Python)
%o A243589 for n in range(1, 100):
%o A243589     BL = len(bin(n))-2
%o A243589     x = (n>>1) + ((n&1) << (BL-1))   # A038572(n)
%o A243589     x^= (n*2) - (1<<BL) + 1   # A006257(n)  for n>0
%o A243589     print(x, end=', ')
%Y A243589 Cf. A006257, A035327, A038572, A055120.
%K A243589 nonn,easy,base,look
%O A243589 1,4
%A A243589 _Anthony Sand_, Jun 07 2014