login
a(n) = number of triples (x, y, z) such that x^2 + y*z = n, where x, y, z are distinct primes and y < z.
12

%I #14 Apr 19 2026 16:35:02

%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,1,0,0,0,0,0,2,0,0,

%T 0,1,0,1,0,2,0,0,0,2,1,0,1,2,0,0,0,1,0,0,0,3,0,0,1,3,0,1,0,1,3,0,0,1,

%U 0,1,0,3,0,1,1,1,1,0,0,0,0,1,2,3,0,0

%N a(n) = number of triples (x, y, z) such that x^2 + y*z = n, where x, y, z are distinct primes and y < z.

%C Also, number of primes p not dividing n such that n - p^2 is a semiprime but not a square. - _M. F. Hasler_, Apr 11 2026

%e a(19) = 2 counts these triples: (2, 3, 5), (3, 2, 5).

%t t[n_, c_] := Module[{r}, r = Flatten[Table[If[n - x^2 <= 0, {},

%t Map[({x, #, Quotient[n - x^2, #]} &),

%t Select[Divisors[n - x^2], Divisible[n - x^2, #] &]]], {x, 1,

%t Floor[Sqrt[n - 1]]}], 1]; Select[r, Apply[c, #] &]];

%t c = (PrimeQ[#1] && PrimeQ[#2] && PrimeQ[#3] && #2 < #3 &&

%t DuplicateFreeQ[{#1, #2, #3}] &);

%t Join[{0}, Table[Length[t[n, c]], {n, 1, 130}]]

%t (* _Peter J. C. Moses_, Mar 29 2026 *)

%o (PARI) apply( {A394740(n,c=0)=n>6&&forprime(p=2,sqrtint(n-6),n%p&& bigomega(n-p^2)==2 &&!issquare(n-p^2)&&c++);c}, [0..99])

%Y Cf. A393710, A394741, A394742.

%K nonn

%O 0,20

%A _Clark Kimberling_, Apr 09 2026