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.

Showing 1-3 of 3 results.

A368457 a(n) = 2*(Bacher(n) - sigma(n)) + n + 1 = 2*(A368207(n) - A000203(n)) + n + 1.

Original entry on oeis.org

2, 1, 0, 1, 0, -1, 0, -5, 2, -7, 0, -7, 0, -9, -4, -7, 0, -19, 0, -9, -10, -13, 0, -27, 4, -15, -12, -23, 0, -25, 0, -29, -14, -19, 0, -43, 0, -21, -16, -41, 0, -33, 0, -39, -28, -25, 0, -59, 6, -41, -20, -45, 0, -53, -16, -39, -22, -31, 0, -99, 0, -33, -20
Offset: 1

Views

Author

Peter Luschny, Dec 26 2023

Keywords

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 where max(w, x) < min(y, z).
Bacher's theorem shows that a(n) = 0 if n is an odd prime. Conversely, if a(n) = 0, we cannot conclude that n is prime as the example n = 35 shows, but this is probably the only exception.
Of the first 32,000 terms, approximately 88% are less than 0, 11% are equal to 0, and 1% are greater than 0. A368458 gives the indices for which a(n) is positive, and A368459 those for which a(n) is negative.
It appears that a(p^2) = p - 1 (A006093) for all prime p, following the observation by Knuth that apparently A368207(p^2) = (p^2 + 3*p)/2.

Crossrefs

Programs

  • Julia
    using Nemo
    A368457(n) = 2 * (A368207(n) - divisor_sigma(n, 1)) + n + 1
    println([A368457(n) for n in 1:63])
  • Mathematica
    t[n_]:=t[n]=Select[Divisors[n], #^2<=n&];
    A368207[n_]:=Sum[(1+Boole[d^2A368457[n_]:=2(A368207[n]-DivisorSigma[1,n])+n+1;
    Array[A368457, 100] (* Paolo Xausa, Jan 02 2024 *)

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

Original entry on oeis.org

1, 2, 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, 2209, 2279, 2491, 2537, 2773, 2809, 2867, 3127, 3233, 3481, 3551, 3599, 3721, 3763
Offset: 1

Views

Author

Peter Luschny, Dec 26 2023

Keywords

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.

Examples

			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;
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.
		

Crossrefs

Programs

  • 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
  • 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 A368457(n): return 2 * (A368207(n) - sigma(n)) + n + 1
    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))
    

Formula

k is a term <=> A368457(k) > 0 <=> 2*(A368207(k) - A000203(k)) + k + 1 > 0.

A368459 Numbers k such that 2*(Bacher(k) - sigma(k)) + k + 1 < 0.

Original entry on oeis.org

6, 8, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 33, 34, 36, 38, 39, 40, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95
Offset: 1

Views

Author

Peter Luschny, Dec 26 2023

Keywords

Comments

Complementary to A368458, this sequence lists the indices of negative values of A368457. See the comments in A368458.
In summary, A368458 U A368459 U Primes U {35, ...} decomposes the positive integers into disjoint sets, whereby the nature of the fourth set is currently unclear; probably, it has only 35 as a member.

Crossrefs

Programs

  • Julia
    println([n for n in 1:95 if A368457(n) < 0])

Formula

k is a term <=> A368457(k) < 0 <=> 2*(A368207(k) - A000203(k)) + k + 1 < 0.
Showing 1-3 of 3 results.