login
a(n) is the number of products P = j*k*n, 1 < j < k < n, such that P is a square.
2

%I #36 May 31 2024 05:54:17

%S 0,0,1,0,2,1,2,0,4,0,2,3,3,0,10,0,8,3,3,0,11,9,3,17,10,0,10,0,25,5,4,

%T 6,18,0,4,5,19,0,12,0,12,25,4,0,34,29,48,6,15,0,43,9,25,7,5,0,31,0,5,

%U 32,45,10,16,0,16,7,20,0,74,0,6,68,18,11,18,0,55,65,6,0

%N a(n) is the number of products P = j*k*n, 1 < j < k < n, such that P is a square.

%H David A. Corneth, <a href="/A373043/b373043.txt">Table of n, a(n) for n = 4..10000</a> (terms to n = 2000 from Hugo Pfoertner)

%F a(n) = 0 for prime n. a(n) > 0 for composite n > 4. Proof: If n is square, then m = i*j*n = 2*8*n = 16*n is square and a(n) > 0. If n is a nonsquare composite, then we can write it as n = j*k where 1 < j < k < n and so j*k*n = j*k*j*k = (j*k)^2 is a square and a(n) > 0 as well. - _David A. Corneth_, May 27 2024

%e a(6) = 1: 2*3*6 = 6^2;

%e a(8) = 2: 2*4*8 = 8^2, 3*6*8 = 12^2;

%e a(9) = 1: 2*8*9 = 12^2;

%e a(10) = 2: 2*5*10 = 10^2, 5*8*10 = 20^2.

%o (PARI) a(n) = my(s=0); for(j=2, n-2, for(k=j+1, n-1, if(issquare(j*k*n), s++))); s

%o (PARI) a(n) = {

%o my(f = factor(n), c = core(f), res = (issquare(n) && n > 1), u, s);

%o u = sqrtint((n-1)\c);

%o for(i = 1, u,

%o res+=(numdiv(c*i^2)\2);

%o );

%o res-=u;

%o for(i = u+1, sqrtint((n^2 - 1)\c),

%o d = divisors(c*i^2);

%o s = select(x->x>=n, d);

%o res+=((#d - 2*#s)>>1)

%o );

%o res

%o } \\ _David A. Corneth_, May 27 2024

%o (Python)

%o from sympy.ntheory.primetest import is_square

%o def A373043(n): return sum(1 for k in range(3,n) for j in range(2,k) if is_square(j*k*n)) # _Chai Wah Wu_, May 31 2024

%Y Cf. A007913, A372306, A373042.

%Y Cf. A057918 (see 1st comment there).

%K nonn

%O 4,5

%A _Hugo Pfoertner_, May 27 2024