OFFSET
1,2
COMMENTS
There are 9*5^(n-1) n-digit terms, hence a(n) << n^k with k = log 5/log 10 = 0.69897.... - Charles R Greathouse IV, May 12 2014
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
100 is not in the sequence since 100 is even but has 2 even digits (both the second and third digits).
998 is in the sequence since 998 is even and the only even digit is the final digit.
MAPLE
N:= 3: # for terms of up to N digits
fodd:= proc(t) local i; seq(10*t+i, i=1..9, 2) end proc:
feven:= proc(t) local i; seq(10*t+i, i=0..8, 2) end proc:
feven(0):= (2, 4, 6, 8):
A[0]:= [0]:
B[0]:= [0]:
for d from 1 to N-1 do
A[d]:= map(feven, A[d-1]);
B[d]:= map(fodd, B[d-1]);
od:
R:= NULL:
for i from 0 to N-1 do
R:= R, op(map(fodd, A[i])),
op(map(feven, B[i]))
od:
sort([R]); # Robert Israel, Sep 09 2024
PROG
(Python)
def ok(n): return set(str(n)[:-1]) & set(["02468", "13579"][n&1]) == set()
print([k for k in range(1, 140) if ok(k)]) # Michael S. Branicky, Sep 09 2024
CROSSREFS
KEYWORD
AUTHOR
J. Lowell, May 12 2014
STATUS
approved