OFFSET
0,4
LINKS
G. C. Greubel, Rows n = 0..50 of triangle, flattened
FORMULA
T(n,n) = -1, T(1,0) = 1, T(n,0) = prime(n+2), T(n,1) = 1 - prime(n+2), T(n,k) = T(n-1,k-1). - G. C. Greubel, Apr 07 2019
EXAMPLE
Triangle begins as:
-1;
1, -1;
7, -6, -1;
11, -10, -6, -1;
13, -12, -10, -6, -1;
17, -16, -12, -10, -6, -1;
19, -18, -16, -12, -10, -6, -1;
23, -22, -18, -16, -12, -10, -6, -1;
29, -28, -22, -18, -16, -12, -10, -6, -1;
MATHEMATICA
T[n_, n_]:= -1; T[1, 0]:= 1; T[n_, 0]:= Prime[n+2]; T[n_, 1]:= 1 - Prime[n+2]; T[n_, k_]:= T[n-1, k-1]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Apr 07 2019 *)
PROG
(PARI) {T(n, k) = if(k==n, -1, if(n==1 && k==0, 1, if(k==0, prime(n+2), if(k==1, 1-prime(n+2), T(n-1, k-1) ))))}; \\ G. C. Greubel, Apr 07 2019
(Sage)
@CachedFunction
def T(n, k):
if k==n: return -1
elif n==1 and k==0: return 1
elif k==0: return nth_prime(n+2)
elif k==1: return 1 - nth_prime(n+2)
else: return T(n-1, k-1)
[[T(n, k) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Apr 07 2019
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula and Alexander R. Povolotsky, Dec 11 2008
EXTENSIONS
Edited by G. C. Greubel, Apr 07 2019
STATUS
approved