login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A368581
The sum of weights of nondegenerated monotone Bacher representations of n.
3
0, 0, 0, 0, 1, 0, 2, 0, 2, 1, 4, 0, 5, 4, 2, 4, 7, 2, 8, 5, 4, 10, 10, 2, 9, 13, 8, 8, 13, 8, 14, 10, 12, 19, 10, 8, 17, 22, 16, 9, 19, 18, 20, 20, 11, 28, 22, 16, 20, 21, 24, 27, 25, 26, 16, 24, 28, 37, 28, 16, 29, 40, 24, 34, 22, 34, 32, 41, 36, 28, 34, 28
OFFSET
1,7
COMMENTS
For the definition of 'Bacher representation' and related notions, see the comments in A368580.
LINKS
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.
FORMULA
a(n) = Sum_{k in K} Sum_{w in W} Sum_{y in Y} max(1, 2*([w^2 < k] + [y^2 < n - k])), where the square brackets denote Iverson brackets and k in K <=> 1 <= k <= floor(n/2), w in W <=> w|k and w^2 <= k, and y in Y <=> y|n-k and y^2 <= n-k and k < y*w. (See the Julia implementation.)
a(n) + A368580(n) = A368207(n).
a(p) = (p + 1) / 2 - 2 for all odd prime p.
EXAMPLE
See the example in A368580.
MATHEMATICA
t[n_]:=t[n]=Select[Divisors[n], #^2<=n&];
A368581[n_]:=Sum[If[wx<y*w, Max[1, 2(Boole[w^2<wx]+Boole[y^2<n-wx])], 0], {wx, Floor[n/2]}, {w, t[wx]}, {y, t[n-wx]}];
Array[A368581, 100] (* Paolo Xausa, Jan 02 2024 *)
PROG
(Julia)
using Nemo
function A368581(n::Int)
t(n) = (d for d in divisors(n) if d * d <= n)
c(y, w, wx) = max(1, 2 * (Int(w * w < wx) + Int(y * y < n - wx)))
sum(sum(sum(c(y, w, wx) for y in t(n - wx) if wx < y * w; init=0)
for w in t(wx)) for wx in 1:div(n, 2); init=0)
end
println([A368581(n) for n in 1:72])
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Dec 31 2023
STATUS
approved