Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!mach1!torn!cs.utexas.edu!wupost!csus.edu!sfsuvax1.sfsu.edu!emclean
From: emclean@sfsuvax1.sfsu.edu (Emmett McLean)
Subject: Re: Factoring numbers
Message-ID: <1993Mar2.084227.1208@csus.edu>
Sender: news@csus.edu
Organization: San Francisco State University
References: <1993Feb28.015325.18464@csus.edu> <1993Mar1.185359.1677@csi.jpl.nasa.gov>
Date: Tue, 2 Mar 1993 08:42:27 GMT
Lines: 43

In article <1993Mar1.185359.1677@csi.jpl.nasa.gov> sam@csi.jpl.nasa.gov (Sam Sirlin) writes:
>
>This seems to run into problems pretty early on my sun sparc:
>
>   factors 167
>limit error
>
>I suppose this is because recursion is used instead of looping,... but
>haven't had time to investigate yet. 

>  Our NeXT machine does alright for 167 :
   factors 167
167
   factors 2805
3 5 11 17

>  But it has trobles with some other numbers.

   factors 2801
limit error

>  Here's a function to find numbers yeilding a limit error :

   factorsTest =.  (-.@(+./"1)@(0&~:)@(factors"0 :: 0:) # ]) 

>  I love that adverse feature "::" 

   CantFactor =. factorsTest 2800 + i. 100
   $ CantFactor
   62

   8 8 $ 0 0 , CantFactor
   0    0 2801 2802 2803 2804 2807 2810
2811 2813 2815 2817 2818 2819 2823 2824
2825 2826 2827 2828 2830 2831 2833 2834
2836 2837 2839 2841 2843 2845 2846 2848
2851 2853 2854 2855 2857 2858 2859 2861
2863 2864 2865 2866 2868 2869 2872 2874
2876 2877 2878 2879 2882 2884 2885 2887
2889 2892 2893 2894 2895 2896 2897 2899
 
  Emmett  

