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 A376076 #36 Nov 06 2024 04:33:46 %S A376076 2,2,2,3,1,3,2,3,3,3,5,1,3,5,2,5,5,3,5,7,5,1,5,7,7,3,5,7,7,5,5,7,7,7, %T A376076 5,7,11,7,1,5,7,11,11,3,5,7,13,11,3,1,5,7,13,13,3,3,5,11,13,13,5,5,5, %U A376076 11,17,13,5,5,1,5,11,19,13,7,7,1,1,5,11,19,13,7,7,1,2,5,11,23,17,7,7,2,2,1 %N A376076 A variant of the inventory sequence which only counts prime numbers and only allows the values in the sequence to be 0, 1, or a prime number. %C A376076 The sequence starts with the seed [2, 2]. %C A376076 Construction is similar to A347317 except using only prime numbers. Each row ends after counting the highest prime that has occurred in the sequence so far. %C A376076 When the number of 2's, 3's, 5's, p's is not a prime number, the sequence outputs the prime number closest to but less than the actual count. See example below. %C A376076 Allowing 0 and 1 in the series is necessary as some primes enter the series before earlier primes. For example, generate the sequence using the example provided below and note on row 47 where 61 appears before 59 in the sequence, approximately the 391st element of the sequence. The effect becomes very clear after generating about 110 rows of data and only gets greater from there, given the overall tendency for increasing gaps between prime numbers. %C A376076 Related sequences could be generated using different seed strings. Interestingly starting with the seed [3, 3] produces an irregular triangle of similar shape to [2, 2]. This does not seem to occur with 5, 5. %C A376076 Testing further pairs of primes [p,p] as seeds reveals a subsequence of primes 11,17,29,41,59,71,101,107... that all form a similarly shaped irregular triangle after a trivial amount of 'count up' rows. This can be seen by comparing the row lengths of each pair of primes seed. %C A376076 It appears that when any of these subsequence values are used as a pair of primes seed that sequence will never include any of the subsequence values. For example, using seed [11,11] the count of 2's skips values 11,17,29,41,59,71,101,107... The same is true if the seed [17,17], or any of the other subsequence values, are used. %H A376076 Anthony B Lara, <a href="/A376076/b376076.txt">Table of n, a(n) for n = 1..19538</a> %e A376076 The sequence can be thought of as a row by row counting of prime occurrences with each column relating to a specific prime number, given the first two seed rows of 2 and 2. %e A376076 As an irregular triangle this begins: %e A376076 Row1: 2 (seed) %e A376076 Row2: 2 (seed) %e A376076 Row3: 2 %e A376076 Row4: 3 1 %e A376076 Row5: 3 2 %e A376076 Row6: 3 3 %e A376076 Row7: 3 5 1 %e A376076 Row8: 3 5 2 %e A376076 Row9: 5 5 3 %e A376076 Note in Row8 how the number of 3's that have occurred so far is actually 6, but the rules of the sequence dictate outputting the nearest prime less than the count which is 5. %o A376076 (Python) %o A376076 from itertools import islice %o A376076 from collections import Counter %o A376076 from sympy import isprime, nextprime, prevprime %o A376076 def agen(verbose=False): # generator of terms; verbose=True prints rows %o A376076 seed, bigp = [2, 2], 2 %o A376076 c = Counter(seed) %o A376076 yield from seed %o A376076 if verbose: [print(k, end=",\n") for k in seed] %o A376076 while True: %o A376076 p = 2 %o A376076 while p <= bigp: %o A376076 cp = c[p] %o A376076 if cp > 2 and not isprime(cp): cp = prevprime(cp) %o A376076 if cp > bigp: bigp = cp %o A376076 yield cp %o A376076 if verbose: print(cp, end=", ") %o A376076 c[cp] += 1 %o A376076 p = nextprime(p) %o A376076 if verbose: print() %o A376076 print(list(islice(agen(), 94))) # _Michael S. Branicky_, Sep 10 2024 %Y A376076 Cf. A347317. %K A376076 nonn,base,tabf %O A376076 1,1 %A A376076 _Anthony B Lara_, Sep 08 2024