Arithmetic/Rational: Difference between revisions

Content added Content deleted
Line 684: Line 684:
is_perfect_rational=: 2= +/@:%@,@factors</lang>
is_perfect_rational=: 2= +/@:%@,@factors</lang>


Exhaustive testing would take forever:
<lang j> I.is_perfect_rational@"0 i.2^19
<lang j> I.is_perfect_rational@"0 i.2^19
6 28 496 8128
6 28 496 8128
I.is_perfect_rational@x:@"0 i.2^19x
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 28 496 8128</lang>