|
|
A125120
|
|
Sum of values of repunits of length n in base b representation with 1<b<=n+1.
|
|
2
|
|
|
1, 7, 41, 296, 2829, 34637, 519049, 9197344, 188039787, 4356087231, 112754069273, 3224945523736, 100999970565337, 3437517630509497, 126332966608699441, 4986057436997869696, 210331809309776028055, 9443995455881145458715
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
Eric Weisstein's World of Mathematics, Repunit
|
|
FORMULA
|
a(n) = Sum_{k=1..n} Sum_{i=0..n-1} (k+1)^i. [Corrected by Mathew Englander, Dec 14 2020]
a(n) = Sum_{j=2..n+1} (j^n - 1)/(j-1)
|
|
EXAMPLE
|
a(4) = [1111]_2 + [1111]_3 + [1111]_4 + [1111]_5 = ((2+1)*2+1)*2+1 + ((3+1)*3+1)*3+1 + ((4+1)*4+1)*4+1 + ((5+1)*5+1)*5+1 = 296.
|
|
MATHEMATICA
|
Table[Sum[(k^n -1)/(k-1), {k, 2, n+1}], {n, 30}] (* G. C. Greubel, Aug 14 2022 *)
|
|
PROG
|
(PARI) a(n) = sum(k=1, n, sum(i=0, n-1, (k+1)^i)); \\ Michel Marcus, Dec 14 2020
(Magma) [(&+[(k^n -1)/(k-1): k in [2..n+1]]) : n in [1..30]]; // G. C. Greubel, Aug 14 2022
(SageMath) [sum(((k+1)^n -1)/k for k in (1..n)) for n in (1..30)] # G. C. Greubel, Aug 14 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|