The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A346688 Replace 4^k with (-1)^k in base-4 expansion of n. 8
 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, 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, -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 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS If n has base-4 expansion abc..xyz with least significant digit z, a(n) = z - y + x - w + ... LINKS Table of n, a(n) for n=0..104. FORMULA 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). a(n) = n + 5 * Sum_{k>=1} (-1)^k * floor(n/4^k). EXAMPLE 54 = 312_4, 2 - 1 + 3 = 4, so a(54) = 4. MATHEMATICA 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] Table[n + 5 Sum[(-1)^k Floor[n/4^k], {k, 1, Floor[Log[4, n]]}], {n, 0, 104}] PROG (Python) from sympy.ntheory.digits import digits def a(n): return sum(bi*(-1)**k for k, bi in enumerate(digits(n, 4)[1:][::-1])) print([a(n) for n in range(105)]) # Michael S. Branicky, Jul 29 2021 CROSSREFS Cf. A007090, A053737, A055017, A065359, A065368, A346689, A346690, A346691. Sequence in context: A321896 A321897 A050074 * A278313 A006705 A031269 Adjacent sequences: A346685 A346686 A346687 * A346689 A346690 A346691 KEYWORD sign,base AUTHOR Ilya Gutkovskiy, Jul 29 2021 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 9 03:06 EDT 2024. Contains 375759 sequences. (Running on oeis4.)