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.
%I A367735 #49 Feb 05 2024 18:29:39 %S A367735 1201,1213,1217,1301,1303,1307,1319,1327,1409,1423,1427,1429,1439, %T A367735 1523,1549,1601,1607,1609,1613,1619,1627,1637,1657,1709,1723,1747, %U A367735 1759,1801,1823,1847,1867,1879,1901,1907,1913,1949,1979,2309,2417,2423,2437,2503,2539 %N A367735 Prime numbers wherein digit values increase, decrease, and finally increase. %C A367735 Terms must have at least 4 digits. %C A367735 There are 3287310 terms, with the last being 1245678987653210123456789. - _Michael S. Branicky_, Jan 26 2024 %H A367735 Alois P. Heinz, <a href="/A367735/b367735.txt">Table of n, a(n) for n = 1..10000</a> %H A367735 Michael S. Branicky, <a href="/A367735/a367735.txt">Python program producing full sequence</a> %H A367735 James S. DeArmon, <a href="/A367735/a367735_1.txt">Python program for A367735</a> %e A367735 The first term is 1201: increases 1-2, decreases 2-0, then increases 0-1. An example 7-digit term is 1215679. %p A367735 q:= proc(n) local i, l, s; %p A367735 l, s:= convert(n, base, 10), 1; %p A367735 for i to nops(l)-1 while s<5 do s:= %p A367735 `if`(l[i]=l[i+1], 5, %p A367735 `if`(l[i]>l[i+1], [2$2, 4$2][s], [5, 3$2, 5][s])) %p A367735 od; is(s=4) %p A367735 end: %p A367735 select(isprime and q, [$1..15000])[]; # _Alois P. Heinz_, Jan 26 2024 %o A367735 (Python) %o A367735 from sympy import isprime %o A367735 from itertools import combinations, islice %o A367735 def agen(): # generator of terms %o A367735 for d in range(4, 28): %o A367735 print(d) %o A367735 passed = set() %o A367735 for d1 in range(2, min(d-2, 9)+1): %o A367735 for c1 in combinations("123456789", d1): %o A367735 for d2 in range(1, min(d-d1-1, 10)+1): %o A367735 digits2 = list(map(str, range(int(c1[-1])-1, -1, -1))) %o A367735 for c2 in combinations(digits2, d2): %o A367735 digits3 = list(map(str, range(int(c2[-1])+1, 11))) %o A367735 for c3 in combinations(digits3, d - d1 - d2): %o A367735 t = int("".join(c1 + c2 + c3)) %o A367735 if isprime(t): %o A367735 passed.add(t) %o A367735 yield from sorted(passed) %o A367735 print(list(islice(agen(), 63))) # _Michael S. Branicky_, Jan 26 2024 %Y A367735 Cf. A062351, A062352, A156116. %K A367735 nonn,base,fini %O A367735 1,1 %A A367735 _James S. DeArmon_, Jan 24 2024