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”).

Prime numbers that have an odd number of monotone Bacher representations (A368276).
1

%I #25 Jan 02 2024 08:40:57

%S 2,3,11,19,29,31,37,41,47,67,73,89,97,101,103,149,151,157,163,173,179,

%T 197,229,233,251,263,269,281,283,311,349,373,383,397,409,419,433,443,

%U 463,487,491,521,523,557,577,587,601,607,619,659,661,673,677,701,719

%N Prime numbers that have an odd number of monotone Bacher representations (A368276).

%C 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 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 For n = 19, the 5 solutions are (w, x, y, z) = (0, 0, 1, 19), (1, 1, 2, 9), (1, 1, 3, 6), (1, 3, 4, 4), (2, 2, 3, 5).

%t t[n_]:=t[n]=Select[Divisors[n],#^2<=n&];

%t A368276[n_]:=Total[t[n]]+Sum[Boole[wx<d*dx],{wx,Floor[n/2]},{dx,t[wx]},{d,t[n-wx]}];

%t Select[Prime[Range[200]],OddQ[A368276[#]]&] (* _Paolo Xausa_, Jan 02 2024 *)

%o (Julia)

%o using Nemo

%o println([n for n in 1:720 if isodd(A368276(n)) && is_prime(n)])

%o (Python)

%o from itertools import takewhile, islice

%o from sympy import divisors, nextprime

%o def A368278_gen(startvalue=2): # generator of terms >= startvalue

%o p = max(nextprime(startvalue-1),2)

%o while True:

%o c = sum(takewhile(lambda x:x**2<=p,divisors(p))) & 1

%o for wx in range(1,(p>>1)+1):

%o for d1 in divisors(wx):

%o if d1**2 > wx:

%o break

%o m = p-wx

%o c = c+sum(1 for d in takewhile(lambda x:x**2<=m,divisors(m)) if wx<d*d1)&1

%o if c:

%o yield p

%o p = nextprime(p)

%o A368278_list = list(islice(A368278_gen(),30)) # _Chai Wah Wu_, Dec 19 2023

%Y Cf. A368276, A368277, A368207.

%K nonn

%O 1,1

%A _Peter Luschny_, Dec 19 2023