%I #8 Sep 08 2022 08:45:28
%S 1,1,1,1,0,1,1,1,-1,1,1,0,2,-1,1,1,1,-2,2,-2,1,1,0,3,-2,4,-1,1,1,1,-3,
%T 3,-6,3,-2,1,1,0,4,-3,9,-3,5,-2,1,1,1,-4,4,-12,6,-8,5,-2,1,1,0,5,-4,
%U 16,-6,14,-8,5,-1,1,1,1,-5,5,-20,10,-20,14,-8,4,-2,1,1,0,6,-5,25,-10,30,-20,14,-4,6,-2,1,1,1,-6,6,-30,15,-40,30,-20,10
%N Triangle read by rows: T(n,k) = mobius(k)*T(n-1,k) + T(n-1,k-1).
%H G. C. Greubel, <a href="/A124961/b124961.txt">Rows n = 1..100 of triangle, flattened</a>
%e Triangle starts:
%e 1;
%e 1, 1;
%e 1, 0, 1;
%e 1, 1, -1, 1;
%e 1, 0, 2, -1, 1;
%e 1, 1, -2, 2, -2, 1;
%p with(numtheory): T:=proc(n,k): if n=1 and k=1 then 1 elif k<1 or k>n then 0 else mobius(k)*T(n-1,k)+T(n-1,k-1) fi end: for n from 1 to 14 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
%t T[n_, k_]:= T[n, k]= If[n==1 && k==1, 1, If[k<1 || k>n, 0, MoebiusMu[k]* T[n-1, k] + T[n-1, k-1] ]]; Table[T[n, k], {n,12}, {k,n}]//Flatten (* _G. C. Greubel_, Nov 19 2019 *)
%o (PARI) T(n,k) = if(k==1 || k==n, 1, if(k<1 || k>n, 0, moebius(k)*T(n-1, k) + T(n-1, k-1) ));
%o for(n=1,10, for(k=1,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Nov 19 2019
%o (Magma)
%o function T(n,k)
%o if k lt 1 or k gt n then return 0;
%o elif n eq 1 and k eq 1 then return 1;
%o else return MoebiusMu(k)*T(n-1,k) + T(n-1,k-1);
%o end if;
%o return T;
%o end function;
%o [T(n,k): k in [1..n], n in [1..12]]; // _G. C. Greubel_, Nov 19 2019
%o (Sage)
%o @CachedFunction
%o def T(n,k):
%o if (k<1 or k>n): return 0
%o elif (n==1 and k==1): return 1
%o else: return moebius(k)*T(n-1, k) + T(n-1, k-1)
%o [[T(n,k) for k in (1..n)] for n in (1..12)] # _G. C. Greubel_, Nov 19 2019
%Y Cf. A008683.
%K sign,tabl
%O 1,13
%A _Gary W. Adamson_, Nov 13 2006
%E Edited by _N. J. A. Sloane_, Nov 29 2006