5 of 9
added 574 characters in body
user avatar
user avatar
Io, (削除) 85 (削除ここまで) 78 bytes
Doesn't work for huge numbers. Historical submissions
method(i,c :=0;i repeat(I,if(i%(I+2)<1,c=c+1;while(i%(I+2)<1,i=i/(I+2))));c<2)
Explanation
method(i, // Take an input
c := 0 // Hold a counter of prime factors
i repeat(I, // Repeat i times (counter I):
if(i%(I+2)<1, // If i is divisible by I+2:
c=c+1 // Add counter by 1
while(i%(I+2)<1, // While i is divisible by I+2:
i=i/(I+2) // Divide i by I+2
)))
c<2 // Is the factor counter equal to 1?
)
user96495