OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 13_10 = 23_5 (2 digits in base 5): a(13) = 2^2 + 3^2 = 13.
For n = 73_10 = 243_5 (3 digits in base 5): a(73) = 2^3 + 4^3 + 3^3 = 99.
MAPLE
f:= proc(n) local L, d, i;
L:= convert(n, base, 5);
d:= nops(L);
add(L[i]^d, i=1..d)
end proc:
map(f, [$1..100]); # Robert Israel, Oct 26 2023
MATHEMATICA
a[n_] := Total[IntegerDigits[n, 5]^IntegerLength[n, 5]]; Array[a, 100] (* Amiram Eldar, Oct 30 2022 *)
PROG
(PARI) a(n) = my(d=digits(n, 5)); sum(k=1, #d, d[k]^#d); \\ Michel Marcus, Oct 29 2022
(Python)
from sympy.ntheory.factor_ import digits
def A357143(n):
t = len(s:=digits(n, 5)[1:])
return sum(d**t for d in s) # Chai Wah Wu, Oct 31 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Francesco A. Catalanotti, Oct 26 2022
EXTENSIONS
Corrected and extended by Michel Marcus, Oct 29 2022
STATUS
approved