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!)
A346690 Replace 6^k with (-1)^k in base-6 expansion of n. 6
0, 1, 2, 3, 4, 5, -1, 0, 1, 2, 3, 4, -2, -1, 0, 1, 2, 3, -3, -2, -1, 0, 1, 2, -4, -3, -2, -1, 0, 1, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, -1, 0, 1, 2, 3, 4, -2, -1, 0, 1, 2, 3, -3, -2, -1, 0, 1, 2, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, -1, 0, 1, 2, 3, 4, -2, -1, 0, 1, 2, 3, -3, -2, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
If n has base-6 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) / (1 - x^6) - (1 + x + x^2 + x^3 + x^4 + x^5) * A(x^6).
a(n) = n + 7 * Sum_{k>=1} (-1)^k * floor(n/6^k).
a(6*n+j) = j - a(n) for 0 <= j <= 5. - Robert Israel, Nov 21 2022
EXAMPLE
59 = 135_6, 5 - 3 + 1 = 3, so a(59) = 3.
MAPLE
f:= proc(n) option remember; (n mod 6) - procname(floor(n/6)) end proc:
f(0):= 0:
map(f, [$1..100]); # Robert Israel, Nov 21 2022
MATHEMATICA
nmax = 104; A[_] = 0; Do[A[x_] = x (1 + 2 x + 3 x^2 + 4 x^3 + 5 x^4)/(1 - x^6) - (1 + x + x^2 + x^3 + x^4 + x^5) A[x^6] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
Table[n + 7 Sum[(-1)^k Floor[n/6^k], {k, 1, Floor[Log[6, 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, 6)[1:][::-1]))
print([a(n) for n in range(105)]) # Michael S. Branicky, Jul 29 2021
(PARI) a(n) = subst(Pol(digits(n, 6)), 'x, -1); \\ Michel Marcus, Nov 22 2022
CROSSREFS
Sequence in context: A256296 A256306 A030548 * A117724 A255826 A339256
KEYWORD
sign,base,easy
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 May 11 06:07 EDT 2024. Contains 372388 sequences. (Running on oeis4.)