%I #36 Oct 19 2023 12:50:54
%S 1,1,1,1,0,2,1,1,0,2,1,0,0,0,4,1,1,2,0,0,2,1,0,0,0,0,0,6,1,1,0,2,0,0,
%T 0,4,1,0,2,0,0,0,0,0,6,1,1,0,0,4,0,0,0,0,4,1,0,0,0,0,0,0,0,0,0,10,1,1,
%U 2,2,0,2,0,0,0,0,0,4,1,0,0,0,0,0,0,0,0,0,0,0,12,1,1,0,0,0,0,6,0,0,0,0,0
%N Triangle T(n,k): T(n,k) = phi(k) if k divides n, T(n,k)=0 otherwise (n >= 1, 1<=k<=n). T(n,k) = number of elements of order k in cyclic group of order n.
%C T(n,1) = 1; T(n,n) = A000010(n).
%C This triangle is the transpose of the upper triangular array U in the LU decomposition of the square array A003989. - _Peter Bala_, Oct 15 2023
%H Reinhard Zumkeller, <a href="/A054522/b054522.txt">Rows n=1..100 of triangle, flattened</a>
%H R. J. Mathar, <a href="http://www.vixra.org/abs/1406.0183">Plots of cycle graphs of the finite groups up to order 36</a>, (2015)
%F Sum (T(n,k): k = 1 .. n) = n. - _Reinhard Zumkeller_, Oct 18 2011
%e 1;
%e 1, 1;
%e 1, 0, 2;
%e 1, 1, 0, 2;
%e 1, 0, 0, 0, 4;
%e 1, 1, 2, 0, 0, 2;
%e 1, 0, 0, 0, 0, 0, 6;
%e 1, 1, 0, 2, 0, 0, 0, 4;
%e 1, 0, 2, 0, 0, 0, 0, 0, 6;
%p A054522 := proc(n,k)
%p if modp(n,k) = 0 then
%p numtheory[phi](k) ;
%p else
%p 0;
%p end if;
%p end proc:
%p seq(seq(A054522(n,k),k=1..n),n=1..15) ; # _R. J. Mathar_, Aug 06 2016
%t t[n_, k_] /; Divisible[n, k] := EulerPhi[k]; t[_, _] = 0; Flatten[Table[t[n, k], {n, 1, 14}, {k, 1, n}]] (* _Jean-François Alcover_, Nov 25 2011 *)
%t Flatten[Table[If[Divisible[n,k],EulerPhi[k],0],{n,15},{k,n}]] (* _Harvey P. Dale_, Feb 27 2012 *)
%o (PARI) T(n,k)=if(k<1 || k>n,0,if(n%k,0,eulerphi(k)))
%o (Haskell)
%o a054522 n k = a054522_tabl !! (n-1) !! (k-1)
%o a054522_tabl = map a054522_row [1..]
%o a054522_row n = map (\k -> if n `mod` k == 0 then a000010 k else 0) [1..n]
%o -- _Reinhard Zumkeller_, Oct 18 2011
%Y Cf. A003989, A054521.
%K nonn,tabl,nice,easy
%O 1,6
%A _N. J. A. Sloane_, Apr 09 2000