login
Total number of digits in row n of Pascal's triangle.
1

%I #28 Feb 15 2024 12:54:23

%S 1,2,3,4,5,8,10,12,14,18,25,28,31,38,44,50,57,64,69,76,88,96,102,114,

%T 125,134,142,154,166,178,191,202,215,230,244,256,268,288,303,316,334,

%U 356,372,388,411,428,447,470,490,506,529,554,573,590,618,642,660,686

%N Total number of digits in row n of Pascal's triangle.

%F a(n) = 1 + n + Sum_{k=0..n} floor(log_10(C(n,k))).

%F a(n) = A055642(A003590(n)). - _Michel Marcus_, Jan 15 2024

%p a:= n-> length(cat(seq(binomial(n,k), k=0..n))):

%p seq(a(n), n=0..57); # _Alois P. Heinz_, Jan 15 2024

%t A369152[n_Integer] := Total[IntegerLength[Binomial[n, #]] & /@ Range[0, n]]

%t First50Terms = Table[A369152[n], {n, 0, 49}]

%o (PARI) a(n) = #concat(vector(n+1, k, Str(binomial(n,k-1)))); \\ _Michel Marcus_, Jan 18 2024

%o (Python)

%o from math import comb

%o def A369152(n): return sum(len(str(comb(n,k))) for k in range(n+1)) # _Chai Wah Wu_, Feb 15 2024

%Y Cf. A007318, A055642, A003590.

%K nonn,base

%O 0,2

%A _Bartlomiej Pawlik_, Jan 14 2024