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.

A225174 Square array read by antidiagonals: T(m,n) = greatest common unitary divisor of m and n.

This page as a plain text file.
%I A225174 #24 Nov 28 2018 20:58:31
%S A225174 1,1,1,1,2,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,2,1,4,1,2,1,1,1,3,1,1,3,
%T A225174 1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,6,1,1,1,2,1,1,1,
%U A225174 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,3,1,5,1,1,1,1,5,1,3,1,1
%N A225174 Square array read by antidiagonals: T(m,n) = greatest common unitary divisor of m and n.
%D A225174 M. Lal, H. Wareham and R. Mifflin, Iterates of the bi-unitary totient function, Utilitas Math., 10 (1976), 347-350.
%H A225174 Antti Karttunen, <a href="/A225174/b225174.txt">Table of n, a(n) for n = 1..20100; the first 200 antidiagonals of the array</a>
%F A225174 T(m,n) = T(n,m) = A165430(n,m).
%e A225174 Array begins
%e A225174 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
%e A225174 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, ...
%e A225174 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, ...
%e A225174 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 4, ...
%e A225174 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, ...
%e A225174 1, 2, 3, 1, 1, 6, 1, 1, 1, 2, 1, 3, ...
%e A225174 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, ...
%e A225174 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, ...
%e A225174 ...
%e A225174 The unitary divisors of 3 are 1 and 3, those of 6 are 1,2,3,6; so T(6,3) = T(3,6) = 3.
%p A225174 # returns the greatest common unitary divisor of m and n
%p A225174 f:=proc(m,n)
%p A225174 local i,ans;
%p A225174 ans:=1;
%p A225174 for i from 1 to min(m,n) do
%p A225174 if ((m mod i) = 0) and (igcd(i,m/i) = 1)  then
%p A225174    if ((n mod i) = 0) and (igcd(i,n/i) = 1)  then ans:=i; fi;
%p A225174 fi;
%p A225174 od;
%p A225174 ans; end;
%t A225174 f[m_, n_] := Module[{i, ans=1}, For[i=1, i<=Min[m, n], i++, If[Mod[m, i]==0 && GCD[i, m/i]==1, If[Mod[n, i]==0 && GCD[i, n/i]==1, ans=i]]]; ans];
%t A225174 Table[f[m-n+1, n], {m, 1, 14}, {n, 1, m}] // Flatten (* _Jean-François Alcover_, Jun 19 2018, translated from Maple *)
%o A225174 (PARI)
%o A225174 up_to = 20100; \\ = binomial(200+1,2)
%o A225174 A225174sq(m,n) = { my(a=min(m,n),b=max(m,n),md=0); fordiv(a,d,if(0==(b%d)&&1==gcd(d,a/d)&&1==gcd(d,b/d),md=d)); (md); };
%o A225174 A225174list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, if(i++ > up_to, return(v)); v[i] = A225174sq((a-(col-1)),col))); (v); };
%o A225174 v225174 = A225174list(up_to);
%o A225174 A225174(n) = v225174[n]; \\ _Antti Karttunen_, Nov 28 2018
%Y A225174 See A034444, A077610 for unitary divisors of n.
%Y A225174 Different from A059895.
%K A225174 nonn,tabl,look
%O A225174 1,5
%A A225174 _N. J. A. Sloane_, May 01 2013