Ruud H.G. van Tol on Sat, 26 Nov 2022 09:03:57 +0100


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

logint performance



A071521_1(n)=my(t=1/3); sum(k=0, logint(n, 3), t*=3; logint(n/t, 2)+1)

A071521_2(n)=my(t=1/3); sum(k=0, logint(n, 3), t*=3; logint(n\t, 2)+1)


? A071521_1(10^600)
cpu time = 14 ms, real time = 14 ms.
%1733 = 1254865

? A071521_2(10^600)
cpu time = 3 ms, real time = 3 ms.
%1734 = 1254865


That appears to need some some assertive kind of integer casting.
Is that feasible?

-- Ruud