login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182402 Total number of digits in n-th row of a triangle formed by the positive integers. 3

%I #46 Jan 26 2022 11:59:05

%S 1,2,3,5,10,12,14,16,18,20,22,24,26,34,45,48,51,54,57,60,63,66,69,72,

%T 75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,

%U 132,171,184,188,192,196,200,204,208,212,216,220,224,228,232

%N Total number of digits in n-th row of a triangle formed by the positive integers.

%C Sequence is nonlinear at each decade transition; for example, row-5 transitions from single-digit (7) to double-digit (10) where sequence jumps (3) to (5); row-14 transitions from 2-digit (92) to 3-digit (105) where sequence jumps from (26) to (34).

%C The rows of nonlinearity are given by A068092. - _Jon Perry_, May 26 2013

%H Reinhard Zumkeller, <a href="/A182402/b182402.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A058183(A000217(n)) - A058183(A000217(n-1)), n >= 2. - _Omar E. Pol_, Jun 25 2012

%e 1; .................... (row 1 contains 1 digit)

%e 2, 3; ............... (row 2 contains 2 digits)

%e 4, 5, 6; ........... (row 3 contains 3 digits)

%e 7, 8, 9, 10; ....... (row 4 contains 5 digits)

%e 11, 12, 13, 14, 15; ... (row 5 contains 10 digits)

%t f[n_] := Length@ Flatten[ IntegerDigits[ Range[n (n - 1)/2 + 1, n (n + 1)/2]]]; Array[f, 58] (* _Robert G. Wilson v_, Sep 04 2013 *)

%o (Haskell)

%o a182402 n = a182402_list !! (n-1)

%o a182402_list = map (sum . map a055642) $ t 1 [1..] where

%o t i xs = ys : t (i + 1) zs where

%o (ys, zs) = splitAt i xs

%o -- _Reinhard Zumkeller_, May 26 2013

%o (PARI) a(n) = {my(x=n*(n-1)/2+1, y=n*(n+1)/2, nx=#Str(x), ny=#Str(y), s=0); for (i=nx, ny, if (i==nx, if (i==ny, s+=(y+1-x)*i, s+=(10^i-x)*i), if (i==ny, s+=(y+1-10^(i-1))*i, s+=i*(10^(i+1)-10^i+1)););); s;} \\ _Michel Marcus_, Jan 26 2022

%o (Python)

%o def a(n): return len("".join(str(i) for i in range(n*(n+1)//2+1, (n+1)*(n+2)//2+1)))

%o print([a(n) for n in range(58)]) # _Michael S. Branicky_, Jan 26 2022

%Y Cf. A055642, A226029 (first differences).

%Y Cf. A068092.

%K nonn,base

%O 1,2

%A _Dave Durgin_, Jun 19 2012

%E Better definition from _Omar E. Pol_, Jun 25 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 10:31 EDT 2024. Contains 371240 sequences. (Running on oeis4.)