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.

A368458 Numbers k such that 2*(Bacher(k) - sigma(k)) + k + 1 > 0.

This page as a plain text file.
%I A368458 #29 Oct 07 2024 02:03:51
%S A368458 1,2,4,9,25,49,121,143,169,221,289,323,361,391,437,529,667,713,841,
%T A368458 899,961,1073,1147,1271,1333,1369,1517,1591,1681,1739,1763,1849,1927,
%U A368458 2021,2173,2209,2279,2491,2537,2773,2809,2867,3127,3233,3481,3551,3599,3721,3763
%N A368458 Numbers k such that 2*(Bacher(k) - sigma(k)) + k + 1 > 0.
%C A368458 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.
%C A368458 This sequence gives the integers k for which b(k) is positive, and A368459 provides those for which b(k) is negative.
%C A368458 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.
%H A368458 Peter Luschny, <a href="/A368458/b368458.txt">Table of n, a(n) for n = 1..1000</a>
%H A368458 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.
%F A368458 k is a term <=> A368457(k) > 0 <=> 2*(A368207(k) - A000203(k)) + k + 1 > 0.
%e A368458 To zoom into the internal order of the terms, the sequence can also be written as an irregular triangle (for n >= 3). It starts:
%e A368458       4;
%e A368458       9;
%e A368458      25;
%e A368458      49;
%e A368458     121,  143;
%e A368458     169,  221;
%e A368458     289,  323;
%e A368458     361,  391, 437;
%e A368458     529,  667, 713;
%e A368458     841,  899;
%e A368458     961, 1073, 1147, 1271, 1333;
%e A368458    1369, 1517, 1591;
%e A368458    1681, 1739, 1763,
%e A368458    1849, 1927, 2021, 2173;
%e A368458 A row contains the terms between consecutive squares of primes, p^2 included and p'^2 excluded. The first column is the squares of primes A001248. The length of the rows is A368460.
%o A368458 (SageMath)
%o A368458 from itertools import islice
%o A368458 def A368207(n):
%o A368458     def t(n): return (d for d in divisors(n) if d*d <= n)
%o A368458     def s(d): return 2*d - 1 if d*d == n else 4*d - 2
%o A368458     def c(y, w, wx): return max(1, 2*((w*w < wx) + (y*y < n - wx)))
%o A368458     return sum((sum(sum((c(y, w, wx) for y in t(n-wx) if wx < y*w), start=0)
%o A368458     for w in t(wx)) for wx in range(1, n//2)),
%o A368458     start=sum(s(d) for d in t(n)))
%o A368458 def A368457(n): return 2 * (A368207(n) - sigma(n)) + n + 1
%o A368458 def isA368458(n): return 0 < A368457(n)
%o A368458 def A368458Gen(n):
%o A368458     while True:
%o A368458         if isA368458(n): yield n
%o A368458         n += 1
%o A368458 def A368458List(start, size): return list(islice(A368458Gen(start), size))
%o A368458 print(A368458List(1, 20))
%o A368458 (Julia)
%o A368458 using Nemo
%o A368458 function A368458List(slicenum::Int)
%o A368458     results = [Int[] for _ in 1:slicenum + 1]
%o A368458     slicelen = 1000
%o A368458     Threads.@threads for sl in 1:slicenum
%o A368458         first = (sl - 1) * slicelen + 1
%o A368458         last = first + slicelen - 1
%o A368458         result = results[sl]
%o A368458         for n in first:2:last
%o A368458             rem(n, 5) == 0 && continue
%o A368458             if 2 * (divisor_sigma(n, 1) - A368207(n)) < n + 1
%o A368458                 push!(result, n)
%o A368458     end end end
%o A368458     results[slicenum + 1] = [2, 4, 25]
%o A368458     sort(reduce(vcat, results))
%o A368458 end
%o A368458 print(A368458List(5)) # returns values up to param * 1000
%Y A368458 Cf. A000203, A046315, A001248, A368207, A368457, A368459, A368460.
%K A368458 nonn
%O A368458 1,2
%A A368458 _Peter Luschny_, Dec 26 2023