A085239 Sort the numbers 2^i and 3^j. Then a(n) is the base of the n-th term. Set a(1)=1.
1, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2
Offset: 1
Keywords
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..500 from T. D. Noe)
Programs
-
Haskell
a085239 1 = 1 a085239 n = a006899 n `mod` 2 + 2 -- Reinhard Zumkeller, Oct 09 2013
-
Mathematica
m = 40; Join[{1}, If[Total[IntegerDigits[#, 2]] == 1, 2, 3]& /@ Union[3^Range[m], 2^Range[Length[IntegerDigits[3^m, 2]] - 1]]] (* Jean-François Alcover, Oct 07 2021 *)
-
PARI
upto(L) = my(v2=2, v3=1, r=List(1)); while(v3
Ruud H.G. van Tol, May 10 2024 -
Python
from sympy import integer_log def A085239(n): return 1 if n==1 else 2 if 6**integer_log(m:=3**(n-1),6)[0]<<1
Chai Wah Wu, Feb 04 2025
Formula
For n > 1: a(n) = 2 + A006899(n) mod 2. - Reinhard Zumkeller, Oct 09 2013
Comments