OFFSET
2,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 2..10001
Robin Fissum, Digit sums and the number of prime factors of the factorial n!=1.2...n, Bachelor's project in BMAT, Norwegian University of Science and Technology, 2020; ResearchGate link.
FORMULA
EXAMPLE
a(5) = 6 since in the prime bases 2, 3 and 5 the representations of 5 are 101_2, 12_3 and 10_5, respectively, and (1 + 0 + 1) + (1 + 2) + (1 + 0) = 6.
MATHEMATICA
s[n_, b_] := Plus @@ IntegerDigits[n, b]; ps[n_] := Select[Range[n], PrimeQ]; a[n_] := Sum[s[n, b], {b, ps[n]}]; Array[a, 100, 2]
PROG
(PARI) a(n) = sum(b=2, n, if (isprime(b), sumdigits(n, b))); \\ Michel Marcus, Apr 17 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Apr 16 2021
STATUS
approved