Cyclotomic polynomial: Difference between revisions

m
Line 2,014:
 
=={{header|J}}==
 
For values up to 70, we can find cyclotomic polynomials by finding a polynomial with roots of unity relatively prime to the order of the polynomial:
 
<lang J>cyclo=: {{<.-:1+(++) p. 1;^0j2p1* y%~1+I.1=y+.1+i.y}}</lang>
 
This approach suggests that cyclotomic polynomial zero should be <tt>f<sub>0(x)</sub>= 1</tt>
 
Implementation of routine to find nth cyclotomic polynomial:
 
<lang J>{{ if.0>nc<'cache' do.cache=:y end.}} a:(,1);_1 1
 
cyclotomic=: {{
6,962

edits