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 A051190 #80 Jan 29 2025 15:40:35 %S A051190 1,1,1,2,1,12,1,16,9,80,1,3456,1,448,2025,2048,1,186624,1,1024000, %T A051190 35721,11264,1,573308928,625,53248,59049,179830784,1,1007769600000,1, %U A051190 67108864,7144929,1114112,37515625,160489808068608,1,4980736,89813529 %N A051190 a(n) = Product_{k=1..n-1} gcd(k,n). %C A051190 a(n) > 1 if and only if n is composite. - _Charles R Greathouse IV_, Jan 04 2013 %H A051190 T. D. Noe, <a href="/A051190/b051190.txt">Table of n, a(n) for n = 1..200</a> %H A051190 OEIS Wiki, <a href="/wiki/Generalizations_of_the_factorial#Formulae_for_GCD_matrix_generalization_of_the_factorial">Generalizations of the factorial</a> %F A051190 a(n) = Product_{ d divides n, d < n } d^phi(n/d). - _Peter Luschny_, Apr 07 2013 %F A051190 a(n) = A067911(n) / n. - _Peter Luschny_, Apr 07 2013 %F A051190 Product_{j=1..n} Product_{k=1..j-1} gcd(j,k), n >= 1. - _Daniel Forgues_, Apr 11 2013 %F A051190 a(n) = sqrt( (1/n) * (A092287(n) / A092287(n-1)) ). - _Daniel Forgues_, Apr 13 2013 %p A051190 A051190 := proc(n) local i; mul(igcd(n, i ), i = 1..(n-1)) end; %t A051190 a[n_] := If[PrimeQ[n], 1, Times @@ (GCD[n, #]& /@ Range[n-1])]; Table[a[n], {n, 1, 39}] (* _Jean-François Alcover_, Jul 18 2012 *) %t A051190 Table[Times @@ GCD[n, Range[n-1]], {n, 50}] (* _T. D. Noe_, Apr 12 2013 *) %t A051190 Table[Product[GCD[k,n],{k,n-1}],{n,50}] (* _Harvey P. Dale_, Jan 29 2025 *) %o A051190 (Haskell) %o A051190 a051190 n = product $ map (gcd n) [1..n-1] %o A051190 -- _Reinhard Zumkeller_, Nov 22 2011 %o A051190 (PARI) a(n)=my(f=factor(n)); prod(i=1, #f[,1], prod(j=1, f[i,2], f[i,1]^(n\f[i,1]^j)))/n \\ _Charles R Greathouse IV_, Jan 04 2013 %o A051190 (PARI) a(n) = prod(k=1,n-1,gcd(k,n)); /* _Joerg Arndt_, Apr 14 2013 */ %o A051190 (Sage) %o A051190 A051190 = lambda n: mul(gcd(n,i) for i in (1..n-1)) %o A051190 [A051190(n) for n in (1..39)] # _Peter Luschny_, Apr 07 2013 %o A051190 (Sage) %o A051190 # A second, faster version, based on the prime factorization of a(n): %o A051190 def A051190(n): %o A051190 R = 1 %o A051190 if not is_prime(n) : %o A051190 for p in primes(n//2+1): %o A051190 s = 0; r = n; t = n-1 %o A051190 while r > 0 : %o A051190 r = r//p; t = t//p %o A051190 s += (r-t)*(r+t-1) %o A051190 R *= p^(s/2) %o A051190 return R %o A051190 [A051190(i) for i in (1..1000)] # _Peter Luschny_, Apr 08 2013 %Y A051190 Cf. A067911, A006579, A224479, A092287. %K A051190 nonn,nice %O A051190 1,4 %A A051190 _Antti Karttunen_, Oct 21 1999