cp's OEIS Frontend

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.

A085239 Sort the numbers 2^i and 3^j. Then a(n) is the base of the n-th term. Set a(1)=1.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 22 2003

Keywords

Comments

The density of 2's in this sequence is log(3)/log(6). The density of 3's in this sequence is log(2)/log(6). - Jennifer Buckley, Apr 24 2024

Crossrefs

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(v3Ruud 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]<<1Chai Wah Wu, Feb 04 2025

Formula

A006899(n) = a(n)^A085238(n).
For n > 1: a(n) = 2 + A006899(n) mod 2. - Reinhard Zumkeller, Oct 09 2013