login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A368457
a(n) = 2*(Bacher(n) - sigma(n)) + n + 1 = 2*(A368207(n) - A000203(n)) + n + 1.
6
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,1
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.
LINKS
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.
MATHEMATICA
t[n_]:=t[n]=Select[Divisors[n], #^2<=n&];
A368207[n_]:=Sum[(1+Boole[d^2<n])(2d-1), {d, t[n]}]+Sum[If[wx<y*w, Max[1, 2(Boole[w^2<wx]+Boole[y^2<n-wx])], 0], {wx, Floor[n/2]}, {w, t[wx]}, {y, t[n-wx]}];
A368457[n_]:=2(A368207[n]-DivisorSigma[1, n])+n+1;
Array[A368457, 100] (* Paolo Xausa, Jan 02 2024 *)
PROG
(Julia)
using Nemo
A368457(n) = 2 * (A368207(n) - divisor_sigma(n, 1)) + n + 1
println([A368457(n) for n in 1:63])
KEYWORD
sign
AUTHOR
Peter Luschny, Dec 26 2023
STATUS
approved