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 A051065 #45 Sep 03 2025 04:25:39 %S A051065 0,1,0,0,1,0,0,1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0, %T A051065 1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,1,1,0, %U A051065 1,1,0,1,0,1,0,0,1,0,0,1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,1,0,1,0,1,1,0,1 %N A051065 a(n) = A004128(n) mod 2. %D A051065 Letter from _Gary W. Adamson_ concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999. %H A051065 Benoit Cloitre, <a href="/A051065/a051065.png">3^13 steps of the walk using step: turn +90 degrees if a(n)=0, -90 degrees if a(n)=1</a>. %F A051065 a(0)=0, a(n) = (n + a(floor(n/3))) mod 2. - _Alex Ratushnyak_, Aug 17 2012 %t A051065 Join[{0}, Mod[Accumulate[Table[IntegerExponent[3*n, 3], {n, 1, 100}]], 2]] (* _Amiram Eldar_, Jun 02 2025 *) %o A051065 (Python) %o A051065 TOP = 1000 %o A051065 a = [0]*TOP %o A051065 for n in range(1, TOP): %o A051065 print(a[n-1], end=',') %o A051065 a[n] = (n + a[n//3]) % 2 %o A051065 # _Alex Ratushnyak_, Aug 17 2012 %o A051065 (Python) %o A051065 def A051065(n): %o A051065 c, m, a = 1, 3*n, 0 %o A051065 for k in range(1,n+1): %o A051065 c *= 3 %o A051065 if c > m: %o A051065 break %o A051065 a ^= m//c&1 %o A051065 return a # _Chai Wah Wu_, Sep 02 2025 %o A051065 (PARI) a(n)=if(n<1,0,(a(n\3)+n)%2) \\ _Benoit Cloitre_, Nov 21 2013 %Y A051065 Cf. A004128, A051066, A051067, A051069. %K A051065 nonn,easy,changed %O A051065 0,1 %A A051065 _N. J. A. Sloane_ and _Gary W. Adamson_ %E A051065 More terms from _James Sellers_, Dec 11 1999