A098948 Numbers where 7 is the only odd decimal digit.
7, 27, 47, 67, 70, 72, 74, 76, 77, 78, 87, 207, 227, 247, 267, 270, 272, 274, 276, 277, 278, 287, 407, 427, 447, 467, 470, 472, 474, 476, 477, 478, 487, 607, 627, 647, 667, 670, 672, 674, 676, 677, 678, 687, 700, 702, 704, 706, 707, 708, 720, 722, 724, 726
Offset: 1
Programs
-
Maple
q:= n-> is(select(c-> c::odd, {convert(n, base, 10)[]})={7}): select(q, [$1..887])[]; # Alois P. Heinz, Jul 27 2021
-
Mathematica
Select[Range[1000],Union[Select[IntegerDigits[#],OddQ]]=={7}&] (* Harvey P. Dale, May 24 2012 *)
-
Perl
for (0..1000) { print "$_, " if (/^[024678]*7[024678]*$/) } # Charles R Greathouse IV, Oct 05 2011
-
Python
def ok(n): return set("13579") & set(str(n)) == {'7'} print(list(filter(ok, range(727)))) # Michael S. Branicky, Jul 27 2021
Comments