login

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

A095195
T(n,0) = prime(n), T(n,k) = T(n,k-1)-T(n-1,k-1), 0<=k<n, triangle read by rows.
34
2, 3, 1, 5, 2, 1, 7, 2, 0, -1, 11, 4, 2, 2, 3, 13, 2, -2, -4, -6, -9, 17, 4, 2, 4, 8, 14, 23, 19, 2, -2, -4, -8, -16, -30, -53, 23, 4, 2, 4, 8, 16, 32, 62, 115, 29, 6, 2, 0, -4, -12, -28, -60, -122, -237, 31, 2, -4, -6, -6, -2, 10, 38, 98, 220, 457, 37, 6, 4, 8, 14, 20, 22, 12
OFFSET
1,1
COMMENTS
T(n,0)=A000040(n); T(n,1)=A001223(n-1) for n>1; T(n,2)=A036263(n-2) for n>2; T(n,n-1)=A007442(n) for n>1.
Row k of the array (not the triangle) is the k-th differences of the prime numbers. - Gus Wiseman, Jan 11 2025
LINKS
EXAMPLE
Triangle begins:
2;
3, 1;
5, 2, 1;
7, 2, 0, -1;
11, 4, 2, 2, 3;
13, 2, -2, -4, -6, -9;
Alternative: array form read by antidiagonals:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31,...
1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6,...
1, 0, 2, -2, 2, -2, 2, 2, -4, 4, -2,...
-1, 2, -4, 4, -4, 4, 0, -6, 8, -6, 0,...
3, -6, 8, -8, 8, -4, -6, 14, -14, 6, 4,...
-9, 14, -16, 16, -12, -2, 20, -28, 20, -2, -8,...
23, -30, 32, -28, 10, 22, -48, 48, -22, -6, 10,..,
-53, 62, -60, 38, 12, -70, 96, -70, 16, 16, -12,...
115,-122, 98, -26, -82, 166,-166, 86, 0, -28, 28,...
-237, 220,-124, -56, 248,-332, 252, -86, -28, 56, -98,...
457,-344, 68, 304,-580, 584,-338, 58, 84,-154, 308,...
MAPLE
A095195A := proc(n, k) # array, k>=0, n>=0
option remember;
if n =0 then
ithprime(k+1) ;
else
procname(n-1, k+1)-procname(n-1, k) ;
end if;
end proc:
A095195 := proc(n, k) # triangle, 0<=k<n, n>=1
A095195A(k, n-k-1) ;
end proc: # R. J. Mathar, Sep 19 2013
MATHEMATICA
T[n_, 0] := Prime[n]; T[n_, k_] /; 0 <= k < n := T[n, k] = T[n, k-1] - T[n-1, k-1]; Table[T[n, k], {n, 1, 12}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Feb 01 2017 *)
nn=6;
t=Table[Differences[Prime[Range[nn]], k], {k, 0, nn}];
Table[t[[j, i-j+1]], {i, nn}, {j, i}] (* Gus Wiseman, Jan 11 2025 *)
PROG
(Haskell)
a095195 n k = a095195_tabl !! (n-1) !! (k-1)
a095195_row n = a095195_tabl !! (n-1)
a095195_tabl = f a000040_list [] where
f (p:ps) xs = ys : f ps ys where ys = scanl (-) p xs
-- Reinhard Zumkeller, Oct 10 2013
CROSSREFS
Cf. A140119 (row sums).
Below, the inclusive primes (A008578) are 1 followed by A000040. See also A075526.
Rows of the array (columns of the triangle) begin: A000040, A001223, A036263.
Column n = 1 of the array is A007442, inclusive A030016.
The version for partition numbers is A175804, see A053445, A281425, A320590.
First position of 0 is A376678, inclusive A376855.
Absolute antidiagonal-sums are A376681, inclusive A376684.
The inclusive version is A376682.
For composite instead of prime we have A377033, see A377034-A377037.
For squarefree instead of prime we have A377038, nonsquarefree A377046.
Column n = 2 of the array is A379542.
Sequence in context: A366154 A214055 A066909 * A372640 A229961 A189074
KEYWORD
sign,tabl,look,changed
AUTHOR
Reinhard Zumkeller, Jun 22 2004
STATUS
approved