Re: [Jprogramming] Kolakosky sequence

2015-01-16 Thread R.E. Boss
530931e8 R.E. Boss > -Original Message- > From: programming-boun...@forums.jsoftware.com [mailto:programming- > boun...@forums.jsoftware.com] On Behalf Of Mike Day > Sent: donderdag 15 januari 2015 16:39 > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Kol

Re: [Jprogramming] Kolakosky sequence

2015-01-15 Thread Raul Miller
ory. > See http://arxiv.org/abs/1110.4228 > > > R.E. Boss > > >> -Original Message- >> From: programming-boun...@forums.jsoftware.com [mailto:programming- >> boun...@forums.jsoftware.com] On Behalf Of Raul Miller >> Sent: donderdag 15 januari 2015 15:0

Re: [Jprogramming] Kolakosky sequence

2015-01-15 Thread R.E. Boss
i 2015 15:04 > To: Programming forum > Subject: Re: [Jprogramming] Kolakosky sequence > > Hmm... the way that seems obvious to me seems to be less efficient > than your approach: > >kolakosky=: (# 2 1 $~ #)@]^:(> #)^:_&2 >timespacex 'kolakosky 21717700' &

Re: [Jprogramming] Kolakosky sequence

2015-01-15 Thread R.E. Boss
great minds > -Original Message- > From: programming-boun...@forums.jsoftware.com [mailto:programming- > boun...@forums.jsoftware.com] On Behalf Of Aai > Sent: donderdag 15 januari 2015 15:07 > To: programm...@jsoftware.com > Subject: Re: [Jprogramming]

Re: [Jprogramming] Kolakosky sequence

2015-01-15 Thread Mike Day
Plagiarising Raul and Aai's brilliant insights (and presumably RE Boss's), as I got nowhere near those efficiencies, it seems you can get a slight improvement in time and space using a boolean array until termination: 1 ts'#(>:# ((1 0$~#)))^:(40) 1 ' 1.62761 4.69765e8 1 ts'(# 2 1$~#)^

Re: [Jprogramming] Kolakosky sequence

2015-01-15 Thread Aai
Probably identical to what you have: (# 2 1$~#)^:(40) 2 R.E. Boss schreef op 15-01-15 om 13:03: K=. 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 2 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1

Re: [Jprogramming] Kolakosky sequence

2015-01-15 Thread Raul Miller
Hmm... the way that seems obvious to me seems to be less efficient than your approach: kolakosky=: (# 2 1 $~ #)@]^:(> #)^:_&2 timespacex 'kolakosky 21717700' 0.933105 1.16183e9 Interestingly, the length of the seed sequence seems to have a disproportionate effect on the amount of space used

[Jprogramming] Kolakosky sequence

2015-01-15 Thread R.E. Boss
K=. 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 2 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 1 2 2 1 1 is the start of a sequence where each i-th number gives the length of