reviewed
approved
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”).
reviewed
approved
proposed
reviewed
editing
proposed
(Python)
from itertools import chain, count, islice
def altgen(seed, digits):
allowed = "02468" if seed in "13579" else "13579"
if digits == 1: yield from allowed; return
for f in allowed: yield from (f + r for r in altgen(f, digits-1))
def agen(): yield from chain(range(10), (int(f+r) for d in count(2) for f in "123456789" for r in altgen(f, d-1)))
print(list(islice(agen(), 65))) # Michael S. Branicky, Jul 12 2022
approved
editing
proposed
approved
editing
proposed
(Python)
from itertools import count
def A030141_gen(startvalue=0): # generator of terms >= startvalue
return filter(lambda n:all(int(a)+int(b)&1 for a, b in zip(str(n), str(n)[1:])), count(max(startvalue, 0)))
A030141_list = list(islice(A030141_gen(), 30)) # Chai Wah Wu, Jul 12 2022
reviewed
editing
proposed
reviewed
editing
proposed
(Python)
from itertools import count, islice, accumulate
def A030141_gen(startvalue=0): # generator of terms >= startvalue
return filter(lambda n:all(map(lambda n:n&1, islice(accumulate(int(d) for d in str(n)), 1, None))), count(max(startvalue, 0)))
A030141_list = list(islice(A030141_gen(), 30)) # Chai Wah Wu, Jul 11 2022
proposed
editing