Ruud H.G. van Tol on Wed, 29 Nov 2023 20:40:49 +0100


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

Re: log_int_rat



On 2023-11-29 19:44, Ruud H.G. van Tol wrote:

? a054414(n) = 1 + n + floor( n * log(2) / log(3/2) );

? [ a054414(n) |n<-[0..20]]
% [1, 3, 6, 9, 11, 14, 17, 19, 22, 25, 28, 30, 33, 36, 38, 41, 44, 47, 49, 52, 55]

Is there a cleaner way, similar to logint, to do that floor-expression?

This doesn't feel effective:

? [ logint(3^(n+1)-1,2) |n<-select(n->!n||(logint(3^(n+1)-1,2) > logint(2*3^n,2)), [0..34])] % [1, 3, 6, 9, 11, 14, 17, 19, 22, 25, 28, 30, 33, 36, 38, 41, 44, 47, 49, 52, 55]

-- Ruud