OFFSET
3,1
MATHEMATICA
Table[Sum[If[PrimeQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 63}] (* Stefano Spezia, Sep 06 2022 *)
PROG
(PARI) a(n) = {s = 0; forprime (i=2, n-1, d = digits(n, i); s += sum(j=1, #d, d[j]); ); s; } \\ Michel Marcus, May 30 2014
(Python)
from sympy.ntheory import digits, isprime
def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if isprime(b))
print([a(n) for n in range(3, 64)]) # Michael S. Branicky, Sep 06 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved