%I #29 May 09 2021 07:55:05
%S 0,1,3,6,10,20,32,46,62,80,100,133,169,208,250,295,343,394,448,505,
%T 565,628,694,763,835,910,988,1069,1181,1297,1417,1541,1669,1801,1937,
%U 2077,2221,2369,2521,2677,2837,3001,3169,3341,3517,3697,3881,4069,4261,4457,4657,4861,5069,5281,5497,5717,5941
%N a(1) = 0; a(n+1) = a(n) + n * the number of digits of a(n).
%C In this sequence each a(n) term is the sum of k-terms, where k is the number of digits of a(n-1).
%C This is easy to verify by observing the following table:
%C +----+---------+---------+---------+--+-----+
%C | n | A000217 | A056000 | A101859 |..| a(n)|
%C +----+---------+---------+---------+--+-----+
%C | 1 | 0 | . | . | .| 0 |
%C | 2 | 1 | . | . | .| 1 |
%C | 3 | 3 | . | . | .| 3 |
%C | 4 | 6 | . | . | .| 6 |
%C | 5 | 10 | 0 | . | .| 10 |
%C | 6 | 15 | 5 | . | .| 20 |
%C | 7 | 21 | 11 | . | .| 32 |
%C | 8 | 28 | 18 | . | .| 46 |
%C | 9 | 36 | 26 | . | .| 62 |
%C | 10 | 45 | 35 | . | .| 80 |
%C | 11 | 55 | 45 | 0 | .| 100 |
%C | 12 | 66 | 56 | 11 | .| 133 |
%C | 13 | 78 | 68 | 23 | .| 169 |
%C | 14 | 91 | 81 | 36 | .| 208 |
%C | 15 | 105 | 95 | 50 | .| 250 |
%C | 16 | 120 | 110 | 65 | .| 295 |
%C | 17 | 136 | 126 | 81 | .| 343 |
%C .
%C As we can see each of those terms is a term of a different subsequence, that is generated with the same construction rule, that is: a(n) = n + a(n-1) + Z.
%C In fact:
%C A000217 --> a(n) = n + a(n-1) + 0;
%C A056000 --> a(n) = n + a(n-1) + 4;
%C A101859 --> a(n) = n + a(n-1) + 10.
%C And so on, where the Z value is the n value of this sequence when the number of digits of a(n) is greater than that of a(n-1), or Z = Sum_{j=1..i} k(j) where k(j) is A270270(j).
%H Francesco Di Matteo, <a href="/A270048/b270048.txt">Table of n, a(n) for n = 1..1000</a>
%e a(4) = 3 + 3*1 = 6;
%e a(5) = 6 + 4*1 = 10;
%e a(6) = 10 + 5*2 = 20.
%t a[1] = 0; a[n_] := a[n] = # + (n - 1) If[# == 0, 1, IntegerLength@ #] &@ a[n - 1]; Table[a@ n, {n, 57}] (* _Michael De Vlieger_, Mar 09 2016 *)
%o (Python)
%o b = 0
%o print(b, end=',')
%o for g in range(1, 100):
%o b += g*len(str(b))
%o print(b, end=',')
%o (PARI) a(n) = if (n==1, 0, prec = a(n-1); prec + (n-1)*#Str(prec)); \\ _Michel Marcus_, Apr 03 2016
%Y Cf. A000217, A056000, A101859, A264847, A270270.
%K nonn,base
%O 1,3
%A _Francesco Di Matteo_, Mar 09 2016
|