login
Sum of values of repunits of length n in base b representation with 1<b<=n+1.
2

%I #22 Aug 15 2022 04:22:53

%S 1,7,41,296,2829,34637,519049,9197344,188039787,4356087231,

%T 112754069273,3224945523736,100999970565337,3437517630509497,

%U 126332966608699441,4986057436997869696,210331809309776028055,9443995455881145458715

%N Sum of values of repunits of length n in base b representation with 1<b<=n+1.

%H G. C. Greubel, <a href="/A125120/b125120.txt">Table of n, a(n) for n = 1..385</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Repunit.html">Repunit</a>

%F a(n) = Sum_{k=1..n} Sum_{i=0..n-1} (k+1)^i. [Corrected by _Mathew Englander_, Dec 14 2020]

%F a(n) = Sum_{k=1..n} A125118(n,k).

%F a(n+1) - a(n) = A076015(n+1) + A228275(n+2, n). - _Mathew Englander_, Dec 14 2020

%F a(n) = Sum_{j=2..n+1} (j^n - 1)/(j-1)

%e 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.

%t Table[Sum[(k^n -1)/(k-1), {k, 2, n+1}], {n, 30}] (* _G. C. Greubel_, Aug 14 2022 *)

%o (PARI) a(n) = sum(k=1, n, sum(i=0, n-1, (k+1)^i)); \\ _Michel Marcus_, Dec 14 2020

%o (Magma) [(&+[(k^n -1)/(k-1): k in [2..n+1]]) : n in [1..30]]; // _G. C. Greubel_, Aug 14 2022

%o (SageMath) [sum(((k+1)^n -1)/k for k in (1..n)) for n in (1..30)] # _G. C. Greubel_, Aug 14 2022

%Y Row sums of A125118.

%Y Cf. A076015, A228275.

%K nonn,base

%O 1,2

%A _Reinhard Zumkeller_, Nov 21 2006