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.

Showing 1-2 of 2 results.

A054521 Triangle read by rows: T(n,k) = 1 if gcd(n, k) = 1, T(n,k) = 0 otherwise (n >= 1, 1 <= k <= n).

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

Row sums = phi(n), A000010: (1, 1, 2, 2, 4, 2, 6, ...). - Gary W. Adamson, May 20 2007
Characteristic function of A169581: a(A169581(n)) = 1; a(A169582(n)) = 0. - Reinhard Zumkeller, Dec 02 2009
The function T(n,k) = T(k,n) is defined for k > n but only the values for 1 <= k <= n as a triangular array are listed here.
T(n,k) = |K(n-k|k)| where K(i|j) is the Kronecker symbol. - Peter Luschny, Aug 05 2012
Twice the sum over the antidiagonals, starting with entry T(n-1,1), for n >= 3, is the same as the row n sum (i.e., phi(n): 2*Sum_{k=1..floor(n/2)} T(n-k,k) = phi(n), n >= 3). - Wolfdieter Lang, Apr 26 2013
The number of zeros in the n-th row of the triangle is cototient(n) = A051953(n). - Omar E. Pol, Apr 21 2017
This triangle is the j = 1 sub-triangle of A349221(n,k) = Sum_{j>=1} [k|binomial(n-1,k-1) AND gcd(n,k) = j], n >= 1, 1 <= k <= n, where [] is the Iverson bracket. - Richard L. Ollerton, Dec 14 2021

Examples

			The triangle T(n,k) begins:
  n\k  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
   1:  1
   2:  1  0
   3:  1  1  0
   4:  1  0  1  0
   5:  1  1  1  1  0
   6:  1  0  0  0  1  0
   7:  1  1  1  1  1  1  0
   8:  1  0  1  0  1  0  1  0
   9:  1  1  0  1  1  0  1  1  0
  10:  1  0  1  0  0  0  1  0  1  0
  11:  1  1  1  1  1  1  1  1  1  1  0
  12:  1  0  0  0  1  0  1  0  0  0  1  0
  13:  1  1  1  1  1  1  1  1  1  1  1  1  0
  14:  1  0  1  0  1  0  0  0  1  0  1  0  1  0
  15:  1  1  0  1  0  0  1  1  0  0  1  0  1  1  0
  ... (Reformatted by _Wolfdieter Lang_, Apr 26 2013)
Sums over antidiagonals: n = 3: 2*T(2,1) = 2 = T(3,1) + T(3,2) = phi(3). n = 4: 2*(T(3,1) + T(2,2)) = 2 = phi(4), etc. - _Wolfdieter Lang_, Apr 26 2013
		

Crossrefs

Programs

  • Haskell
    a054521 n k = a054521_tabl !! (n-1) !! (k-1)
    a054521_row n = a054521_tabl !! (n-1)
    a054521_tabl = map (map a063524) a050873_tabl
    a054521_list = concat a054521_tabl
    -- Reinhard Zumkeller, Sep 03 2015
  • Maple
    A054521_row := n -> seq(abs(numtheory[jacobi](n-k,k)),k=1..n);
    for n from 1 to 13 do A054521_row(n) od; # Peter Luschny, Aug 05 2012
  • Mathematica
    T[ n_, k_] := Boole[ n>0 && k>0 && GCD[ n, k] == 1] (* Michael Somos, Jul 17 2011 *)
    T[ n_, k_] := If[ n<1 || k<1, 0, If[ k>n, T[ k, n], If[ k==1, 1, If[ n>k, T[ k, Mod[ n, k, 1]], 0]]]] (* Michael Somos, Jul 17 2011 *)
  • PARI
    {T(n, k) = n>0 && k>0 && gcd(n, k)==1} /* Michael Somos, Jul 17 2011 */
    
  • Sage
    def A054521_row(n): return [abs(kronecker_symbol(n-k,k)) for k in (1..n)]
    for n in (1..13): print(A054521_row(n)) # Peter Luschny, Aug 05 2012
    

Formula

