Post Reply 
ifactors Test Problem
09-06-2017, 07:03 PM (This post was last modified: 09-06-2017 07:09 PM by toml_12953.)
Post: #3
RE: ifactors Test Problem
(09-06-2017 05:16 PM)Helge Gabert Wrote:  Try storing DIM(ifactors(X)) into a list, say L1, and then try

IF L1(1) == 2 THEN . . .

Works here.

(This is because, in Home, a statement like {2}=={2} returns {1}, not 1).

But aside from that, why do you test DIM(ifactors(X)? That won't tell you if X is prime.

I thought that if the length of the ifactors vector returns 2 then there are only two factors, the number itself and 1. I was wrong. The list doesn't include 1 so dim(ifactors(8)) would return 2 as well.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
ifactors Test Problem - toml_12953 - 09-06-2017, 02:18 PM
RE: ifactors Test Problem - Helge Gabert - 09-06-2017, 05:16 PM
RE: ifactors Test Problem - toml_12953 - 09-06-2017 07:03 PM
RE: ifactors Test Problem - Tim Wessman - 09-06-2017, 07:10 PM
RE: ifactors Test Problem - toml_12953 - 09-06-2017, 10:12 PM
RE: ifactors Test Problem - Helge Gabert - 09-06-2017, 08:13 PM
RE: ifactors Test Problem - Helge Gabert - 09-07-2017, 04:45 PM



User(s) browsing this thread: 1 Guest(s)