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.
%I A054521 #80 Jun 22 2025 03:57:16 %S A054521 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, %T A054521 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, %U A054521 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 %N A054521 Triangle read by rows: T(n,k) = 1 if gcd(n, k) = 1, T(n,k) = 0 otherwise (n >= 1, 1 <= k <= n). %C A054521 Row sums = phi(n), A000010: (1, 1, 2, 2, 4, 2, 6, ...). - _Gary W. Adamson_, May 20 2007 %C A054521 Characteristic function of A169581: a(A169581(n)) = 1; a(A169582(n)) = 0. - _Reinhard Zumkeller_, Dec 02 2009 %C A054521 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. %C A054521 T(n,k) = |K(n-k|k)| where K(i|j) is the Kronecker symbol. - _Peter Luschny_, Aug 05 2012 %C A054521 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 %C A054521 The number of zeros in the n-th row of the triangle is cototient(n) = A051953(n). - _Omar E. Pol_, Apr 21 2017 %C A054521 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 %H A054521 Reinhard Zumkeller, <a href="/A054521/b054521.txt">Rows n = 1..125 of triangle, flattened</a> %H A054521 Jakub Jaroslaw Ciaston, <a href="/plot2a?name1=A054531&name2=A164306&tform1=untransformed&tform2=untransformed&shift=0&radiop1=xy&drawpoints=true">A054531 vs A164306</a> (plot shows these ones) %H A054521 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a> %F A054521 T(n,k) = A063524(A050873(n,k)). - _Reinhard Zumkeller_, Dec 02 2009, corrected Sep 03 2015 %F A054521 T(n,k) = A054431(n,k) = A054431(k,n). - _R. J. Mathar_, Jul 21 2016 %e A054521 The triangle T(n,k) begins: %e A054521 n\k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... %e A054521 1: 1 %e A054521 2: 1 0 %e A054521 3: 1 1 0 %e A054521 4: 1 0 1 0 %e A054521 5: 1 1 1 1 0 %e A054521 6: 1 0 0 0 1 0 %e A054521 7: 1 1 1 1 1 1 0 %e A054521 8: 1 0 1 0 1 0 1 0 %e A054521 9: 1 1 0 1 1 0 1 1 0 %e A054521 10: 1 0 1 0 0 0 1 0 1 0 %e A054521 11: 1 1 1 1 1 1 1 1 1 1 0 %e A054521 12: 1 0 0 0 1 0 1 0 0 0 1 0 %e A054521 13: 1 1 1 1 1 1 1 1 1 1 1 1 0 %e A054521 14: 1 0 1 0 1 0 0 0 1 0 1 0 1 0 %e A054521 15: 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 %e A054521 ... (Reformatted by _Wolfdieter Lang_, Apr 26 2013) %e A054521 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 %p A054521 A054521_row := n -> seq(abs(numtheory[jacobi](n-k,k)),k=1..n); %p A054521 for n from 1 to 13 do A054521_row(n) od; # _Peter Luschny_, Aug 05 2012 %t A054521 T[ n_, k_] := Boole[ n>0 && k>0 && GCD[ n, k] == 1] (* _Michael Somos_, Jul 17 2011 *) %t A054521 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 *) %o A054521 (PARI) {T(n, k) = n>0 && k>0 && gcd(n, k)==1} /* _Michael Somos_, Jul 17 2011 */ %o A054521 (Sage) %o A054521 def A054521_row(n): return [abs(kronecker_symbol(n-k,k)) for k in (1..n)] %o A054521 for n in (1..13): print(A054521_row(n)) # _Peter Luschny_, Aug 05 2012 %o A054521 (Haskell) %o A054521 a054521 n k = a054521_tabl !! (n-1) !! (k-1) %o A054521 a054521_row n = a054521_tabl !! (n-1) %o A054521 a054521_tabl = map (map a063524) a050873_tabl %o A054521 a054521_list = concat a054521_tabl %o A054521 -- _Reinhard Zumkeller_, Sep 03 2015 %Y A054521 Cf. A051731, A054522, A215200. %Y A054521 Cf. A050873, A063524. %Y A054521 Cf. A349221. %K A054521 nonn,tabl,easy %O A054521 1,1 %A A054521 _N. J. A. Sloane_, Apr 09 2000