login
A339715
Numbers with equal number of even and odd digits such that the product a(n) * a(n+1) has an equal number of even and odd digits too.
1
12, 92, 16, 67, 21, 49, 25, 41, 30, 38, 29, 43, 36, 47, 23, 61, 18, 72, 27, 54, 32, 58, 52, 34, 50, 65, 45, 63, 56, 70, 74, 14, 78, 69, 85, 90, 81, 76, 94, 87, 83, 96, 1047, 9562, 89, 1128, 98, 1036, 9667, 1041, 9618, 1058, 9461, 1061, 9432, 1074, 9340, 1083, 9243, 1087, 9205, 1090, 9203, 1100, 9201
OFFSET
1,1
COMMENTS
Lexicographically earliest sequence of distinct positive terms with this property.
Numbers with an odd digit length cannot be in this sequence.
EXAMPLE
a(1) * a(2) = 12 * 92 = 1104 (which has an equal number of even and odd digits);
a(2) * a(3) = 92 * 16 = 1472 (idem);
a(3) * a(4) = 16 * 67 = 1072 (idem);
a(4) * a(5) = 67 * 21 = 1407 (idem); etc.
PROG
(Python)
def cond(i):
stri = str(i)
se = sum(1 for d in stri if d in "02468")
so = sum(1 for d in stri if d in "13579")
return se == so
def aupto(nn):
alst, used = [1], set()
for n in range(1, nn+1):
an = 12
while True:
while an in used: an += 1
if cond(an) and cond(an * alst[-1]):
alst.append(an); used.add(an); break
an += 1
return alst[1:] # use alst[n] for a(n)
print(aupto(59)) # Michael S. Branicky, Dec 14 2020
CROSSREFS
Cf. A339714 (same idea, replacing multiplication by addition), A227870 (numbers with equal number of even and odd digits).
Sequence in context: A004311 A160869 A026074 * A298397 A246585 A120990
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Dec 14 2020
STATUS
approved