login
Numbers with an even number of digits.
12

%I #29 Nov 11 2022 08:07:53

%S 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,

%T 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,

%U 56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,1000,1001

%N Numbers with an even number of digits.

%C The lower and upper asymptotic densities of this sequence are 1/11 and 10/11, respectively. - _Amiram Eldar_, Feb 01 2021

%H T. D. Noe, <a href="/A001637/b001637.txt">Table of n, a(n) for n = 1..1000</a>

%F A055642(a(n)) mod 2 = 0. - _Reinhard Zumkeller_, Jul 14 2014

%F a(n) = n + (100^floor(log_100(110*n)) - 1)/11. - _Kevin Ryde_, Nov 10 2022

%t Select[Range[0, 1001], EvenQ[Length[IntegerDigits[#]]] &] (* _T. D. Noe_, Aug 09 2012 *)

%o (Haskell)

%o a001637 n = a001637_list !! (n-1)

%o a001637_list = filter (even . a055642) [0..]

%o -- _Reinhard Zumkeller_, Jul 14 2014

%o (PARI) is(n)=#Str(n)%2==0 \\ _Charles R Greathouse IV_, Nov 26 2018

%o (PARI) a(n) = n + 100^logint(110*n,100) \ 11; \\ _Kevin Ryde_, Nov 10 2022

%o (Python)

%o def a(n): return n + (100**((len(str(110*n))-1)//2) - 1)//11

%o print([a(n) for n in range(1, 100)]) # _Michael S. Branicky_, Nov 10 2022 after _Kevin Ryde_

%Y Cf. A001633 (complement), A055642.

%K nonn,base,easy

%O 1,1

%A _N. J. A. Sloane_