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 A346688 #11 Aug 01 2021 14:43:51 %S A346688 0,1,2,3,-1,0,1,2,-2,-1,0,1,-3,-2,-1,0,1,2,3,4,0,1,2,3,-1,0,1,2,-2,-1, %T A346688 0,1,2,3,4,5,1,2,3,4,0,1,2,3,-1,0,1,2,3,4,5,6,2,3,4,5,1,2,3,4,0,1,2,3, %U A346688 -1,0,1,2,-2,-1,0,1,-3,-2,-1,0,-4,-3,-2,-1,0,1,2,3,-1,0,1,2,-2,-1,0,1,-3,-2,-1,0,1,2,3,4,0,1,2,3,-1 %N A346688 Replace 4^k with (-1)^k in base-4 expansion of n. %C A346688 If n has base-4 expansion abc..xyz with least significant digit z, a(n) = z - y + x - w + ... %F A346688 G.f. A(x) satisfies: A(x) = x * (1 + 2*x + 3*x^2) / (1 - x^4) - (1 + x + x^2 + x^3) * A(x^4). %F A346688 a(n) = n + 5 * Sum_{k>=1} (-1)^k * floor(n/4^k). %e A346688 54 = 312_4, 2 - 1 + 3 = 4, so a(54) = 4. %t A346688 nmax = 104; A[_] = 0; Do[A[x_] = x (1 + 2 x + 3 x^2)/(1 - x^4) - (1 + x + x^2 + x^3) A[x^4] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x] %t A346688 Table[n + 5 Sum[(-1)^k Floor[n/4^k], {k, 1, Floor[Log[4, n]]}], {n, 0, 104}] %o A346688 (Python) %o A346688 from sympy.ntheory.digits import digits %o A346688 def a(n): %o A346688 return sum(bi*(-1)**k for k, bi in enumerate(digits(n, 4)[1:][::-1])) %o A346688 print([a(n) for n in range(105)]) # _Michael S. Branicky_, Jul 29 2021 %Y A346688 Cf. A007090, A053737, A055017, A065359, A065368, A346689, A346690, A346691. %K A346688 sign,base %O A346688 0,3 %A A346688 _Ilya Gutkovskiy_, Jul 29 2021