OFFSET
0,5
COMMENTS
LINKS
FORMULA
T(n,k) = A007918(T(n-1,k) + T(n-1,k-1)), 0 < k < n, T(n,0) = T(n,n) = 1.
EXAMPLE
0: 1
1: 1 1
2: 1 2 1
3: 1 3 3 1
4: 1 5 7 5 1
5: 1 7 13 13 7 1
6: 1 11 23 29 23 11 1
7: 1 13 37 53 53 37 13 1
8: 1 17 53 97 107 97 53 17 1
primes in 8th row:
T(7,0) + T(7,1) = 1+13 = 14 --> T(8,1) = T(8,7) = 19;
T(7,1) + T(7,2) = 13+37 = 50 --> T(8,2) = T(8,6) = 53, already in row 7;
T(7,2) + T(7,3) = 37+53 = 90 --> T(8,3) = T(8,5) = 97;
T(7,3) + T(7,4) = 53+53 = 106 --> T(8,4) = 107.
MATHEMATICA
T[n_, k_] := T[n, k] = Switch[k, 0|n, 1, _, With[{m = T[n-1, k] + T[n-1, k-1]}, If[PrimeQ[m], m, NextPrime[m]]]];
Table[T[n, k], {n, 0, 13}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 19 2021 *)
PROG
(Haskell)
a199333 n k = a199333_tabl !! n !! k
a199333_row n = a199333_tabl !! n
a199333_list = concat a199333_tabl
a199333_tabl = iterate
(\row -> map a159477 $ zipWith (+) ([0] ++ row) (row ++ [0])) [1]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Reinhard Zumkeller, Nov 09 2011
STATUS
approved