%I #33 Dec 20 2021 02:44:23
%S 0,1,2,3,2,7,2,5,4,7,2,17,2,7,12,7,2,13,2,17,12,7,2,27,4,7,6,17,2,37,
%T 2,9,12,7,12,31,2,7,12,27,2,37,2,17,22,7,2,37,4,13,12,17,2,19,12,27,
%U 12,7,2,87,2,7,22,11,12,37,2,17,12,37,2,49,2,7,22
%N a(n) is the number of solutions for n^4 = z^2 - x^2 with {z,x} >= 1.
%C If n is an odd prime^i, the number of solutions is 2*i.
%C If n = 2^i, the number of solutions is 2*i-1.
%C These two facts are not generally valid in reverse for terms > 6.
%C If a(n) = 2, n is an odd prime. This is generally valid in reverse.
%C For more information about these facts see the link.
%C The calculation of the terms is done with an algorithm of _Jon E. Schoenfield_, which is described in A349324.
%C Conditions to be satisfied for a valid, countable solution:
%C - z cannot be a square.
%C - z must have at least one prime factor of the form p == 1 (mod 4), a Pythagorean prime (A002144).
%C - If z has prime factors of the form p == 3 (mod 4), which are in A002145, then they must appear in the prime divisor sets of x and n too.
%C - If z is even, x and n must be even too.
%C - The lower limit of the ratio x/n is sqrt(2).
%C - high limits of z and x:
%C | n is odd | n is even
%C ---------+------------------+------------------
%C z limit | (n^4 + 1)/2 | (n^4 + 4)/4
%C x limit | (n^4 + 1)/2 - 1 | (n^4 + 4)/4 - 2
%H Karl-Heinz Hofmann, <a href="/A349664/b349664.txt">Table of n, a(n) for n = 1..10000</a>
%H Karl-Heinz Hofmann, <a href="/A349664/a349664_1.pdf">What the terms can tell about n</a>.
%e a(6) = 7 (solutions): 6^4 = 1296 = 325^2 - 323^2 = 164^2 - 160^2 = 111^2 - 105^2 = 85^2 - 77^2 = 60^2 - 48^2 = 45^2 - 27^2 = 39^2 - 15^2.
%t a[n_] := Length[Solve[n^4 == z^2 - x^2 && x >= 1 && z >= 1, {x, z}, Integers]]; Array[a, 75] (* _Amiram Eldar_, Dec 14 2021 *)
%o (PARI) a(n) = numdiv(if(n%2, n^4, n^4/4))\2; \\ _Jinyuan Wang_, Dec 19 2021
%Y Cf. A000290, A000583, A271576, A349663, A002144, A002145, A346115.
%Y Cf. A345645, A345700, A345968, A346110, A348655, A349324.
%K nonn
%O 1,3
%A _Karl-Heinz Hofmann_, Dec 13 2021
|