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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A346691 Replace 7^k with (-1)^k in base-7 expansion of n. 8
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, -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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
If n has base-7 expansion abc..xyz with least significant digit z, a(n) = z - y + x - w + ...
LINKS
FORMULA
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).
a(n) = n + 8 * Sum_{k>=1} (-1)^k * floor(n/7^k).
EXAMPLE
83 = 146_7, 6 - 4 + 1 = 3, so a(83) = 3.
MATHEMATICA
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]
Table[n + 8 Sum[(-1)^k Floor[n/7^k], {k, 1, Floor[Log[7, 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, 7)[1:][::-1]))
print([a(n) for n in range(105)]) # Michael S. Branicky, Jul 29 2021
CROSSREFS
Sequence in context: A256297 A256307 A030998 * A255827 A277545 A190596
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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 15 19:27 EDT 2024. Contains 374334 sequences. (Running on oeis4.)