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