login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Triangle read by rows: T(n, k) = 3 + prime(n+1) - prime(k+1) - prime(n-k+1).
1

%I #10 Sep 08 2022 08:45:41

%S 1,1,1,1,2,1,1,2,2,1,1,4,4,4,1,1,2,4,4,2,1,1,4,4,6,4,4,1,1,2,4,4,4,4,

%T 2,1,1,4,4,6,4,6,4,4,1,1,6,8,8,8,8,8,8,6,1,1,2,6,8,6,8,6,8,6,2,1,1,6,

%U 6,10,10,10,10,10,10,6,6,1,1,4,8,8,10,12,10,12,10,8,8,4,1

%N Triangle read by rows: T(n, k) = 3 + prime(n+1) - prime(k+1) - prime(n-k+1).

%C Row sums are: {1, 2, 4, 6, 14, 14, 24, 22, 34, 62, 54, ...}.

%H G. C. Greubel, <a href="/A156074/b156074.txt">Rows n = 0..100 of triangle, flattened</a>

%F T(n, k) = 3 + prime(n+1) - prime(k+1) - prime(n-k+1).

%e Triangle begins as:

%e 1;

%e 1, 1;

%e 1, 2, 1;

%e 1, 2, 2, 1;

%e 1, 4, 4, 4, 1;

%e 1, 2, 4, 4, 2, 1;

%e 1, 4, 4, 6, 4, 4, 1;

%e 1, 2, 4, 4, 4, 4, 2, 1;

%e 1, 4, 4, 6, 4, 6, 4, 4, 1;

%e 1, 6, 8, 8, 8, 8, 8, 8, 6, 1;

%e 1, 2, 6, 8, 6, 8, 6, 8, 6, 2, 1;

%p seq(seq( 3+ ithprime(n+1) -ithprime(k+1) -ithprime(n-k+1), k=0..n), n=0..15); # _G. C. Greubel_, Dec 02 2019

%t Table[3 +Prime[n+1] -Prime[k+1] -Prime[n-k+1], {n,0,15}, {k,0,n}]//Flatten

%o (PARI) T(n,k) = 3 + prime(n+1) - prime(k+1) - prime(n-k+1); \\ _G. C. Greubel_, Dec 02 2019

%o (Magma) P:=NthPrime; [3 +P(n+1) -P(k+1) -P(n-k+1): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Dec 02 2019

%o (Sage) p=nth_prime; [[3 +p(n+1) -p(k+1) -p(n-k+1) for k in (0..n)] for n in (0..15)] # _G. C. Greubel_, Dec 02 2019

%K nonn,tabl

%O 0,5

%A _Roger L. Bagula_, Feb 03 2009

%E More terms added by _G. C. Greubel_, Dec 02 2019