Ruud H.G. van Tol on Thu, 17 Nov 2022 00:42:00 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: A006899(n)
- From: "Ruud H.G. van Tol" <rvtol@isolution.nl>
- Date: Thu, 17 Nov 2022 00:40:51 +0100
- Delivery-date: Thu, 17 Nov 2022 00:42:00 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=isolution.nl; s=soverin; t=1668642054; bh=dubVTsSTDhqoVcTWFqa/NexxqevqrbOieJIuHhP8iNE=; h=Date:To:From:Subject:From; b=rU8MUtkH5Y1tOvLOuIQRcABvoOTj7otA+wSehWPnzmG+0w2WSWF8ZGMRTKZmlMo/6 MALV3b2L7o7Upyv51Djg7rp6WUr0/hFuQixKUUxNdBDDt+eNPU8BTe6dT+g8Pb8dvL h5uKueE8MCK+y2P/saLmsGdorTUyRg0LdyRjJdQ8tq6PPMgNhYp1xwuUyYcEJ96QQH NTEKs//FTT4cl8T4jJAepedFRO007llu1li5+KG1dsPUAbmY2h39qQZAOq54WLvlzx Hg7JTcIX3TuiZRbdyCJUhuWTquw8872oAq0JTgukg6wriN+VBChuZmoXgQ7p+PJ3AB jJQUQQn2crdWg==
For https://oeis.org/draft/A006899
"Numbers of the form 2^i or 3^j."
I created this code:
{
a(n)=
my
( i0= logint(3^(n-1), 6)
, i= logint(3^ n , 6)
);
if
( i > i0
, 2^i
, my(j= logint(2^n, 6));
3^j
)
}
which I'm quite happy with,
but I might be wrong!
-- Ruud