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.

A374233 Irregular triangle read by rows where row n lists the primes containing at least one digit not seen in any smaller prime in base n, for n >= 2.

Original entry on oeis.org

2, 2, 3, 2, 3, 5, 17, 2, 3, 5, 19, 2, 3, 5, 7, 29, 37, 2, 3, 5, 7, 11, 13, 2, 3, 5, 7, 11, 37, 53, 67, 2, 3, 5, 7, 11, 13, 17, 59, 83, 2, 3, 5, 7, 11, 19, 41, 61, 83, 101, 2, 3, 5, 7, 11, 17, 19, 31, 37, 43, 2, 3, 5, 7, 11, 13, 53, 73, 97, 109, 127, 149
Offset: 2

Views

Author

Nicolas Bělohoubek, Jul 01 2024

Keywords

Examples

			Row n=4 is 2, 3, 5, 17, which is 2_4, 3_4, 11_4, 101_4.
First few rows:
       k=1  2  3   4   5   6   7   8
  n=2:  [2],
  n=3:  [2, 3],
  n=4:  [2, 3, 5, 17],
  n=5:  [2, 3, 5, 19],
  n=6:  [2, 3, 5,  7, 29, 37],
  n=7:  [2, 3, 5,  7, 11, 13],
  n=8:  [2, 3, 5,  7, 11, 37, 53, 67],
  ...
		

Crossrefs

Cf. A033274.

Programs

  • PARI
    isok(d, digs) = for (i=1, #d, if (!vecsearch(digs, d[i]), return(1)));
    row(n) = my(digs=List(), v=List()); forprime(p=2, , my(d = digits(p, n)); if (isok(d, Vec(digs)), listput(v, p); for (i=1, #d, listput(digs, d[i])); listsort(digs, 1); if (#digs == n, return(Vec(v))););); \\ Michel Marcus, Jul 02 2024
  • Python
    from sympy.ntheory import digits, nextprime
    def row(n):
        if n == 2: return [2]
        p, r, used = 2, [2], {2}
        while len(used) < n:
            while (ds:=set(digits(p:=nextprime(p), n)[1:])) <= used: pass
            r.append(p)
            used |= ds
        return r
    print([an for b in range(2, 13) for an in row(b)]) # Michael S. Branicky, Jul 01 2024