login
Pluritriangular numbers: a(0) = 0; a(n+1) = a(n) + the number of digits in terms a(0)..a(n).
4

%I #64 May 03 2021 21:26:19

%S 0,1,3,6,10,16,24,34,46,60,76,94,114,137,163,192,224,259,297,338,382,

%T 429,479,532,588,647,709,774,842,913,987,1064,1145,1230,1319,1412,

%U 1509,1610,1715,1824,1937,2054,2175,2300,2429,2562,2699,2840,2985,3134,3287,3444,3605,3770,3939

%N Pluritriangular numbers: a(0) = 0; a(n+1) = a(n) + the number of digits in terms a(0)..a(n).

%C Due to its generation rule, a(n+1) is the sum of floor(log_10(a(n)))+1 terms of A000217 (triangular numbers), as the name suggests.

%C This is easy to verify by observing the following table:

%C +----+-----+----+----+---+-----+

%C | n | Tn | Tn'| Tn"|...| a(n)|

%C +----+-----+----+----+---+-----+

%C | 1 | 1 | | | | 1 |

%C | 2 | 3 | | | | 3 |

%C | 3 | 6 | | | | 6 |

%C | 4 | 10 | | | | 10 |

%C | 5 | 15 | 1 | | | 16 |

%C | 6 | 21 | 3 | | | 24 |

%C | 7 | 28 | 6 | | | 34 |

%C | 8 | 36 | 10 | | | 46 |

%C | 9 | 45 | 15 | | | 60 |

%C | 10 | 55 | 21 | | | 76 |

%C | 11 | 66 | 28 | | | 94 |

%C | 12 | 78 | 36 | | | 114 |

%C | 13 | 91 | 45 | 1 | | 137 |

%C | 14 | 105 | 55 | 3 | | 163 |

%C | 15 | 120 | 66 | 6 | | 192 |

%C .

%C It is evident that each new Tn sequence starts after each a(k) terms of A265108, corresponding to the n (number of digits) change, as also pointed out in A265108 (see also Formula).

%H Francesco Di Matteo, <a href="/A264847/b264847.txt">Table of n, a(n) for n = 0..100</a>

%F a(n) = T(n) + T(n-k(1)) + T(n-(k(1)+ k(2))) + T(n-(k(1)+ k(2) + k(3))) + ... + T(n - Sum_{j=1..i} k(j)) with (n - Sum_{j=1..i} k(j)) > 0, where T are the triangular numbers and where k(j) is A265108(j).

%F E.g., a(25) = T(25) + T(25 - 4) + T(25 - 4 - 8) = 325 + 231 + 91 = 647.

%F G.f.: (1-x)^(-3) * Sum_{k>=1} x^(b(k)+1) where b(k) is the first m such that a(m) has k decimal digits (including b(1)=0). - _Robert Israel_, Dec 14 2015

%F a(n+1) = 2*a(n) - a(n-1) + floor(log_10(a(n))) + 1. - _Danny Rorabaugh_, Jan 20 2016

%e a(1) = 1 = 0 + 1 because a(0) = 0 and 0 has 1 digit.

%e ...

%e a(6) = 24 = 16 + 8 because a(5) = 16 and 0, 1, 3, 6, 10, 16 have 8 digits.

%e a(7) = 34 = 24 + 10 because a(6) = 24 and 0, 1, 3, 6, 10, 16, 24 have 10 digits.

%p a[0]:= 0: d[0]:= 1;

%p for n from 1 to 300 do

%p a[n]:= a[n-1] + d[n-1];

%p d[n]:= d[n-1] + ilog10(a[n])+1;

%p od:

%p seq(a[i],i=0..300); # _Robert Israel_, Dec 14 2015

%t a = {0}; Do[AppendTo[a, a[[n - 1]] + Length@ Flatten@ Map[IntegerDigits, a]], {n, 2, 68}]; a (* _Michael De Vlieger_, Nov 27 2015 *)

%o (Python)

%o a, b = 0, 0

%o print(a, end=',')

%o for k in range(1, 101):

%o b += len(str(a))

%o a += b

%o print(a, end=',')

%o (PARI) lista(nn) = {v = vector(nn); for (i=2, nn, v[i] = v[i-1] + sum(k=1, i-1, #Str(v[k]));); v;} \\ _Michel Marcus_, Dec 05 2015

%Y Cf. A000217, A064223, A088235, A102685, A265108.

%K nonn,base

%O 0,3

%A _Francesco Di Matteo_, Nov 26 2015