OFFSET
1,1
COMMENTS
Contains A388851 (except for 4).
Any number of the form n^2*m with n,m>1 lies in the sequence since (m-1)!*m!*(n^2*m-1)!*(n^2*m)! is a perfect square. Also, any number of the form p^2 with p an odd prime lies in the sequence since 3!*4!*(p^2-1)!*p^2! is a perfect square. Thus the sequence contains A013929 (except for 4), which is conjectured by Erdős and Graham to be the dominant portion of this sequence (see also Erdős problem 374).
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
Thomas Bloom, Problem 374, Erdős Problems.
P. Erdős and R. L. Graham, On products of factorials, Bull. Inst. Math. Acad. Sinica 4 (1976), pp. 337-355.
P. Erdős and R. L. Graham, Old and new problems and results in combinatorial number theory, Monographies de L'Enseignement Mathématique (1980).
EXAMPLE
6 lies in the sequence because 1!*3!*5!*6! = 720^2 is a perfect square.
PROG
(Python) import math
def is_square(n):
r = math.isqrt(n)
return r * r == n
def test(d):
for c in range(1, d):
for b in range(1, c):
for a in range(1, b):
val = math.factorial(d) // math.factorial(c)
val *= math.factorial(b) // math.factorial(a)
if is_square(val):
return True
return False
(Python)
from math import prod
from itertools import count, islice
from sympy import factorint, integer_nthroot, isprime
def A387184_gen(): # generator of terms
g, p, r = [set()], 0, {}
for c in count(2):
f = factorint(c)
d = g[-1]^set(i for i, j in f.items() if j&1)
for h in g:
if (t:=prod(d^h)) not in r:
r[t] = c-1
g.append(d)
x, y = integer_nthroot(c, 2)
if c>4 and y and isprime(x):
yield c
elif c>4 and max(f.values())>1:
yield c
else:
for b in range(c-2, p, -1):
e = prod(d^g[b])
if e in r and r[e]<b:
yield c
break
if isprime(c):
p = c-2
CROSSREFS
KEYWORD
nonn
AUTHOR
Terence Tao, Sep 23 2025
STATUS
approved
