cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A382621 Lexicographically earliest sequence of distinct positive integers such that if a digit d in the digit stream (ignoring commas) is even, the previous digit is > d.

This page as a plain text file.
%I A382621 #21 May 13 2025 11:34:18
%S A382621 1,3,2,5,4,7,6,9,8,10,11,13,15,17,19,20,30,31,32,33,21,35,23,25,27,29,
%T A382621 37,39,40,50,51,52,53,54,55,41,57,42,59,43,70,71,72,73,74,75,45,47,49,
%U A382621 60,76,77,61,79,62,90,91,92,93,94,95,96,97,63,98,64,99,65,101,103
%N A382621 Lexicographically earliest sequence of distinct positive integers such that if a digit d in the digit stream (ignoring commas) is even, the previous digit is > d.
%C A382621 Could be summarized as "even digit, previous bigger". A variant of A342042.
%H A382621 Paolo Xausa, <a href="/A382621/b382621.txt">Table of n, a(n) for n = 1..10000</a>
%H A382621 Paolo Xausa, <a href="/A382621/a382621_1.png">Color scatterplot of the first 100000 terms</a>
%t A382621 A382621list[nmax_] := Module[{a, s, invQ, fu = 2},
%t A382621   invQ[k_] := invQ[k] = (If[#, s[k] = #]; #) & [MemberQ[Partition[IntegerDigits[k], 2, 1], {i_, j_?EvenQ} /; i <= j]];
%t A382621   s[_] := False; s[1] = True;
%t A382621   NestList[(a = fu; While[s[a] || invQ[a] || invQ[# + First[IntegerDigits[a]]], a++] & [Max[Mod[#, 10], 1]*10]; While[s[fu], fu++]; s[a] = True; a) &, 1, nmax - 1]];
%t A382621 A382621list[100]
%o A382621 (Python)
%o A382621 from itertools import count, islice
%o A382621 def cond(s):
%o A382621     return all(s[i+1] < s[i] for i in range(len(s)-1) if s[i+1] in "02468")
%o A382621 def agen(): # generator of terms
%o A382621     an, seen, s, m = 1, {1}, "1", 2
%o A382621     while True:
%o A382621         yield an
%o A382621         an = next(k for k in count(m) if k not in seen and cond(s[-1]+str(k)))
%o A382621         seen.add(an); s += str(an)
%o A382621         while m in seen or not cond(str(m)): m += 1
%o A382621 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Apr 03 2025
%Y A382621 Cf. A342042, A382462, A382622, A382623, A382624, A382625.
%K A382621 nonn,base,look
%O A382621 1,2
%A A382621 _Paolo Xausa_, Apr 01 2025