login
Triangle read by rows: T(n,0) = T(n,n) = 2, 0 < k < n: T(n,k) = smallest prime not less than T(n-1,k) + T(n-1,k-1).
4

%I #44 Apr 07 2023 09:24:20

%S 2,2,2,2,5,2,2,7,7,2,2,11,17,11,2,2,13,29,29,13,2,2,17,43,59,43,17,2,

%T 2,19,61,103,103,61,19,2,2,23,83,167,211,167,83,23,2,2,29,107,251,379,

%U 379,251,107,29,2,2,31,137,359,631,761,631,359,137,31,2

%N Triangle read by rows: T(n,0) = T(n,n) = 2, 0 < k < n: T(n,k) = smallest prime not less than T(n-1,k) + T(n-1,k-1).

%C In order to get the next number in the row, you add the two numbers above it, and find the next prime.

%C 3 is the only prime number that never shows up.

%C 5 is the only prime number that only shows up once; every prime number above 5 shows up at least twice.

%H Michael De Vlieger, <a href="/A362034/b362034.txt">Table of n, a(n) for n = 0..11475</a> (rows 0..150, flattened)

%F T(n,k) = A007918(T(n-1,k-1) + T(n-1,k)) for 0 < k < n. - _Robert Israel_, Apr 05 2023

%e Triangle begins:

%e k=0 1 2 3 4 5 6 7 8 9 10

%e n=0: 2

%e n=1: 2 2

%e n=2: 2 5 2

%e n=3: 2 7 7 2

%e n=4: 2 11 17 11 2

%e n=5: 2 13 29 29 13 2

%e n=6: 2 17 43 59 43 17 2

%e n=7: 2 19 61 103 103 61 19 2

%e n=8: 2 23 83 167 211 167 83 23 2

%e n=9: 2 29 107 251 379 379 251 107 29 2

%e n=10: 2 31 137 359 631 761 631 359 137 31 2

%p for n from 0 to 10 do

%p T[n,0]:= 2: T[n,n]:= 2:

%p for k from 1 to n-1 do

%p T[n,k]:= nextprime(T[n-1,k-1]+T[n-1,k]-1)

%p od

%p od:

%p for n from 0 to 10 do

%p seq(T[n,k],k=0..n)

%p od; # _Robert Israel_, Apr 05 2023

%t T[n_, 0] := T[n, n] = 2; T[n_, k_] := T[n, k] = NextPrime[T[n - 1, k - 1] + T[n - 1, k] - 1]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* _Michael De Vlieger_, Apr 06 2023, after Maple *)

%o (PARI) T(n,k) = if (n==0, 2, if (k==0, 2, if (k==n, 2, nextprime(T(n-1,k-1) + T(n-1,k))))); \\ _Michel Marcus_, Apr 07 2023

%Y Cf. A000040, A007318, A199333.

%K nonn,tabl

%O 0,1

%A _Jack Braxton_, Apr 05 2023