mean=: +/ % #

   mean >./@(0&,)@(_&q:)"0 }.i.1e4
1.70357
   mean >./@(0&,)@(_&q:)"0 }.i.1e5
1.70504

I think you have to include 1 in the calculation (thus not use 2+i.n as the
argument).



On Tue, Jul 5, 2016 at 8:12 AM, mikel paternain <mikelpa...@hotmail.es>
wrote:

>
> ________________________________
> De: mikel paternain <mikelpa...@hotmail.es>
> Enviado: domingo, 3 de julio de 2016 12:07:37
> Para: programming@forums.jsoftware.com
> Asunto: Niven's constant
>
> Hi,
>
> I need improve the code for calculating Niven's constant. Could you help
> me?
>
> A first test is (see "Computo ergo sum" section in JoJ):
>
> exp=:+/"1@=@q:
> max=:>./
> a=.max@exp(2+1.1000)
> C=.(+/%#)a
>
> Thanks in advance,
>
> Mikel Paternain
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to