T(n,k) = A063524(A050873(n,k)). - Reinhard Zumkeller, Dec 02 2009, corrected Sep 03 2015
T(n,k) = A054431(n,k) = A054431(k,n). - R. J. Mathar, Jul 21 2016

A349593 Square array read by downward diagonals: for n >= 0, k >= 1, T(n,k) is the period of {binomial(N,n) mod k: N in Z}.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 4, 1, 1, 4, 3, 4, 1, 1, 5, 8, 9, 8, 1, 1, 6, 5, 8, 9, 8, 1, 1, 7, 12, 5, 16, 9, 8, 1, 1, 8, 7, 36, 5, 16, 9, 8, 1, 1, 9, 16, 7, 72, 25, 16, 9, 16, 1, 1, 10, 9, 16, 7, 72, 25, 16, 9, 16, 1, 1, 11, 20, 27, 32, 7, 72, 25, 32, 27, 16, 1
Offset: 0

Views

Author

Jianing Song, Nov 27 2021

Keywords

Comments

Since binomial(N,n) is defined for all integers N, there is no need to assume that N >= n.
Let Q(N) = 1 if k | binomial(N,n), 0 otherwise. Then T(n,k) is also the period of {Q(N): N in Z}.
By the formula given below, the n-th row is identical to the (n-1)th row if and only if n is not a power of a prime, i.e., n is in A024619. - Jianing Song, Jul 03 2025

Examples

			Rows 0..10:
  1,  1,  1,  1,  1,   1,  1,  1,  1,   1, ...
  1,  2,  3,  4,  5,   6,  7,  8,  9,  10, ...
  1,  4,  3,  8,  5,  12,  7, 16,  9,  20, ...
  1,  4,  9,  8,  5,  36,  7, 16, 27,  20, ...
  1,  8,  9, 16,  5,  72,  7, 32, 27,  40, ...
  1,  8,  9, 16, 25,  72,  7, 32, 27, 200, ...
  1,  8,  9, 16, 25,  72,  7, 32, 27, 200, ...
  1,  8,  9, 16, 25,  72, 49, 32, 27, 200, ...
  1, 16,  9, 32, 25, 144, 49, 64, 27, 400, ...
  1, 16, 27, 32, 25, 432, 49, 64, 81, 400, ...
  1, 16, 27, 32, 25, 432, 49, 64, 81, 400, ...
Example showing that T(4,4) = 16: for N == 0, 1, ..., 15 (mod 16), binomial(N,4) == {0, 0, 0, 0, 1, 1, 3, 3, 2, 2, 2, 2, 3, 3, 1, 1} (mod 4).
Example showing that T(3,10) = 20: for N == 0, 1, ..., 19 (mod 20), binomial(N,3) == {0, 0, 0, 1, 4, 0, 0, 5, 6, 4, 0, 5, 0, 6, 4, 5, 0, 0, 6, 9} (mod 10).
		

Crossrefs

Cf. A022998 (row n = 2), A385555 (row n = 3), A385556 (row n = 4), A385557 (rows n = 5 and 6), A385558 (row n = 7), A385559 (row n = 8), A385560 (rows n = 9 and 10).
Cf. A062383 (2nd column), A064235 (3rd column if offset 0), A385552 (5th column), A385553 (6th column), A385554 (10th column).
Cf. A349221.

Programs

  • Mathematica
    A349593[n_, k_] := If[n == 0 || k == 1, 1, k*Product[p^Floor[Log[p, n]], {p, FactorInteger[k][[All, 1]]}]];
    Table[A349593[k - 1, n - k + 2], {n, 0, 15}, {k, n + 1}] (* Paolo Xausa, Jul 07 2025 *)
  • PARI
    T(n,k) = if(n==0, 1, my(r=1, f=factor(k)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(n,p)+e)); return(r))

Formula

The n-th row is multiplicative with T(n,p^e) = 1 if n = 0, p^(e+floor(log(n)/log(p))) otherwise. In other words, for n > 0, T(n,k) = k * Product_{prime p|k} p^(floor(log(n)/log(p))). See my pdf file for a proof.
Showing 1-2 of 2 results.