OFFSET
1,2
COMMENTS
We can use the Bacher numbers A368207 to measure the primeness of a positive integer, similar to how the number of prime factors of an integer does, but based on the number of representations of n as w*x + y*z with max(w, x) < min(y, z). Taking b(n) = 2*(Bacher(n) - sigma(n)) + n + 1 as the measure, Bacher's theorem shows that b(n) = 0 if n is an odd prime. Conversely, if b(n) = 0, we cannot conclude that n is prime as the example n = 35 shows, but this is probably the only exception.
This sequence gives the integers k for which b(k) is positive, and A368459 provides those for which b(k) is negative.
Apart from the first three terms, all terms are apparently odd semiprimes (A046315); they are odd composite numbers that cannot be divided by smaller composite numbers.
LINKS
Peter Luschny, Table of n, a(n) for n = 1..1000
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.
EXAMPLE
To zoom into the internal order of the terms, the sequence can also be written as an irregular triangle (for n >= 3). It starts:
4;
9;
25;
49;
121, 143;
169, 221;
289, 323;
361, 391, 437;
529, 667, 713;
841, 899;
961, 1073, 1147, 1271, 1333;
1369, 1517, 1591;
1681, 1739, 1763,
1849, 1927, 2021, 2173;
PROG
(SageMath)
from itertools import islice
def A368207(n):
def t(n): return (d for d in divisors(n) if d*d <= n)
def s(d): return 2*d - 1 if d*d == n else 4*d - 2
def c(y, w, wx): return max(1, 2*((w*w < wx) + (y*y < n - wx)))
return sum((sum(sum((c(y, w, wx) for y in t(n-wx) if wx < y*w), start=0)
for w in t(wx)) for wx in range(1, n//2)),
start=sum(s(d) for d in t(n)))
def isA368458(n): return 0 < A368457(n)
def A368458Gen(n):
while True:
if isA368458(n): yield n
n += 1
def A368458List(start, size): return list(islice(A368458Gen(start), size))
print(A368458List(1, 20))
(Julia)
using Nemo
function A368458List(slicenum::Int)
results = [Int[] for _ in 1:slicenum + 1]
slicelen = 1000
Threads.@threads for sl in 1:slicenum
first = (sl - 1) * slicelen + 1
last = first + slicelen - 1
result = results[sl]
for n in first:2:last
rem(n, 5) == 0 && continue
if 2 * (divisor_sigma(n, 1) - A368207(n)) < n + 1
push!(result, n)
end end end
results[slicenum + 1] = [2, 4, 25]
sort(reduce(vcat, results))
end
print(A368458List(5)) # returns values up to param * 1000
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Dec 26 2023
STATUS
approved