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