Ruud H.G. van Tol on Wed, 24 Jan 2024 01:56:34 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: log_int_rat



On 2024-01-22 04:26, Ruud H.G. van Tol wrote:
[...]

Now proposed it as:

alist(N) = { \\ A054414
  my(a=1/2, b=1, r=-1);
  vector(N, i, a*=4; b*=3; r+=2; if(a>b, a*=2; b*=3; r++); r);
}

And 2% faster:

alist(N) = { \\ A054414
  my(a=1/2, b=1, r=-1);
  vector(N, i, a*=4; b*=3; if(a>b, a*=2; b*=3; r++); 2*i+r);
}

-- Ruud