Re: [Jprogramming] Project Euler 1

2016-05-04 Thread 'Pascal Jasmin' via Programming
looks fine, with similar structure, 3 5 (i.@] #~ +./@:(0&=)@:(|"0 1 i.)) 19 or shorter 3 5 (i.@] #~ +./@:(0&=)@:(|/ i.)) 19 - Original Message - From: Geoff Canyon To: programm...@jsoftware.com Sent: Wednesday, May 4, 2016 10:35 PM Subject: [Jprogramming] Project Euler 1 So I tried

Re: [Jprogramming] Project Euler 1

2016-05-04 Thread Raul Miller
On Wed, May 4, 2016 at 10:35 PM, Geoff Canyon wrote: > So I tried to write code to solve the general case of Project Euler problem > 1. The problem given is to find the sum of all the positive integers less > than 1000 that are divisible by 3 or 5. Obviously the specific case is > highly optimizab

Re: [Jprogramming] Project Euler 1

2016-05-04 Thread Thomas McGuire
I used modulo outer product |/ found which ones equal zero and then anded the rows of the matrix together to find the numbers that have both 3 and 5 as divisors I. (*./ (0 = 3 5 |/i.1000)) 0 15 30 45 60 75 90 105 120 135 150 165 180 195 210 . . . to generalize into a tacit I cheat and use 13

[Jprogramming] Project Euler 1

2016-05-04 Thread Geoff Canyon
So I tried to write code to solve the general case of Project Euler problem 1. The problem given is to find the sum of all the positive integers less than 1000 that are divisible by 3 or 5. Obviously the specific case is highly optimizable. But I wanted to solve the general, with any number of divi