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.

A368276 Number of nonnegative representations of n = w*x + y*z with max(w, x) < min(y, z) and w <= x <= y <= z.

This page as a plain text file.
%I A368276 #40 Apr 26 2025 01:30:12
%S A368276 1,1,1,3,2,3,2,3,5,4,3,6,4,4,5,9,4,7,5,9,6,7,4,11,11,7,7,11,7,13,7,10,
%T A368276 9,10,9,19,9,9,10,17,9,17,8,14,14,13,7,21,17,14,13,17,10,20,13,22,14,
%U A368276 15,10,26,14,13,18,28,15,22,13,19,17,25,12,33,15,18
%N A368276 Number of nonnegative representations of n = w*x + y*z with max(w, x) < min(y, z) and w <= x <= y <= z.
%C A368276 Number of monotone Bacher representations (A368207) of n. We call a quadruple (w, x, y, z) of nonnegative integers a monotone Bacher representation of n if and only if n = w*x + y*z and w <= x < y <= z.
%H A368276 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], 2023.
%e A368276 For n = 13, the 4 solutions are (w, x, y, z) = (0, 0, 1, 13), (1, 1, 2, 6), (1, 1, 3, 4), (2, 2, 3, 3).
%t A368276 t[n_]:=t[n]=Select[Divisors[n],#^2<=n&];
%t A368276 A368276[n_]:=Total[t[n]]+Sum[Boole[wx<d*dx],{wx,Floor[n/2]},{dx,t[wx]},{d,t[n-wx]}];
%t A368276 Array[A368276,100] (* _Paolo Xausa_, Jan 02 2024 *)
%o A368276 (Python)
%o A368276 from itertools import takewhile
%o A368276 from sympy import divisors
%o A368276 def A368276(n):
%o A368276     c = sum(takewhile(lambda x: x**2 <= n, divisors(n)))
%o A368276     for wx in range(1, (n >> 1) + 1):
%o A368276         for d1 in divisors(wx):
%o A368276             if d1**2 > wx:
%o A368276                 break
%o A368276             m = n - wx
%o A368276             c += sum(1
%o A368276                 for d in takewhile(lambda x: x**2 <= m, divisors(n - wx))
%o A368276                 if wx < d * d1)
%o A368276     return c  # _Chai Wah Wu_, Dec 19 2023
%o A368276 (Julia)
%o A368276 using Nemo
%o A368276 function A368276(n)
%o A368276     t(n) = (d for d in divisors(n) if d * d <= n)
%o A368276     sum(sum(sum(1 for d in t(n - wx) if wx < d * dx; init=0)
%o A368276             for dx in t(wx)) for wx in 1:div(n, 2); init=sum(t(n)))
%o A368276 end
%o A368276 println([A368276(n) for n in 1:74])  # _Peter Luschny_, Dec 19 2023
%Y A368276 Cf. A368207, A368276, A368457, A368458, A368459, A368580, A368581.
%K A368276 nonn
%O A368276 1,4
%A A368276 _Peter Luschny_, Dec 19 2023