Jump to content

Arithmetic/Rational: Difference between revisions

Line 684:
is_perfect_rational=: 2= +/@:%@,@factors</lang>
 
Exhaustive testing would take forever:
<lang j> I.is_perfect_rational@"0 i.2^19
6 28 496 8128
I.is_perfect_rational@x:@"0 i.2^19x
6 28 496 8128</lang>
 
More limited testing takes reasonable amounts of time:
<lang j> (#~ is_perfect_rational"0) (* <:@+:) 2^i.10x
6 28 496 8128</lang>
 
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.