Skip to content

Instantly share code, notes, and snippets.

@muraiki
Created July 28, 2017 19:02
Show Gist options
  • Save muraiki/fb7da4eb0f07e54ad07776effc7ad992 to your computer and use it in GitHub Desktop.
Save muraiki/fb7da4eb0f07e54ad07776effc7ad992 to your computer and use it in GitHub Desktop.
Generate series of 28 numbers in ascending order that total close to 1500 (APL)
⍝ https://ngn.github.io/apl/web/index.html#code=s%u21902%D71+%u237314%0Ax%u2190%28s%2C-s%29+%284%D7%u237328%29%0A%u2395%20%u2190x%5B%u234Bx%5D%0A%u2395%20%u2190+/x
s←2×1+⍳14
x←(s,-s)+(4×⍳28)
⎕ ←x[⍋x]
⎕ ←+/x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment