| Ruud H.G. van Tol on Sat, 26 Nov 2022 11:30:08 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| A071521(n) |
"A071521 Number of 3-smooth numbers <= n" https://oeis.org/A071521 The (to me very educational) PARI-code from Charles, on that page, looks to me like a variant of a formula shown in the "Raphael Schumacher" link. I would now probably write it as: A071521(n)= my(t=1);sum(k=1,logint(n,3),logint(n\t*=3,2)+1) (just trying to shave off another millisecond, though I was blown away by its speed already: a 3^k variant takes 40x as long) -- Ruud P.S. As n could be any ridiculous integer, a "powers()" approach isn't applicable. A "Power(b,e)=exp(e*log(b))" approach might be feasible, but that probably just takes longer, and will add precision treats.