A333183 Number of digits in concatenation of first n positive even integers.
1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154
Offset: 1
Examples
For example, a(5) = 6 because 246810 (the concatenation of the first five positive even integers) has six digits.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
L:= [1$4, seq(i $(9/2*10^(i-1),i=2..3)]: ListTools:-PartialSums(L); # Robert Israel, Apr 05 2020
-
Mathematica
Accumulate[IntegerLength[2Range[80]]] (* Alonso del Arte, Mar 12 2020, after Harvey P. Dale *)
-
PARI
a(n) = sum(k=1, n, #Str(2*k)); \\ Michel Marcus, Apr 02 2020
-
Scala
(1 to 80).map{n: Int => new java.math.BigInteger(((2 to (2 * n) by 2).map(.toString)).mkString("")).toString.length} // _Alonso del Arte, Mar 12 2020
Formula
a(n) = Sum_{i=1..n} (1+floor(log_10(2*i))). - Robert Israel, Apr 05 2020
Comments