In order to do this, we will show that if the sequence is *alagoana*, then an cannot have any prime factor.
Consider a prime p. For every positive integer n, let α(n) be the exponent of p in the factorization of an. We will prove that α(n)=0 for every n.
By the second condition on the sequence, we know that α(n) is a multiple of n; that is, there exists a non-negative integer kn such that α(n)=n⋅kn. From the first condition, we have that an!=a1⋅a2⋅⋯⋅an. This implies that α(n!)=α(1)+α(2)+⋯+α(n). In particular, α(n!)=α(n)+α((n−1)!), so α(n)=α(n!)−α((n−1)!), that is, n⋅kn=n!⋅kn!−(n−1)!⋅k(n−1)!. Defining β(n)=(n−1)!, we have
kn=nβ(n)(n⋅kn!−kβ(n)).(1)
For n≥4, we will show, recursively, that βj(n) divides α(n) for every positive integer j, where βj(n) is the function β applied j times. To this end, we will apply formula (1) recursively. We first establish some facts we will use.
Let γm=m!β(m!) be the factor appearing in formula (1) when applied to n=m!. Note that, for m≥3, γm is an integer (since m!−1>m) and divides km!. In addition, γm divides γm+1, since (m+1)!((m+1)!−1)!=m+11⋅((m+1)!−1)((m+1)!−2)⋯m!⋅m!(m!−1)!, and (m+1)!−(m+1)=(m+1)(m!−1)>m!; then, γm divides γn for every n>m≥3. Now, we will prove recursively that, for every positive integer j, we have that
kn=nβj(n)⋅Nj.
where Nj is an integer that can be expressed as a sum of 2j multiples of integers of the form km!, where the smallest subindex m! that appears is βj(n).
For j=1, the statement is clear from identity (1), since β(n)=(n−1)!.
Assume the result holds for j≥1. Since every term in the expression of Nj is a multiple of km! for an integer m, and the smallest of the integers m involved is βj−1(n)−1 (since, by definition, βj(n):=(βj−1(n)−1)!), it follows that each term is a multiple of γβj−1(n)−1=(βj−1(n)−1)!β((βj−1(n)−1)!)=βj(n)βj+1(n). Moreover, as a consequence of identity (1) applied to m!, the quotient in the division of km! by γβj−1(n)−1 can be written as a sum of a multiple of k(m!)! and a multiple of kβ(m!). Then, Nj is a multiple of βj(n)βj+1(n), and the quotient Nj+1 can be expressed as a sum of 2j+1 terms that are multiples of integers of the form km!, where the smallest subindex that appears is β(βj(n))=βj+1(n) (note that, if m1>m2, then m1!>β(m1)=(m1−1)!≥m2!>(m2−1)!=β(m2)). We conclude that
kn=nβj(n)⋅Nj=nβj(n)βj(n)βj+1(n)⋅Nj+1=nβj+1(n)⋅Nj+1,
as we wanted to prove.
Thus, if n≥4, for every positive integer j, we can write α(n)=n⋅kn=βj(n)⋅Nj for a non-negative integer Nj.
Finally, to conclude that α(n)=0 for all n≥4, we notice that βj(n)>2j for every j; for j=1, β(n)=(n−1)!≥6>2, since n≥4, and for j≥1, βj(n)βj+1(n)=m(m−1)!≥2, since (m−1)!≥2m for every integer m≥4.
The remaining cases follow now easily from the identity α(1)+α(2)+α(3)=α(3!)=α(6)=0, which implies that α(1)=α(2)=α(3)=0.