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.

A375326 Terms as well as digits fit the nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.

This page as a plain text file.
%I A375326 #11 Aug 12 2024 13:28:42
%S A375326 0,2,1,3,4,5,6,7,8,29,20,31,21,59,24,71,26,79,28,263,9,283,12,13,15,
%T A375326 17,42,43,45,47,62,67,63,83,65,97,82,131,30,293,85,139,34,307,87,151,
%U A375326 36,313,92,179,38,317,93,421,39,347,95,431,50,367,120,383,121,397,124,503,126,547,128,563,129,587,130
%N A375326 Terms as well as digits fit the nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.
%H A375326 Michael S. Branicky, <a href="/A375326/b375326.txt">Table of n, a(n) for n = 1..10000</a>
%e A375326 a(9) = 8, a(10) = 29, a(11) = 20, a(12) = 31; we see that a(9) and a(11) are nonprimes and that a(10) and a(12) are primes. The digits involved fit the pattern nonprime/prime too; they are 8, 2, 9, 2, 0, 3, 1.
%o A375326 (Python)
%o A375326 from sympy import isprime
%o A375326 from itertools import count, islice, product
%o A375326 def bgen(i): # generates terms with prime/nonprime or nonprime/prime digits
%o A375326     digs = ["014689", "2357"]
%o A375326     for digits in count(1):
%o A375326         patt = [digs[(i+j)&1] for j in range(digits)]
%o A375326         yield from (int("".join(s)) for s in product(*patt) if s[0]!="0")
%o A375326 def agen(): # generator of terms
%o A375326     seen, s, an = {0, 2}, 2, 2
%o A375326     yield from [0, 2]
%o A375326     for n in count(3):
%o A375326         p = (n&1) == 0
%o A375326         an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
%o A375326         yield an
%o A375326         seen.add(an)
%o A375326         s += len(str(an))
%o A375326 print(list(islice(agen(), 99))) # _Michael S. Branicky_, Aug 12 2024
%Y A375326 Cf. A217555.
%K A375326 base,nonn
%O A375326 1,2
%A A375326 _Eric Angelini_ and _Jean-Marc Falcoz_, Aug 12 2024