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.

A197124 Extract positive numbers from the infinite string of prime numbers 235711131719..., constructing the smallest numbers which have not appeared in an earlier extraction.

This page as a plain text file.
%I A197124 #24 Apr 01 2022 11:40:02
%S A197124 2,3,5,7,1,11,31,71,9,23,29,313,74,14,34,75,35,96,16,77,17,37,98,38,
%T A197124 99,710,110,310,7109,113,12,713,1137,13,91,4,915,115,716,316,717,317,
%U A197124 918,119,1193,19,719,92,112,232,27,22,923,32,39,24,125,1257,26
%N A197124 Extract positive numbers from the infinite string of prime numbers 235711131719..., constructing the smallest numbers which have not appeared in an earlier extraction.
%C A197124 The infinite stream of prime digits is basically chopped into slices such that each of the digits is used exactly once and the outcoming stream does not contain duplicates.
%H A197124 Paul Tek, <a href="/A197124/b197124.txt">Table of n, a(n) for n = 1..10000</a>
%e A197124 The initial digits 2, 3, 5, 7 and 1 are all extracted in the order of occurrence. The next 1 is rejected because it appeared earlier, and united with the (overall) third 1 to extract 11. The next 3 (from 13) appeared already earlier and is combined with the following 1 (from the 17) to created 31.
%t A197124 nn=100; digs = Flatten[Table[IntegerDigits[Prime[n]], {n, nn}]]; numList = {}; While[digs != {}, num = 0; While[num = num*10 + digs[[1]]; digs = Rest[digs]; newNum = ! MemberQ[numList, num]; (num == 0 || ! newNum) && digs != {}]; If[newNum, AppendTo[numList, num]]]; numList (* _T. D. Noe_, Oct 31 2011 *)
%o A197124 (Python)
%o A197124 from sympy import nextprime
%o A197124 from itertools import islice
%o A197124 def diggen():
%o A197124     p = 2
%o A197124     while True:
%o A197124         yield from list(map(int, str(p)))
%o A197124         p = nextprime(p)
%o A197124 def agen(): # generator of terms
%o A197124     g = diggen()
%o A197124     aset, nextd = set(), next(g)
%o A197124     while True:
%o A197124         an, nextd = nextd, next(g)
%o A197124         while an in aset or nextd == 0:
%o A197124             an, nextd = int(str(an) + str(nextd)), next(g)
%o A197124         yield an
%o A197124         aset.add(an)
%o A197124 print(list(islice(agen(), 80))) # _Michael S. Branicky_, Mar 31 2022
%Y A197124 Cf. A032759, A228595.
%K A197124 nonn,base
%O A197124 1,1
%A A197124 _Yves Debeuret_, Oct 10 2011