login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers obtained by adding the first k repdigits that consist of the same digit, for some number k.
2

%I #69 Nov 05 2024 18:59:19

%S 1,2,3,4,5,6,7,8,9,12,24,36,48,60,72,84,96,108,123,246,369,492,615,

%T 738,861,984,1107,1234,2468,3702,4936,6170,7404,8638,9872,11106,12345,

%U 24690,37035,49380,61725,74070,86415,98760,111105,123456,246912,370368,493824

%N Numbers obtained by adding the first k repdigits that consist of the same digit, for some number k.

%H <a href="/index/Rec#order_27">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,-21,0,0,0,0,0,0,0,0,10).

%F a(n) = d*A014824(m) where d = (n-1) mod 9 + 1 and m = ceiling(n/9). - _Jon E. Schoenfield_, Jul 22 2021

%F G.f.: x*(1 + 2*x + 3*x^2 + 4*x^3 + 5*x^4 + 6*x^5 + 7*x^6 + 8*x^7 + 9*x^8)/((1 - x^9)^2*(1 - 10*x^9)). - _Stefano Spezia_, Jul 26 2021

%e a(1) = 1,

%e a(2) = 2,

%e a(3) = 3,

%e ...

%e a(9) = 9;

%e a(10) = 1 + 11 = 12,

%e a(11) = 2 + 22 = 24,

%e a(12) = 3 + 33 = 36,

%e ...

%e a(18) = 9 + 99 = 108;

%e a(19) = 1 + 11 + 111 = 123,

%e a(20) = 2 + 22 + 222 = 246,

%e a(21) = 3 + 33 + 333 = 369,

%e ...

%e a(27) = 9 + 99 + 999 = 1107; ...

%t Table[m*(10^(1+k)-10-9*k)/81,{k,6},{m,9}]//Flatten (* _Stefano Spezia_, Aug 17 2021 *)

%o (Python)

%o def sumRepUnits(n): # A014824

%o return ((10**n-1)*10 - 9*n)//81

%o def a(n): # A346535

%o d = 1 + (n-1)%9

%o m = 1 + (n-1)//9

%o return d*sumRepUnits(m)

%o for n in range(1,1000):

%o print(n, a(n))

%Y Cf. A010785, A014824.

%K nonn,base,easy

%O 1,2

%A _Jwalin Bhatt_, Jul 22 2021