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 A368580 #22 Jan 01 2024 09:06:01 %S A368580 1,2,2,5,2,8,2,8,7,8,2,18,2,8,12,15,2,18,2,22,12,8,2,32,11,8,12,22,2, %T A368580 36,2,22,12,8,20,43,2,8,12,40,2,40,2,22,30,8,2,54,15,26,12,22,2,40,20, %U A368580 48,12,8,2,72,2,8,38,37,20,40,2,22,12,52,2,84,2,8 %N A368580 a(n) = Sum_{d|n and d^2 <= n} (1 + [d^2 < n]) * (2*d - 1), where [.] denote the Iverson brackets. %C A368580 A quadruple (w, x, y, z) of nonnegative integers is a 'Bacher representation' of n if and only if n = w*x + y*z and max(w,x) < min(y,z). %C A368580 A Bacher representation is 'monotone' if additionally w <= x <= y <= z. %C A368580 A Bacher representation is 'degenerated' if w = 0. The weight of a Bacher representation is defined as %C A368580 W(w, x, y, z) = max(1, 2*([w < x] + [y < z])). %C A368580 a(n) is the sum of the weights of all degenerated monotone Bacher representations of n. The complementary sum of weights of nondegenerated monotone Bacher representations is A368581. %H A368580 Paolo Xausa, <a href="/A368580/b368580.txt">Table of n, a(n) for n = 1..10000</a> %H A368580 Roland Bacher, <a href="https://doi.org/10.1080/00029890.2023.2242034">A quixotic proof of Fermat's two squares theorem for prime numbers</a>, American Mathematical Monthly, Vol. 130, No. 9 (November 2023), 824-836; <a href="https://arxiv.org/abs/2210.07657">arXiv version</a>, arXiv:2210.07657 [math.NT], 2022. %F A368580 a(p) = 2 for all prime p. %F A368580 a(n) is odd if and only if n is a square. %F A368580 a(n) + A368581(n) = A368207(n). %e A368580 Below are the monotone Bacher representations of n = 27 listed. %e A368580 W(0, 0, 1, 27) = 2; %e A368580 W(0, 0, 3, 9) = 2; %e A368580 W(0, 1, 3, 9) = 4; %e A368580 W(0, 2, 3, 9) = 4; %e A368580 W(1, 1, 2, 13) = 2; %e A368580 W(1, 2, 5, 5) = 2; %e A368580 W(1, 3, 4, 6) = 4. %e A368580 Thus a(27) = 2 + 2 + 4 + 4 = 12. Adding all weights gives A368207(27) = 20. %e A368580 For instance, the integers n = 6, 8, and 12 have only degenerated Bacher representation, so for these cases, a(n) = A368207(n). %t A368580 A368580[n_]:=DivisorSum[n,(1+Boole[#^2<n])(2#-1)&,#^2<=n&]; %t A368580 Array[A368580,100] (* _Paolo Xausa_, Jan 01 2024 *) %o A368580 (Julia) %o A368580 using Nemo %o A368580 function A368580(n) %o A368580 sum(d * d == n ? d * 2 - 1 : d * 4 - 2 %o A368580 for d in (d for d in divisors(n) if d * d <= n)) %o A368580 end %o A368580 println([A368580(n) for n in 1:74]) %Y A368580 Cf. A368207, A368276, A368581. %K A368580 nonn %O A368580 1,2 %A A368580 _Peter Luschny_, Dec 31 2023