OFFSET
2,2
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 2..1000
EXAMPLE
8 in bases 2...8 is:
1000 (base 2)
22 (base 3)
20 (base 4)
13 (base 5)
12 (base 6)
11 (base 7)
10 (base 8)
The sum of first digits is 1+2+2+1+1+1+1 = 9, so a(8)=9.
MATHEMATICA
f[n_] := Sum[ IntegerDigits[n, k][[1]], {k, 2, n}]; Array[f, 70, 2] (* Robert G. Wilson v, Aug 02 2014 *)
PROG
(Python)
import math
def modlg(a, b):
....return a // b**int(math.log(a, b))
for n in range(1, 77):
....s=0
....for k in range(2, n+1):
........s += modlg(n, k)
....print str(s)+', ',
(PARI) a(n) = sum(i=2, n, digits(n, i)[1]); \\ Michel Marcus, Jul 17 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Jul 08 2014
STATUS
approved