login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A098160
Numbers n with property that when writing down all the natural numbers from 0 to n one uses the same number of even and odd digits.
0
1, 3, 5, 7, 9, 10, 28, 29, 30, 48, 49, 50, 68, 69, 70, 88, 89, 90
OFFSET
1,2
COMMENTS
The sequence seems to stop at 90.
EXAMPLE
[0,1,2,3,4,5,6,7,8,9,10] uses 6 even digits and 6 odd digits.
MATHEMATICA
f[n_] := Block[{id = Mod[ Flatten[ Table[ IntegerDigits[i], {i, 0, n}]], 2]}, Length[id] - 2Plus @@ id]; Select[ Range[ 100], f[ # ] == 0 &] (* Robert G. Wilson v, Nov 03 2004 *)
sneoQ[n_]:=Module[{d=Flatten[IntegerDigits/@Range[0, n]]}, 2*Count[ d, _?OddQ] == Length[d]]; Select[Range[100], sneoQ] (* Harvey P. Dale, Jul 31 2017 *)
CROSSREFS
Sequence in context: A066929 A173909 A165249 * A371215 A103701 A206544
KEYWORD
base,easy,nonn,fini,full
AUTHOR
Eric Angelini, Oct 25 2004
STATUS
approved