This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A085238 #22 Mar 25 2025 15:11:51 %S A085238 0,1,1,2,3,2,4,3,5,6,4,7,5,8,9,6,10,11,7,12,8,13,14,9,15,10,16,17,11, %T A085238 18,19,12,20,13,21,22,14,23,15,24,25,16,26,17,27,28,18,29,30,19,31,20, %U A085238 32,33,21,34,22,35,36,23,37,38,24,39,25,40,41,26,42,27,43,44,28 %N A085238 Sort the numbers 2^i and 3^j. Then a(n) is the exponent of the n-th term. %H A085238 Amiram Eldar, <a href="/A085238/b085238.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..500 from T. D. Noe) %F A085238 A006899(n) = A085239(n)^a(n). %F A085238 a(A085240(n)) = a(n). %t A085238 seq[lim_] := Module[{r2 = Range[0, Floor[Log2[lim]]], r3 = Range[0, Floor[Log[3, lim]]]}, Rest@ SortBy[Join[{#, 2^#} & /@ r2, {#, 3^#} & /@ r3], Last][[;; , 1]]]; seq[10^14] (* _Amiram Eldar_, Mar 25 2025 *) %o A085238 (Haskell) %o A085238 a085238 n = e (mod x 2 + 2) x where %o A085238 x = a006899 n %o A085238 e b p = if p == 1 then 0 else 1 + e b (p `div` b) %o A085238 -- _Reinhard Zumkeller_, Oct 09 2013 %o A085238 (PARI) do(lim)=my(v=List(vector(logint(lim\=1,2),i,1<<i))); for(i=0,logint(lim,3), listput(v,3^i)); apply(n->my(t=valuation(n,2)); if(t, t, valuation(n,3)), Set(v)) \\ _Charles R Greathouse IV_, Sep 02 2015 %o A085238 (Python) %o A085238 from sympy import integer_log %o A085238 def A085238(n): return k+1 if 6**(k:=integer_log(m:=3**(n-1),6)[0])<<1<m else integer_log(1<<n,6)[0] # _Chai Wah Wu_, Feb 04 2025 %Y A085238 Cf. A006899, A085239, A085240. %K A085238 nonn %O A085238 1,4 %A A085238 _Reinhard Zumkeller_, Jun 22 2003