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.

A369515 Triangle of hexagons read by row, with right diagonal having in-order odd-indexed primes, left diagonal having 2 followed by the in-order even-indexed primes, and column elements are the least multiple of the prime at the top of the column not already in the sequence, with 0 and 1 prepended.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 4, 11, 13, 6, 10, 17, 19, 14, 8, 22, 23, 29, 26, 9, 15, 34, 31, 37, 38, 21, 12, 33, 46, 41, 43, 58, 39, 18, 20, 51, 62, 47, 53, 74, 57, 28, 16, 44, 69, 82, 59, 61, 86, 87, 52, 24, 25, 68, 93, 94, 67, 71, 106, 111, 76, 35, 30, 55, 92, 123, 118
Offset: 0

Views

Author

J. Stauduhar, Jan 25 2024

Keywords

Comments

The sequence is a permutation of the nonnegative integers.

Examples

			a(0)=0, a(1)=1, followed by triangle read by rows:
                   |2|
               |3| | | |5 |
          |7 | | | |4| |  | |11|
     |13| |  | |6| | | |10| |  | |17|
|19| |  | |14| | | |8| |  | |22| |  | |23|
Row 5, element 3 = 8, because 2*3=6 has already appeared, but 2*4=8 has not.
		

Crossrefs

Cf. A143182.

Programs

  • Python
    from sympy.ntheory.generate import prime
    from math import ceil
    def get_column_tops(n):
        return [1 + abs((n-1)-2*m) for m in range(1,n-1)]
    def get_indices(rowNum):
      left=(rowNum*(rowNum-1))//2
      right=left+rowNum-1
      return (left, right)
    def get_least(m,seq):
      mult=2
      d=m*mult
      while d in seq:
        mult+=1
        d=m*mult
      return d
    seq,rnum = ([],1)
    while len(seq)<56:
      seq.append(prime(rnum+max(0,rnum-2)))
      cols = get_column_tops(rnum)
      for k in range(len(cols)):
          ndcs=get_indices(cols[k])
          if k 1:
        seq.append(prime(2*rnum-1))
      rnum+=1
    seq=[0,1]+seq
    print(seq)