apl APL Hacking: Project Euler (#30) I figure it's about time I posted another Project Euler.Problem #30: ∇Z←PETHIRTY;M [1] ⍝ Find the sum of all the numbers that can be written as [2] ⍝ the sum

apl Revisiting Send + More = Money In my last post I attempted to solve the Send + More = Money Cryptarithmetic problem. I didn't quite understand how I could do this quickly using a better algorithm, so I tried

apl Send + More = Money After talking with Prof. Friedman, he gave me an interesting constraint problem. This is a well known example of a problem well suited to constrain based techniques. The goal is to figure out

apl APL Hacking: Project Euler (#29) Problem #29:∇Z←PETWENTYNINE;⎕IO ⎕IO←1 ⍝ Compute the cardinality of the set ⍝ {a*b | 2≤a≤100 ^ 2≤b≤100} ⍝ Easy to do by computing the sequence, ⍝ ordering it, and then removing

apl APL Hacking: Project Euler (#28) Problem #28:Z←PETWENTYEIGHT ⍝ Sum of the diagonals of a 1001 by 1001 spiral Z←+/+1,4/2×⍳500 This one is too easy to talk about. Basically, we can realize the nature

apl APL Hacking; Project Euler (#27) Problem #27:∇Z←PETWENTYSEVEN;A;B;X;P ⍝ Find the product of the coefficients A and B ⍝ that have the longest consecutive n values from 0 ⍝ for the quadratic formula. ⍝ P is the

apl APL Hacking: Project Euler (#26) Problem #26:∇Z←CYCLE∆LENGTH N;A;I;R ⍝ Find the length of the cycle of 1÷N. Z←0 ⋄ I←0 ⋄ A←N⍴0 ⋄ R←1 LP:I←I+1 ⋄ Z←I-A[

apl APL Hacking: Project Euler (#25) Problem #25:∇R←PETWENTYFIVE;I;A;X;⎕IO;B;D ⎕IO←1 ⍝ What is the first fibonnacci term to contain 1,000 digits? D←1000000000 ⍝ Use nine-digit numbers. A←B←X←¯112↑1

apl APL Hacking: Project Euler (#24) Problem #24:∇R←PETWENTYFOUR;N;A;I ⍝ Compute the 1,000,000th Lexicographic Permutation of ⍝ 0 through 9. N←10 →(N≥3 2 1)/C3,C2,C1 R←1 0⍴0 ⋄ →0 C1:

apl APL Hacking: Project Euler (#23) Problem #23:∇R←PETWENTYTHREE;ABDP;N;X ⍝ Find the sum of all the positive integers ⍝ which cannot be written as the sum ⍝ of two abundant numbers. ⊣⎕FX 'R←ABDP N' 'R←N<

apl APL Hacking: Project Euler (#22) Problem 22:∇R←PETWENTYTWO NAMES;X ⍝ Receiving a 1×N matrix of name vectors, ⍝ sort the names alphabetically, and then compute the ⍝ total of their numeric counts times their sorted ⍝ positions. R←+/(⍳↑⍴X)

apl APL Hacking: Project Euler (#21) Problem #21:∇R←PETWENTYONE;X;Y;Z ⍝ Compute the sum of amicable numbers under 10000. R←+/(∨/X^⍉X)/Y⊣X←(~Z)^Y∘.=Y+.×(0=Y∘.|Y)≠Z←Y∘.=Y⊣Y←⍳10000 ∇Ah, back

apl.euler APL Hacking: Project Euler (#20) I was avoiding this one for a while simply because I wanted to have a better carry algorithm in mind. On the other hand, it does not seem to matter if I have

apl APL Hacking: Project Euler (#19) I didn't really have a good idea of how to solve this one until I started playing around with some things on the APL session. Actually, what do you call the

apl Histograms in APL/Scheme Eric gave a talk today about the Connection Machines and CM Lisp. One of the examples was of a way to compute the histogram of a set of numbers:(β+ X ⍺1)The

apl APL Hacking: Project Euler (#18) You notice that these are not daily anymore. :)For this one, I took advantage of the ability to rotate vectors to get the job done. I am confused about the use of the

apl APL Hacking: Project Euler Daily (#17) This one I did the old fashioned way at first, with a loop and a lot of cases and branching. Either with branch arrows or with Control Structures, it felt wrong. In the

apl APL Hacking: Project Euler Daily (#16) For this problem, I could have reused my CARRY function from before, but it seemed like it would only make things more difficult. Instead, I realized that there was a really simple carry

apl APL Hacking: Project Euler Daily (#15) This was a problem to find all of the forward searching paths in a 20 by 20 grid. This is one that we actually use a lot in our introductory programming courses, but

apl APL Hacking: Project Euler Daily (#14) This problem was interesting in all different ways. It asks for Collatz Sequence counts. First, I tried to do the naive way, and discovered how that won't work. I then tried

apl APL Hacking: Project Euler Daily (#13) So, this is actually my post for Friday, but since I was traveling, I was not able to post anything for that day.This one was pretty fun. The problem is that the

apl APL Hacking: Project Euler Daily (#12) This was the first problem that I had to deal with that didn't work right or quickly if I used the standard operators the way that I was used to using

apl APL Hacking: Project Euler Daily (#11) I really liked doing this one. I had no idea how to approach this idea at first. I couldn't think of any simple approach to it at all. I decided to

apl APL Hacking: Project Euler Daily (#10) This was a bit of a fun one, since I had trouble trying to get the result into a 32-bit integer. I had to do a bit of math to get that to

apl APL Hacking: Project Euler Daily (#9) Finally, we get an interesting one. In this problem, I struggled with a desire to express the solution simply, and to also make it computable in a reasonable amount of time. To make