Another interesting quora problem:

How many distinct triplets have a sum of 1,000,000 (provided all numbers
are integers and are positive)?
<https://www.quora.com/qemail/track_click?al_imp=eyJ0eXBlIjogMzUsICJoYXNoIjogMTcxMDQ0NjU4Mn0%3D&al_pri=QuestionLinkClickthrough&aoid=oMo937UDzj8&aoty=2&aty=4&click_pos=1&ct=1526747413834671&et=103&id=62216bf7b30d40aea1d79bf4401c8317&request_id=289&src=1&st=1526747413838426&stories=2518686273&uid=bqluVqSeN78&v=0>

​The obvious straightforward solution would be to use the odometer verb:​

odo=: #: i.@(*/)

1e6=+/"1 odo 3#1e6

|limit error: odo

| 1000000=+/"1 odo 3#1000000


Ooops. Unfortunately, I don't have near enough memory to use this approach.

Any suggestions?


Skip

​

Skip Cave
Cave Consulting LLC
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to