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.
%I A378299 #48 Jan 11 2025 14:06:02 %S A378299 0,1,1,2,1,6,2,5,1,14,6,9,2,13,5,10,1,30,14,17,6,25,9,22,2,29,13,18,5, %T A378299 26,10,21,1,62,30,33,14,49,17,46,6,57,25,38,9,54,22,41,2,61,29,34,13, %U A378299 50,18,45,5,58,26,37,10,53,21,42,1,126,62,65,30,97,33,94 %N A378299 Read the binary representation of n from the most to least significant bit then perform a cumulative XOR and store by reading from least to most significant bit. %C A378299 a(n) is Gray-coded into the reversed binary representation of n. %C A378299 Fixed points are 0 and f(n) = 8*f(n-1) + 5 with f(1)=1 or f(n) = (1/14)*(3*(2^(3*n))-10) for n >= 1 (cf. A380001). %H A378299 Paolo Xausa, <a href="/A378299/b378299.txt">Table of n, a(n) for n = 0..16383</a> %H A378299 Michael De Vlieger, <a href="/A378299/a378299.png">Log log scatterplot of a(n)</a>, n = 1..2^20. %H A378299 Michael De Vlieger, <a href="/A378299/a378299_1.png">Fan style binary tree showing a(n)</a>, n = 0..2^13-1, with a color function showing a(n) according to floor(log_2(a(n))). %H A378299 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A378299 a(n) = A006068(A030101(n)). %F A378299 a(A000079(n)) = 1. %F A378299 a(A007283(n)) = 2. %F A378299 a(A000225(n)) = A000975(n). %F A378299 a(A000051(n)) = A095121(n). %e A378299 For n = 75 a(75) = 78 because: %e A378299 75 in base 2 is 1001011 and in base 2: %e A378299 m | x = x XOR (m AND 1) | o %e A378299 ---------+---------------------+---------- %e A378299 1001011 | 1 = 0 XOR 1 | 1 %e A378299 100101 | 0 = 1 XOR 1 | 10 %e A378299 10010 | 0 = 0 XOR 0 | 100 %e A378299 1001 | 1 = 0 XOR 1 | 1001 %e A378299 100 | 1 = 1 XOR 0 | 10011 %e A378299 10 | 1 = 1 XOR 0 | 100111 %e A378299 1 | 0 = 1 XOR 1 | 1001110 %e A378299 And 1001110 in base 10: 78 %t A378299 A378299[n_] := FromDigits[FoldList[BitXor, 0, Reverse[IntegerDigits[n, 2]]], 2]; %t A378299 Array[A378299, 100, 0] (* _Paolo Xausa_, Dec 13 2024 *) %o A378299 (Python) %o A378299 def a(n): %o A378299 m,x,o = n,0,0 %o A378299 while m > 0: %o A378299 x ^= (m & 1) %o A378299 o <<= 1 %o A378299 o |= x %o A378299 m >>=1 %o A378299 return o %o A378299 print([a(n) for n in range(0,71)]) %Y A378299 Cf. A000079, A000225, A000051, A000975, A007283, A006068, A030101, A095121. %Y A378299 Cf. A380001 (fixed points). %K A378299 nonn,base,look %O A378299 0,4 %A A378299 _DarĂo Clavijo_, Nov 22 2024