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.

A359298 Array T(n, k) read by antidiagonals: for n >= 0 and k >= 0, row n lists the positive integers m such that m - k is prime or 1, and m - h, for 0 <= h < k, is not prime.

This page as a plain text file.
%I A359298 #12 Jan 08 2023 11:43:44
%S A359298 1,2,4,3,6,9,5,8,15,10,7,12,21,16,27,11,14,25,22,35,28,13,18,33,26,51,
%T A359298 36,95,17,20,39,34,57,52,119,96,19,24,45,40,65,58,145,120,121,23,30,
%U A359298 49,46,77,66,187,146,147,122,29,32,55,50,87,78,205,188,189
%N A359298 Array T(n, k) read by antidiagonals: for n >= 0 and k >= 0, row n lists the positive integers m such that m - k is prime or 1, and m - h, for 0 <= h < k, is not prime.
%C A359298 Essentially, for n >= 0, row n lists the numbers whose distance down to the nearest prime is n.
%e A359298 Corner:
%e A359298    1     2     3     5     7    11    13    17     19     23     29
%e A359298    4     6     8    12    14    18    20    24     30     32     38
%e A359298    9    15    21    25    33    39    45    49     55     63     69
%e A359298   10    16    22    26    34    40    46    50     56     64     70
%e A359298   27    35    51    57    65    77    87    93    117    135    143
%e A359298   28    36    52    58    66    78    88    94    118    136    144
%e A359298 Row 0 includes 19 because 19 is prime, and 19 - 19 = 0.
%e A359298 Row 1 includes 8 because the nearest prime down from 8 is 7, and 8 - 7 = 1.
%t A359298 rows = 15;
%t A359298 row[0] = Join[{1}, Map[Prime, Range[250]]];
%t A359298 Table[row[z] = Map[#[[1]] &, Select[Map[{#, Apply[And,
%t A359298 Join[{MemberQ[row[0], # - z]}, Table[! MemberQ[row[0], # - k], {k, 0, z - 1}]]]} &, Range[Max[row[z - 1]]]], #[[2]] &]], {z, rows}];
%t A359298 Table[row[z], {z, 0, rows}] // ColumnForm  (* A359298 array *)
%t A359298 t[n_, k_] := row[n - 1][[k]];
%t A359298 u = Table[t[n - k + 1, k], {n, 15}, {k, n, 1, -1}] //
%t A359298 Flatten  (* A359298 sequence *)
%t A359298 (* _Peter J. C. Moses_ Dec 18 2022 *)
%Y A359298 Cf. A000040, A008578, A359299, A359300.
%K A359298 nonn,tabl
%O A359298 1,2
%A A359298 _Clark Kimberling_, Jan 01 2023