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]

A006899(n)


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