A125120 Sum of values of repunits of length n in base b representation with 1
1, 7, 41, 296, 2829, 34637, 519049, 9197344, 188039787, 4356087231, 112754069273, 3224945523736, 100999970565337, 3437517630509497, 126332966608699441, 4986057436997869696, 210331809309776028055, 9443995455881145458715
Offset: 1
Examples
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.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..385
- Eric Weisstein's World of Mathematics, Repunit
Programs
-
Magma
[(&+[(k^n -1)/(k-1): k in [2..n+1]]) : n in [1..30]]; // G. C. Greubel, Aug 14 2022
-
Mathematica
Table[Sum[(k^n -1)/(k-1), {k, 2, n+1}], {n, 30}] (* G. C. Greubel, Aug 14 2022 *)
-
PARI
a(n) = sum(k=1, n, sum(i=0, n-1, (k+1)^i)); \\ Michel Marcus, Dec 14 2020
-
SageMath
[sum(((k+1)^n -1)/k for k in (1..n)) for n in (1..30)] # G. C. Greubel, Aug 14 2022
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_{k=1..n} A125118(n,k).
a(n) = Sum_{j=2..n+1} (j^n - 1)/(j-1)