OFFSET
1,3
COMMENTS
In this sequence each a(n) term is the sum of k-terms, where k is the number of digits of a(n-1).
This is easy to verify by observing the following table:
+----+---------+---------+---------+--+-----+
+----+---------+---------+---------+--+-----+
| 1 | 0 | . | . | .| 0 |
| 2 | 1 | . | . | .| 1 |
| 3 | 3 | . | . | .| 3 |
| 4 | 6 | . | . | .| 6 |
| 5 | 10 | 0 | . | .| 10 |
| 6 | 15 | 5 | . | .| 20 |
| 7 | 21 | 11 | . | .| 32 |
| 8 | 28 | 18 | . | .| 46 |
| 9 | 36 | 26 | . | .| 62 |
| 10 | 45 | 35 | . | .| 80 |
| 11 | 55 | 45 | 0 | .| 100 |
| 12 | 66 | 56 | 11 | .| 133 |
| 13 | 78 | 68 | 23 | .| 169 |
| 14 | 91 | 81 | 36 | .| 208 |
| 15 | 105 | 95 | 50 | .| 250 |
| 16 | 120 | 110 | 65 | .| 295 |
| 17 | 136 | 126 | 81 | .| 343 |
.
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.
In fact:
A000217 --> a(n) = n + a(n-1) + 0;
A056000 --> a(n) = n + a(n-1) + 4;
A101859 --> a(n) = n + a(n-1) + 10.
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).
LINKS
Francesco Di Matteo, Table of n, a(n) for n = 1..1000
EXAMPLE
a(4) = 3 + 3*1 = 6;
a(5) = 6 + 4*1 = 10;
a(6) = 10 + 5*2 = 20.
MATHEMATICA
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 *)
PROG
(Python)
b = 0
print(b, end=', ')
for g in range(1, 100):
b += g*len(str(b))
print(b, end=', ')
(PARI) a(n) = if (n==1, 0, prec = a(n-1); prec + (n-1)*#Str(prec)); \\ Michel Marcus, Apr 03 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Francesco Di Matteo, Mar 09 2016
STATUS
approved