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.

A356472 Numerator of the average of gcd(i,n) for i = 1..n.

This page as a plain text file.
%I A356472 #51 Dec 25 2024 05:34:19
%S A356472 1,3,5,2,9,5,13,5,7,27,21,10,25,39,3,3,33,7,37,18,65,63,45,25,13,75,3,
%T A356472 26,57,9,61,7,35,99,117,14,73,111,125,9,81,65,85,42,21,135,93,5,19,39,
%U A356472 55,50,105,9,189,65,185,171,117,6,121,183,13,4,45,105,133,66,75,351,141,35,145,219,13,74,39,125,157
%N A356472 Numerator of the average of gcd(i,n) for i = 1..n.
%H A356472 Amiram Eldar, <a href="/A356472/b356472.txt">Table of n, a(n) for n = 1..10000</a>
%F A356472 a(n) = numerator(A018804(n)/n).
%F A356472 a(n) << n^(1+e) for any e > 0. a(n) > 1 for all n > 1. - _Charles R Greathouse IV_, Sep 08 2022
%F A356472 Sum_{k=1..n} a(k)/A356473(k) ~ (n/zeta(2)) * (log(n) + 2*gamma - 1 - zeta'(2)/zeta(2)), where gamma is Euler's constant (A001620). - _Amiram Eldar_, Dec 25 2024
%e A356472 For n = 3, the average of the gcd's is (gcd(1,3) + gcd(2,3) + gcd(3,3))/3 = (1 + 1 + 3)/3 = 5/3 and its numerator is a(3)=5.
%t A356472 Table[Numerator[Sum[GCD[I, j], {j, 1, I}]/I], {I, 100}]
%t A356472 f[p_, e_] := e*(p - 1)/p + 1; a[n_] := Numerator[Times @@ f @@@ FactorInteger[n]]; Array[a, 100] (* _Amiram Eldar_, Apr 28 2023 *)
%o A356472 (Haskell) map numerator (map (\i -> sum (map (\j -> gcd i j) [1..i]) % i) [1..])
%o A356472 (PARI) a(n) = numerator(sum(i=1, n, gcd(i, n))/n); \\ _Michel Marcus_, Aug 08 2022
%o A356472 (PARI) a(n,f=factor(n))=my(k=prod(i=1, #f~, (f[i, 2]*(f[i, 1]-1)/f[i, 1] + 1)*f[i, 1]^f[i, 2])); k/gcd(k,n) \\ _Charles R Greathouse IV_, Sep 08 2022
%o A356472 (Python)
%o A356472 from math import prod, gcd
%o A356472 from sympy import factorint
%o A356472 def A356472(n):
%o A356472     f = factorint(n)
%o A356472     return (m:=prod((p-1)*e+p for p, e in f.items()))//gcd(prod(f),m) # _Chai Wah Wu_, Sep 08 2022
%Y A356472 Cf. A356473 (denominators), A018804, A057661 (LCM).
%Y A356472 Cf. A001620, A013661, A306016.
%K A356472 easy,frac,nonn
%O A356472 1,2
%A A356472 _Matthias Kaak_, Aug 08 2022