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.

A384628 a(n) = Sum_{k = 1..n} gcd(n, floor(n / k)).

This page as a plain text file.
%I A384628 #35 Jun 17 2025 13:59:30
%S A384628 1,3,5,8,9,14,13,20,19,25,21,35,25,37,37,44,33,56,37,60,51,58,45,84,
%T A384628 53,71,69,85,57,103,61,99,83,93,83,130,73,104,101,136,81,146,85,140,
%U A384628 129,124,93,188,103,155,131,163,105,191,127,185,145,159,117,251,121
%N A384628 a(n) = Sum_{k = 1..n} gcd(n, floor(n / k)).
%C A384628 a(p) = A018804(p) for p prime (A000040).
%C A384628 Empirical observation: A005408(n) <= a(n) < (2 + sqrt(2)/10)*A000203(n).
%F A384628 For p prime: a(p) = 2*p - 1.
%e A384628 n = 3: a(3) = Sum_{k = 1..3} gcd(3, floor(3 / k)) = 3 + 1 + 1 = 5.
%e A384628 n = 4: a(4) = Sum_{k = 1..4} gcd(4, floor(4 / k)) = 4 + 2 + 1 + 1 = 8.
%t A384628 a[n_] := Sum[GCD[n, Floor[n/k]], {k, 1, n}]; Array[a, 100] (* _Amiram Eldar_, Jun 05 2025 *)
%o A384628 (PARI) a(n) = sum(k=1, n, gcd(n, n\k)); \\ _Michel Marcus_, Jun 05 2025
%o A384628 (Python)
%o A384628 from math import gcd
%o A384628 def A384628(n):
%o A384628     c, j = (n<<1)+1, 2
%o A384628     k1 = n//j
%o A384628     while k1>1:
%o A384628         j2 = n//k1+1
%o A384628         c += (j2-j)*gcd(n,k1)
%o A384628         j, k1 = j2, n//j2
%o A384628     return c-j # _Chai Wah Wu_, Jun 17 2025
%Y A384628 Cf. A000040, A000203, A005408, A018804.
%K A384628 nonn
%O A384628 1,2
%A A384628 _Ctibor O. Zizka_, Jun 05 2025