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.

A368277 Prime numbers that have an even number of monotone Bacher representations (A368276).

This page as a plain text file.
%I A368277 #26 Apr 26 2025 01:30:07
%S A368277 5,7,13,17,23,43,53,59,61,71,79,83,107,109,113,127,131,137,139,167,
%T A368277 181,191,193,199,211,223,227,239,241,257,271,277,293,307,313,317,331,
%U A368277 337,347,353,359,367,379,389,401,421,431,439,449,457,461,467,479,499
%N A368277 Prime numbers that have an even number of monotone Bacher representations (A368276).
%C A368277 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 A368277 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.
%e A368277 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 A368277 t[n_]:=t[n]=Select[Divisors[n],#^2<=n&];
%t A368277 A368276[n_]:=Total[t[n]]+Sum[Boole[wx<d*dx],{wx,Floor[n/2]},{dx,t[wx]},{d,t[n-wx]}];
%t A368277 Select[Prime[Range[200]],EvenQ[A368276[#]]&] (* _Paolo Xausa_, Jan 02 2024 *)
%o A368277 (Julia)
%o A368277 using Nemo
%o A368277 println([n for n in 1:500 if iseven(A368276(n)) && is_prime(n)])
%o A368277 (Python)
%o A368277 from itertools import takewhile, islice
%o A368277 from sympy import nextprime, divisors
%o A368277 def A368277_gen(startvalue=2): # generator of terms >= startvalue
%o A368277     p = max(nextprime(startvalue-1),2)
%o A368277     while True:
%o A368277         c = sum(takewhile(lambda x:x**2<=p,divisors(p))) &1
%o A368277         for wx in range(1,(p>>1)+1):
%o A368277             for d1 in divisors(wx):
%o A368277                 if d1**2 > wx:
%o A368277                     break
%o A368277                 m = p-wx
%o A368277                 c = c+sum(1 for d in takewhile(lambda x:x**2<=m,divisors(m)) if wx<d*d1)&1
%o A368277         if c^1:
%o A368277             yield p
%o A368277         p = nextprime(p)
%o A368277 A368277_list = list(islice(A368277_gen(),30)) # _Chai Wah Wu_, Dec 19 2023
%Y A368277 Cf. A368276, A368278, A368207.
%K A368277 nonn
%O A368277 1,1
%A A368277 _Peter Luschny_, Dec 19 2023