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.

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

This page as a plain text file.
%I A375328 #9 Aug 16 2024 21:06:20
%S A375328 2,3,0,5,7,1,23,13,20,37,17,21,53,43,24,73,47,26,229,239,22,67,29,25,
%T A375328 83,31,27,97,59,32,127,137,4,251,271,33,157,173,6,331,359,35,433,457,
%U A375328 8,379,521,52,653,673,9,571,739,55,677,823,12,71,751,57,827,853,15,79,2203,28,2207,263,30,2213,283,34,2243
%N A375328 Terms as well as digits fit the prime/prime/nonprime pattern; this is the lexicographically earliest injective sequence with this property.
%H A375328 Michael S. Branicky, <a href="/A375328/b375328.txt">Table of n, a(n) for n = 1..10000</a>
%e A375328 a(4) = 5, a(5) = 7, a(6) = 1, a(7) = 23, a(8) = 13, a(9) = 20; we see that a(4), a(5), a(7) and a(8) are primes and that a(6) and a(9) are nonprimes. The digits involved fit the pattern prime/prime/nonprime too; they are 5,7,1,2,3,1,3,2 and 0.
%o A375328 (Python)
%o A375328 from sympy import isprime
%o A375328 from itertools import count, islice, product
%o A375328 def bgen(i): # generates terms with p/p/np, p/np/p, or np/p/p digits
%o A375328     digs = ["014689", "2357"]
%o A375328     for digits in count(1):
%o A375328         patt = [digs[(i+j)%3 < 2] for j in range(digits)]
%o A375328         yield from (int("".join(s)) for s in product(*patt) if digits==1 or s[0]!="0")
%o A375328 def agen(): # generator of terms
%o A375328     seen, s = set(), 0
%o A375328     for n in count(1):
%o A375328         p = (n-1)%3 < 2
%o A375328         an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
%o A375328         yield an
%o A375328         seen.add(an)
%o A375328         s += len(str(an))
%o A375328 print(list(islice(agen(), 99))) # _Michael S. Branicky_, Aug 13 2024
%Y A375328 Cf. A217555, A375326, A375327.
%K A375328 base,nonn
%O A375328 1,1
%A A375328 _Eric Angelini_ and _Jean-Marc Falcoz_, Aug 13 2024