A373042 a(n) is the number of 3-element subsets {x,y,z} of {1,...,n} such that x*y*z is a square.
0, 0, 0, 1, 1, 4, 6, 8, 8, 13, 13, 15, 18, 23, 23, 35, 35, 44, 47, 50, 50, 62, 74, 77, 96, 107, 107, 117, 117, 145, 150, 154, 160, 182, 182, 186, 191, 211, 211, 223, 223, 236, 263, 267, 267, 304, 338, 390, 396, 412, 412, 457, 466, 492, 499, 504, 504, 536, 536, 541, 575
Offset: 3
Keywords
Examples
a(6) = a(7) = 1: 2*3*6 = 36. a(8) = 4: 1*2*8 = 16, 2*3*6 = 36, 2*4*8 = 64, 3*6*8 = 144.
Links
- Hugo Pfoertner, Table of n, a(n) for n = 3..2000
Programs
-
PARI
a(n) = my(k=0); forsubset([n,3], s, if(issquare(vecprod(Vec(s))), k++)); k
-
Python
from math import prod from itertools import combinations from sympy.ntheory.primetest import is_square def A373042(n): return sum(1 for p in combinations(range(1,n+1),3) if is_square(prod(p))) # Chai Wah Wu, May 30 2024