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 A379403 #14 Jul 09 2025 05:07:41 %S A379403 1,2,5,3,7,20,4,9,26,23,6,13,39,71,48,8,15,60,93,80,49,10,25,76,137, %T A379403 94,89,96,11,28,79,156,140,95,204,133,12,30,92,187,157,199,241,356, %U A379403 242,14,32,113,230,198,236,271,512,457,243,16,45,118,260,233,268 %N A379403 Rectangular array, read by descending antidiagonals: the Type 1 runlength index array of A039702 (primes mod 4); see Comments. %C A379403 We begin with a definition of Type 1 runlength array, U(s), of a sequence s: %C A379403 Suppose s is a sequence (finite or infinite), and define rows of U(s) as follows: %C A379403 (row 0) = s %C A379403 (row 1) = sequence of 1st terms of runs in (row 0); c(1) = complement of (row 1) in (row 0) %C A379403 For n>=2, %C A379403 (row n) = sequence of 1st terms of runs in c(n-1); c(n) = complement of (row n) in (row n-1), %C A379403 where the process stops if and when c(n) is empty for some n. %C A379403 *** %C A379403 The corresponding Type 1 runlength index array, UI(s) is now contructed from U(s) in two steps: %C A379403 (1) Let U*(s) be the array obtaining by repeating the construction of U(s) using (n,s(n)) in place of s(n). %C A379403 (2) Then UI(s) results by retaining only n in U*. %C A379403 Thus, loosely speaking, (row n) of UI(s) shows the indices in s of the numbers in (row n) of U(s). %C A379403 The array UI(s) includes every positive integer exactly once. %C A379403 *** %C A379403 Regarding the present array, each row of U(s) splits an increasing sequence of primes according to remainder modulo 3; e.g., in row 2, the remainders of primes in positions 10,12,16,19,24,37 are 2,1,2,1,2,1,2,1, respectively. %e A379403 Corner: %e A379403 1 2 3 4 6 8 10 11 12 14 16 17 %e A379403 5 7 9 13 15 25 28 30 32 45 47 51 %e A379403 20 26 39 60 76 79 92 113 118 123 132 136 %e A379403 23 71 93 137 156 187 230 260 283 296 318 326 %e A379403 48 80 94 140 157 198 233 265 286 343 377 382 %e A379403 49 89 95 199 236 268 472 595 635 702 732 755 %e A379403 96 204 241 271 473 600 642 841 899 956 1120 1279 %e A379403 133 356 512 601 643 844 906 961 1129 1402 1440 1482 %e A379403 242 457 549 869 921 962 1220 1403 1567 1910 1946 2097 %e A379403 243 460 566 870 1223 1406 1570 1917 1947 2102 2336 2655 %e A379403 248 991 1242 1483 1745 2103 2367 2664 2981 3322 3440 3953 %e A379403 249 992 1247 1484 1750 2118 2368 2667 3042 3323 3455 3956 %e A379403 Starting with s = A039702, we have for U*(s): %e A379403 (row 1) = ((1,2), (2,3), (3,1), (4,3), (6,1), (8,3), (10,1), (11,3), ...) %e A379403 c(1) = ((5,3), (7,1), (9,3), (13,1), (15,3), (20,3), (23,3), (25,1), (26,1), ...) %e A379403 (row 2) = ((5,3), (7,1), (9,3), (13,1), (15,3), (25,1), (28,3), (30,1), (32,3), ...) %e A379403 c(2) = ((20,3), (23,3), (26,1), ...) %e A379403 (row 3) = ((20,3), (26,1), ...) %e A379403 so that UI(s) has %e A379403 (row 1) = (1,2,3,4,5,6,8,10,11, ...) %e A379403 (row 2) = (5,7,9,13,15,25, ...) %e A379403 (row 3) = (20,26,...) %t A379403 r[seq_] := seq[[Flatten[Position[Prepend[Differences[seq[[All, 1]]], 1], _?(# != 0 &)]], 2]]; %t A379403 row[0] = Mod[Prime[Range[4000]], 4];(* A039702 *) %t A379403 row[0] = Transpose[{#, Range[Length[#]]}] &[row[0]]; %t A379403 k = 0; Quiet[While[Head[row[k]] === List, row[k + 1] = row[0][[r[SortBy[Apply[Complement, %t A379403 Map[row[#] &, Range[0, k]]], #[[2]] &]]]]; k++]]; %t A379403 m = Map[Map[#[[2]] &, row[#]] &, Range[k - 1]]; %t A379403 p[n_] := Take[m[[n]], 12] %t A379403 t = Table[p[n], {n, 1, 12}] %t A379403 Grid[t] %t A379403 w[n_, k_] := t[[n]][[k]]; %t A379403 Table[w[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten %t A379403 (* _Peter J. C. Moses_, Dec 04 2024 *) %Y A379403 Cf. A039702, A379046, A379401, A379402, A379404. %K A379403 tabl,nonn %O A379403 1,2 %A A379403 _Clark Kimberling_, Jan 15 2025