%I #16 Feb 14 2021 18:36:43
%S 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
%T 1,1,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,
%U 1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1
%N Triangle read by rows: T(n,k) = 1 if the generalized binomial coefficient (n,k)_f is an integer for every multiplicative function f; otherwise T(n,k) = 0.
%C For 0 <= k <= n, we define (n,k)_f := Product_{i=1..n}f(i)/(Product_{i=1..k}f(i) * Product_{i=1..n-k}f(i)).
%C T(n,k) = 1 if and only if for every prime p <= n there exists an index s_p >= 0 such that e(n,n-k,i,p) = 1 for all 0 <= i < s_p and e(n,n-k,i,p) = 0 for all i >= s_p where e(n,n-k,i,p) represents the value of the carry in the i-th position when adding the base-p representations of n and n-k (see Corollary 12 in Edgar-Spivey reference).
%C T(n,0) = 1 and T(n,1) = 1 for all n.
%C T(n,2) = 1 if and only if n == 2 (mod 4) or n == 3 (mod 4).
%H Tom Edgar and Michael Z. Spivey, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Edgar/edgar3.html">Multiplicative functions, generalized binomial coefficients, and generalized Catalan numbers</a>, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.6.
%H Tom Edgar, <a href="/A267959/a267959.pdf">Triangular array image.</a> This image is Figure 1 in Edgar-Spivey reference; it shows rows 0-90 of the triangle with shaded entries corresponding to 1 and other entries corresponding to 0.
%o (Sage)
%o def carry_sequence(n,k,p):
%o M=(n-k).digits(base=p)
%o K=k.digits(base=p)
%o mm=max(len(K),len(M))
%o M=M+(mm-len(M)+1)*[0]
%o K=K+(mm-len(K)+1)*[0]
%o CS=[floor((M[0]+K[0])/p)]
%o for i in [1..mm]:
%o CS.append(floor((M[i]+K[i]+CS[i-1])/p))
%o return CS
%o def checkcarrysequence(n,k,p):
%o CS=carry_sequence(n,k,p)
%o if 0 in CS:
%o T=CS[CS.index(0):]
%o if T==len(T)*[0]:
%o return true
%o else:
%o return false
%o else:
%o return true
%o def T(n,k):
%o flag=true
%o for x in prime_range(n+1):
%o if not(checkcarrysequence(n,k,x)):
%o flag=false
%o return Integer(flag)
%o T=[[T(i,j) for j in [0..i]] for i in [0..20]]
%o [x for sublist in T for x in sublist]
%K nonn,tabl
%O 0
%A _Tom Edgar_ and Michael Z. Spivey, Jan 22 2016