A368580 a(n) = Sum_{d|n and d^2 <= n} (1 + [d^2 < n]) * (2*d - 1), where [.] denote the Iverson brackets.
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, 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, 48, 12, 8, 2, 72, 2, 8, 38, 37, 20, 40, 2, 22, 12, 52, 2, 84, 2, 8
Offset: 1
Keywords
Examples
Below are the monotone Bacher representations of n = 27 listed. W(0, 0, 1, 27) = 2; W(0, 0, 3, 9) = 2; W(0, 1, 3, 9) = 4; W(0, 2, 3, 9) = 4; W(1, 1, 2, 13) = 2; W(1, 2, 5, 5) = 2; W(1, 3, 4, 6) = 4. Thus a(27) = 2 + 2 + 4 + 4 = 12. Adding all weights gives A368207(27) = 20. For instance, the integers n = 6, 8, and 12 have only degenerated Bacher representation, so for these cases, a(n) = A368207(n).
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
- Roland Bacher, A quixotic proof of Fermat's two squares theorem for prime numbers, American Mathematical Monthly, Vol. 130, No. 9 (November 2023), 824-836; arXiv version, arXiv:2210.07657 [math.NT], 2022.
Programs
-
Julia
using Nemo function A368580(n) sum(d * d == n ? d * 2 - 1 : d * 4 - 2 for d in (d for d in divisors(n) if d * d <= n)) end println([A368580(n) for n in 1:74])
-
Mathematica
A368580[n_]:=DivisorSum[n,(1+Boole[#^2
A368580,100] (* Paolo Xausa, Jan 01 2024 *)
Comments