cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A054522 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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

T(n,1) = 1; T(n,n) = A000010(n).
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

Examples

			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, 0, 4;
1, 0, 2, 0, 0, 0, 0, 0, 6;
		

Crossrefs

Programs

  • Haskell
    a054522 n k = a054522_tabl !! (n-1) !! (k-1)
    a054522_tabl = map a054522_row [1..]
    a054522_row n = map (\k -> if n `mod` k == 0 then a000010 k else 0) [1..n]
    -- Reinhard Zumkeller, Oct 18 2011
  • Maple
    A054522 := proc(n,k)
        if modp(n,k) = 0 then
            numtheory[phi](k) ;
        else
            0;
        end if;
    end proc:
    seq(seq(A054522(n,k),k=1..n),n=1..15) ; # R. J. Mathar, Aug 06 2016
  • Mathematica
    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 *)
    Flatten[Table[If[Divisible[n,k],EulerPhi[k],0],{n,15},{k,n}]] (* Harvey P. Dale, Feb 27 2012 *)
  • PARI
    T(n,k)=if(k<1 || k>n,0,if(n%k,0,eulerphi(k)))
    

Formula

Sum (T(n,k): k = 1 .. n) = n. - Reinhard Zumkeller, Oct 18 2011
T(n,k) = Sum_{d|k} mu(k/d)*gcd(n,d). - Ridouane Oudra, Apr 05 2025