View Single Post
  #3   Report Post  
ExcelBen ExcelBen is offline
Junior Member
 
Posts: 4
Default New much simpler solution

Two Lambda functions, one wrapper called PRIMESNEW and one recursive called TEST

TEST

=LAMBDA(n,a,ps,IF(an,ps,IF(SUM((MOD(a,ps)=0)*1)=0 ,TEST(n,a+1,APPEND(a,ps)),TEST(n,a+1,ps))))

PRIMESNEW

=LAMBDA(n,INTERSECTION(FACTORS(n),TEST(n,2,{2})))

It has the great advantage of simplicity. It is limited at 255. Still investigating why

Last edited by ExcelBen : January 24th 21 at 04:28 PM