login
A351985
If n = abcd... in decimal, a(n) = |a^3 - b^3 + c^3 - d^3 + ...|.
2
0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1, 0, 7, 26, 63, 124, 215, 342, 511, 728, 8, 7, 0, 19, 56, 117, 208, 335, 504, 721, 27, 26, 19, 0, 37, 98, 189, 316, 485, 702, 64, 63, 56, 37, 0, 61, 152, 279, 448, 665, 125, 124, 117, 98, 61, 0, 91, 218, 387, 604, 216, 215, 208, 189, 152
OFFSET
0,3
MAPLE
a:= n-> (l-> abs(add(l[i]^3*(-1)^i, i=1..nops(l))))(convert(n, base, 10)):
seq(a(n), n=0..64); # Alois P. Heinz, Mar 24 2022
MATHEMATICA
Table[Abs[Sum[(-1)^(k + 1)*Part[IntegerDigits[n]^3, k], {k, 1, Length[IntegerDigits[n]]}]], {n, 0, 100}]
PROG
(PARI) a(n) = my(d=digits(n)); abs(sum(k=1, #d, (-1)^k*d[k]^3)) \\ Michel Marcus, Feb 27 2022
(Python)
def A351985(n): return abs(sum((-1 if a%2 else 1)*int(b)**3 for a, b in enumerate(str(n)))) # Chai Wah Wu, Mar 09 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Luca Onnis, Feb 27 2022
STATUS
approved