OFFSET
1,2
COMMENTS
Like the converse of A333369.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
181 is a 3-digit term because it has two 1's and one 8.
MAPLE
filter:= proc(n) local L;
L:= map(rhs-lhs, Statistics:-Tally(convert(n, base, 10)));
andmap(type, L, odd)
end proc:
select(filter, [$0..1000]); # Robert Israel, Jul 31 2024
MATHEMATICA
q[n_] := AllTrue[Tally @ IntegerDigits[n], OddQ[Plus @@ #] &]; Select[Range[0, 300], q] (* Amiram Eldar, Apr 15 2022 *)
PROG
(PARI) isok(m) = my(d=digits(m), s=Set(d)); for (i=1, #s, if (#select(x->(x==s[i]), d) % 2 == (s[i] % 2), return (0))); return (1); \\ Michel Marcus, Apr 15 2022
(Python)
def ok(n): s = str(n); return all(s.count(d)%2 != int(d)%2 for d in set(s))
print([k for k in range(335) if ok(k)]) # Michael S. Branicky, Apr 15 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Apr 15 2022
STATUS
approved