The answer is n=3,4,5,7.
We first introduce a variant of the kth Chebyshev polynomials in the following lemma (which is standard, and easily shown by induction).
Lemma
For each k≥0 there exists Pk(X)∈Z[X], monic for k≥1 and with degree k, such that
Pk(X+X−1)≡Xk+X−k.
The first few are P0(X)≡2, P1(X)≡X, P2(X)≡X2−2, P3(X)≡X3−3X.
Suppose the angles of the triangle are α<β<γ, so the law of cosines implies that
2cosα=n+1n+4and2cosγ=n−1n−4.
Claim — The triangle is quirky iff there exists r,s∈Z≥0 not both zero such that
cos(rα)=±cos(sγ)or equivalentlyPr(n+1n+4)=±Ps(n−1n−4).
*Proof.* If there are integers x,y,z for which xα+yβ+zγ=0, then we have that (x−y)α=(y−z)γ−πy, whence it follows that we may take r=∣x−y∣ and s=∣y−z∣ (noting r=s=0 implies the absurd x=y=z). Conversely, given such r and s with cos(rα)=±cos(sγ), then it follows that rα±sγ=kπ=k(α+β+γ) for some k, so the triangle is quirky. □
If r=0, then by rational root theorem on Ps(X)±2 it follows n−1n−4 must be an integer which occurs only when n=4 (recall n≥3). Similarly we may discard the case s=0.
Thus in what follows assume n=4 and r,s>0. Then, from the fact that Pr and Ps are nonconstant monic polynomials, we find
Corollary
If n=4 works, then when n+1n+4 and n−1n−4 are written as fractions in lowest terms, the denominators have the same set of prime factors.
But gcd(n+1,n−1) divides 2, and gcd(n+4,n+1), gcd(n−4,n−1) divide 3. So we only have three possibilities:
* n+1=2u and n−1=2v for some u,v≥0. This is only possible if n=3. Here 2cosα=47 and 2cosγ=−21, and indeed P2(−1/2)=−7/4.
* n+1=3⋅2u and n−1=2v for some u,v≥0, which implies n=5. Here 2cosα=23 and 2cosγ=41, and indeed P2(3/2)=1/4.
* n+1=2u and n−1=3⋅2v for some u,v≥0, which implies n=7. Here 2cosα=811 and 2cosγ=21, and indeed P3(1/2)=−11/8.
Finally, n=4 works because the triangle is right, completing the solution.