cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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, 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, 32, 45, 10, 16, 0, 16, 7, 20, 0, 74, 0, 6, 68, 18, 11, 18, 0, 55, 65, 6, 0
Offset: 4

Views

Author

Hugo Pfoertner, May 27 2024

Keywords

Examples

			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.
		

Crossrefs

Cf. A057918 (see 1st comment there).

Programs

  • 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

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
Showing 1-1 of 1 results.