OFFSET
4,5
LINKS
David A. Corneth, Table of n, a(n) for n = 4..10000 (terms to n = 2000 from Hugo Pfoertner)
FORMULA
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
EXAMPLE
a(6) = 1: 2*3*6 = 6^2;
a(8) = 2: 2*4*8 = 8^2, 3*6*8 = 12^2;
a(9) = 1: 2*8*9 = 12^2;
a(10) = 2: 2*5*10 = 10^2, 5*8*10 = 20^2.
PROG
(PARI) a(n) = my(s=0); for(j=2, n-2, for(k=j+1, n-1, if(issquare(j*k*n), s++))); s
(PARI) a(n) = {
my(f = factor(n), c = core(f), res = (issquare(n) && n > 1), u, s);
u = sqrtint((n-1)\c);
for(i = 1, u,
res+=(numdiv(c*i^2)\2);
);
res-=u;
for(i = u+1, sqrtint((n^2 - 1)\c),
d = divisors(c*i^2);
s = select(x->x>=n, d);
res+=((#d - 2*#s)>>1)
);
res
} \\ David A. Corneth, May 27 2024
(Python)
from sympy.ntheory.primetest import is_square
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, May 27 2024
STATUS
approved