login
Triangle read by rows, where row n contains the n smallest available numbers of primality opposite to that of n, subject to the restriction that in the whole triangle each number k can be used only k times.
3

%I #25 Jan 02 2023 12:30:51

%S 2,1,4,4,6,8,2,3,5,7,4,6,8,9,10,3,5,7,11,13,17,4,6,8,9,10,12,14,3,5,7,

%T 11,13,17,19,23,5,7,11,13,17,19,23,29,31,5,7,11,13,17,19,23,29,31,37,

%U 6,8,9,10,12,14,15,16,18,20,21,7,11,13,17,19,23,29,31,37,41,43,47,6,8,9,10,12,14,15,16,18,20,21,22,24,7,11,13,17,19,23,29,31,37,41,43,47,53,59,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67

%N Triangle read by rows, where row n contains the n smallest available numbers of primality opposite to that of n, subject to the restriction that in the whole triangle each number k can be used only k times.

%C If n is prime the entries in row n must be nonprimes, and vice versa.

%C The sequence can be interpreted as a graph, see Eric Angelini's post to the SeqFan list.

%H Alois P. Heinz, <a href="/A261297/b261297.txt">Rows n = 1..200, flattened</a>

%H E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2015-September/015293.html">Vertices, edges, primes and non-primes</a>, SeqFan list, Sept. 16, 2015.

%e The table starts:

%e row: data T(n,k); k=1..n

%e 1: [2]

%e 2: [1, 4]

%e 3: [4, 6, 8]

%e 4: [2, 3, 5, 7]

%e 5: [4, 6, 8, 9, 10]

%e 6: [3, 5, 7, 11, 13, 17]

%e 7: [4, 6, 8, 9, 10, 12, 14]

%e 8: [3, 5, 7, 11, 13, 17, 19, 23]

%e 9: [5, 7, 11, 13, 17, 19, 23, 29, 31]

%e 10: [5, 7, 11, 13, 17, 19, 23, 29, 31, 37]

%e 11: [6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21]

%e 12: [7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]

%e 13: [6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24]

%e 14: [7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]

%o (PARI) {c=[[1,0]]; for(n=1,20, while(#c>1 && c[1][1]==c[1][2], c=c[2..-1]); r=[]; j=0; while(#r<n, j++>#c && c=concat(c,[[c[#c][1]+1,0]]); isprime(n)!=isprime(c[j][1]) && c[j][2]<c[j][1] && c[j][2]++ && r=concat(r,c[j][1]));print(r))}

%Y Cf. A261298: main diagonal T(n,n).

%Y Cf. A000040: primes, A018252: nonprimes.

%Y Column k=1 gives A261211.

%K nonn,tabl,look

%O 1,1

%A _M. F. Hasler_, Sep 16 2015