Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #32 Sep 21 2018 22:11:22
%S 0,0,0,0,1,0,0,0,1,0,0,1,2,2,0,0,0,0,0,1,0,0,1,2,2,4,2,0,0,0,1,0,2,0,
%T 3,0,0,1,0,1,3,0,4,3,0,0,0,1,0,0,0,2,0,2,0,0,1,2,2,4,2,6,4,6,4,0,0,0,
%U 0,0,1,0,2,0,0,0,3,0,0,1,2,2,4,2,6,4,6,4,10,4,0,0,0,1,0,2,0,0,0,2,0,4,0,5,0
%N Triangle T(n,k), n>=1, 1<=k<=n, read by rows: T(n,k) is the number of positive integers j<k such that j,k,n are pairwise coprime.
%C T(n,k) = A000010(k) if n is prime and 1<k<n.
%H Alois P. Heinz, <a href="/A186230/b186230.txt">Rows n = 1..250, flattened</a>
%F T(n,k) = |{ j : 1 <= j < k and GCD(n,k) = GCD(n,j) = GCD(k,j) = 1 }|.
%e T(n,1) = 0 because no positive integer j<1 can be found.
%e T(n,k) = 0 if GCD(n,k)>1.
%e T(7,5) = 4 because for j in {1,2,3,4} all conditions are satisfied.
%e Triangle T(n,k) begins:
%e 0;
%e 0, 0;
%e 0, 1, 0;
%e 0, 0, 1, 0;
%e 0, 1, 2, 2, 0;
%e 0, 0, 0, 0, 1, 0;
%e 0, 1, 2, 2, 4, 2, 0;
%p with(numtheory):
%p T:= proc(n,k) local c, i, j, m;
%p if k=1 or igcd(n, k)>1 then 0
%p elif isprime(n) then phi(k)
%p else m:= n*k;
%p i:= igcd(m, 2);
%p c:= 0;
%p for j to k-1 by i do
%p if igcd(m, j)=1 then c:= c+1 fi
%p od; c
%p fi
%p end:
%p seq(seq(T(n, k), k=1..n), n=1..20);
%t t[n_, k_] := Module[{c, i, j, m}, If[ k == 1 || GCD[n, k] > 1, 0, If[PrimeQ[n], EulerPhi[k], m = n*k; i = GCD[m, 2]; c = 0; For[j = 1, j <= k-1, j = j+i, If[GCD[m, j] == 1, c = c+1]]; c]]]; Table[Table[t[n, k], {k, 1, n}], {n, 1, 20}] // Flatten (* _Jean-François Alcover_, Dec 19 2013 *)
%Y Row sums give: A185953. Column k=2 gives: A000035 for n>1. Lower diagonal gives: A057475(n-1) for n>2. Cf. A000010, A000040, A003989.
%K nonn,tabl,look
%O 1,13
%A _Alois P. Heinz_, Feb 15 2011