login
A039127
Numbers whose base-10 representation has the same number of 1's and 9's.
1
0, 2, 3, 4, 5, 6, 7, 8, 19, 20, 22, 23, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 37, 38, 40, 42, 43, 44, 45, 46, 47, 48, 50, 52, 53, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 67, 68, 70, 72, 73, 74, 75, 76, 77, 78, 80, 82, 83, 84, 85, 86, 87, 88, 91, 109, 129, 139
OFFSET
1,2
COMMENTS
A k-digit number is in the sequence with probability ~ 1/sqrt(2*Pi*k/5). - Charles R Greathouse IV, Feb 19 2014
The number of d-digits positive terms is given by 7*8^(d-1)+ 7*sum(k=1,..,floor((d-1)/2), 8^(d-1-2*k) (k, k, d-1-2*k)!) + 2*sum(k=1,..,floor(d/2), 8^(d-2*k) (k, k-1, d-2*k)!), where (x,y,z)! = (x+y+z)!/(x! y! z!) denotes a multinomial coefficient. (* Giovanni Resta, Feb 22 2014 *)
LINKS
MATHEMATICA
Select[Range[0, 200], DigitCount[#, 10, 1]==DigitCount[#, 10, 9]&] (* Harvey P. Dale, Feb 19 2014 *)
PROG
(PARI) is(n)=my(v=digits(n)); sum(i=1, #v, if(v[i]==1, 1, if(v[i]==9, -1, 0)))==0 \\ Charles R Greathouse IV, Feb 19 2014
CROSSREFS
Sequence in context: A173577 A103205 A363490 * A024650 A037343 A366947
KEYWORD
nonn,base,easy
STATUS
approved