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.

This page as a plain text file.
%I A369515 #25 Feb 04 2024 18:25:29
%S A369515 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,
%T A369515 12,33,46,41,43,58,39,18,20,51,62,47,53,74,57,28,16,44,69,82,59,61,86,
%U A369515 87,52,24,25,68,93,94,67,71,106,111,76,35,30,55,92,123,118
%N 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.
%C A369515 The sequence is a permutation of the nonnegative integers.
%e A369515 a(0)=0, a(1)=1, followed by triangle read by rows:
%e A369515                    |2|
%e A369515                |3| | | |5 |
%e A369515           |7 | | | |4| |  | |11|
%e A369515      |13| |  | |6| | | |10| |  | |17|
%e A369515 |19| |  | |14| | | |8| |  | |22| |  | |23|
%e A369515 Row 5, element 3 = 8, because 2*3=6 has already appeared, but 2*4=8 has not.
%o A369515 (Python)
%o A369515 from sympy.ntheory.generate import prime
%o A369515 from math import ceil
%o A369515 def get_column_tops(n):
%o A369515     return [1 + abs((n-1)-2*m) for m in range(1,n-1)]
%o A369515 def get_indices(rowNum):
%o A369515   left=(rowNum*(rowNum-1))//2
%o A369515   right=left+rowNum-1
%o A369515   return (left, right)
%o A369515 def get_least(m,seq):
%o A369515   mult=2
%o A369515   d=m*mult
%o A369515   while d in seq:
%o A369515     mult+=1
%o A369515     d=m*mult
%o A369515   return d
%o A369515 seq,rnum = ([],1)
%o A369515 while len(seq)<56:
%o A369515   seq.append(prime(rnum+max(0,rnum-2)))
%o A369515   cols = get_column_tops(rnum)
%o A369515   for k in range(len(cols)):
%o A369515       ndcs=get_indices(cols[k])
%o A369515       if k<ceil(len(cols)/2):
%o A369515         m=seq[ndcs[0]]
%o A369515         seq.append(get_least(m,seq))
%o A369515       else:
%o A369515         m=seq[ndcs[1]]
%o A369515         seq.append(get_least(m,seq))
%o A369515   if rnum > 1:
%o A369515     seq.append(prime(2*rnum-1))
%o A369515   rnum+=1
%o A369515 seq=[0,1]+seq
%o A369515 print(seq)
%Y A369515 Cf. A143182.
%K A369515 nonn,tabl
%O A369515 0,3
%A A369515 _J. Stauduhar_, Jan 25 2024