MP=Martin Pelletier, RH=Roger Hui

MP>  that would produce the infamous sequence of numbers from Lost?
MP>  4 8 15 16 23 42

RH>  f=: +/@(_1 _3 _5&{)
RH>  (,f)^:(i.4) _3 _1 4 8 15

For a 6 number sequence, supplying the first 3 numbers as an initial condition 
might be an unfair advantage.  Besires, the true
answer is obvious:


           4 _11.15 26.875 _14.625 3.125 _0.225 p. i. 6    
        4 8 15 16 23 42

Which is only comprised of 7 numbers and two functions: a mere 50% worse than 
the original series  :)

-Dan

PS:  I've never seen Lost, but:
http://www.research.att.com/~njas/sequences/?q=4%2C+8%2C+15%2C+16%2C+23%2C+42&language=english&go=Search

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to