%I #15 Mar 31 2024 08:45:37
%S 1,1,-1,1,-2,1,1,-4,5,-2,1,-10,29,-32,12,1,-16,89,-206,204,-72,1,-46,
%T 569,-2876,6384,-6192,2160,1,-76,1949,-19946,92664,-197712,187920,
%U -64800,1,-286,17909,-429236,4281324,-19657152,41707440,-39528000,13608000,1,-496,77969,-4190126,94420884,-918735192,4169709360,-8798090400,8314488000,-2857680000
%N Triangle read by rows. Let g(n) = n if n is a prime, otherwise g(n) = 1. Let p(0) = 1, p(n) = g(n)*p(n-1). Row n gives coefficients of Product_{j=0..n} (x - p(j)), with row 0 = {1}.
%H G. C. Greubel, <a href="/A118686/b118686.txt">Rows n = 0..50 of the triangle, flattened</a>
%F Sum_{k=0..n} abs(T(n, k)) = A119489(n).
%e Triangle begins:
%e 1;
%e 1, -1;
%e 1, -2, 1;
%e 1, -4, 5, -2;
%e 1, -10, 29, -32, 12;
%e 1, -16, 89, -206, 204, -72;
%e 1, -46, 569, -2876, 6384, -6192, 2160;
%t g[n_]:= If[PrimeQ[n]==True, n, 1]; p[0]=1; p[n_]:= p[n]= g[n]*p[n-1];
%t Join[{{1}}, Table[Reverse[CoefficientList[Product[x-p[n], {n,0,m}], x]], {m, 0, 10}]]//Flatten
%o (Magma)
%o R<x>:=PowerSeriesRing(Rationals(), 50);
%o g:= func< n | IsPrime(n) select n else 1 >;
%o p:=[1] cat [n le 1 select 1 else g(n)*Self(n-1): n in [1..50]];
%o A118686:= func< n,k | k eq 0 select 1 else Coefficient(R!( (&*[x-p[j+1]: j in [0..n-1]]) ), n-k) >;
%o [A118686(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Mar 31 2024
%o (SageMath)
%o def g(n): return n if is_prime(n) else 1
%o def p(n): return 1 if n==0 else g(n)*p(n-1)
%o def A118686(n,k): return 1 if k==0 else ( product(x-p(j) for j in range(n)) ).series(x, n+2).list()[n-k]
%o flatten([[A118686(n,k) for k in range(n+1)] for n in range(12)]) # _G. C. Greubel_, Mar 31 2024
%Y Cf. primorial numbers A034386, Stirling numbers of the first kind A008275.
%Y Cf. A034386, A008275, A119724, A119489 (row sums of absolute values).
%K sign,tabl
%O 0,5
%A _Roger L. Bagula_, May 20 2006
%E Edited by _N. J. A. Sloane_, Oct 08 2006