login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343481
a(n) is the sum of all digits of n in every prime base 2 <= p <= n.
1
1, 3, 3, 6, 6, 10, 11, 11, 10, 15, 16, 22, 21, 21, 23, 30, 32, 40, 42, 42, 39, 48, 52, 53, 49, 52, 53, 63, 66, 77, 83, 82, 76, 77, 82, 94, 87, 85, 90, 103, 107, 121, 123, 129, 120, 135, 144, 147, 153, 150, 151, 167, 176, 178, 185, 181, 168, 185, 194, 212, 199
OFFSET
2,2
LINKS
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
a(n) ~ (1-Pi^2/12)*n^2/log(n) + c*n^2/log(n)^2 + o(n^2/log(n)^2), where c = 1 - Pi^2/24 + zeta'(2)/2 = 1 - A222171 - (1/2)*A073002 = 0.1199923561... (Fissum, 2020).
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