login
Numbers in which 2 outnumbers all other digits together.
9

%I #17 Feb 22 2021 09:14:44

%S 2,22,122,202,212,220,221,222,223,224,225,226,227,228,229,232,242,252,

%T 262,272,282,292,322,422,522,622,722,822,922,1222,2022,2122,2202,2212,

%U 2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2232,2242,2252,2262,2272,2282,2292,2322,2422,2522,2622,2722,2822,2922

%N Numbers in which 2 outnumbers all other digits together.

%C Subset of A292452.

%e 202 has more 2's than any other digit, whereas both 2002 and 2012 have as many other digits as 2's.

%t Select[Range[0, 3000], Total@ #1 < First@ #2 & @@ TakeDrop[RotateLeft[#, 2] &@ DigitCount@ #, 9] &] (* _Michael De Vlieger_, Sep 22 2017 *)

%o (Python)

%o def ok(n):

%o s=str(n); return s.count('2') > sum([0]+[s.count(d) for d in s if d!='2'])

%o print([m for m in range(2923) if ok(m)]) # _Michael S. Branicky_, Feb 22 2021

%Y Cf. A292449, A292450, A292451, A292452, A292453, A292454, A292455, A292456, A292457, A292458, A292730, A292731, A292733, A292734, A292735, A292736, A292737, A292738, A292739.

%K nonn,base,easy

%O 1,1

%A _Halfdan Skjerning_, Sep 22 2017