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.

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

This page as a plain text file.
%I A375327 #8 Aug 16 2024 21:05:40
%S A375327 0,1,2,4,6,3,8,9,5,10,20,13,14,21,17,16,24,43,18,26,47,40,28,67,44,30,
%T A375327 83,46,34,97,48,36,131,12,49,7,60,38,139,15,64,29,42,66,31,45,68,59,
%U A375327 62,69,71,63,80,79,65,81,211,39,82,11,50,85,19,51,87,41,54,92,61,56,93,89,58,95,103,84,70,151,120
%N A375327 Terms as well as digits fit the nonprime/nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.
%H A375327 Michael S. Branicky, <a href="/A375327/b375327.txt">Table of n, a(n) for n = 1..10000</a>
%e A375327 a(9) = 5, a(10) = 10, a(11) = 20, a(12) = 13, a(13) = 14, a(14) = 21 ; we see that a(9) and a(12) are primes and that a(10), a(11), a(13); and a(14) are nonprimes. The digits involved fit the pattern nonprime/nonprime/prime too; they are 5,1,0,2,0,1,3,1,4,2 and 1.
%o A375327 (Python)
%o A375327 from sympy import isprime
%o A375327 from itertools import count, islice, product
%o A375327 def bgen(i): # generates terms with np/np/p, np/p/np, or p/np/np digits
%o A375327     digs = ["014689", "2357"]
%o A375327     for digits in count(1):
%o A375327         patt = [digs[(i+j)%3 == 2] for j in range(digits)]
%o A375327         yield from (int("".join(s)) for s in product(*patt) if digits==1 or s[0]!="0")
%o A375327 def agen(): # generator of terms
%o A375327     seen, s = set(), 0
%o A375327     for n in count(1):
%o A375327         p = (n-1)%3 == 2
%o A375327         an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
%o A375327         yield an
%o A375327         seen.add(an)
%o A375327         s += len(str(an))
%o A375327 print(list(islice(agen(), 99))) # _Michael S. Branicky_, Aug 13 2024
%Y A375327 Cf. A217555, A375326, A375328.
%K A375327 base,nonn
%O A375327 1,3
%A A375327 _Eric Angelini_ and _Jean-Marc Falcoz_, Aug 13 2024