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.

A032810 Numbers using only digits 2 and 3.

Original entry on oeis.org

2, 3, 22, 23, 32, 33, 222, 223, 232, 233, 322, 323, 332, 333, 2222, 2223, 2232, 2233, 2322, 2323, 2332, 2333, 3222, 3223, 3232, 3233, 3322, 3323, 3332, 3333, 22222, 22223, 22232, 22233, 22322, 22323, 22332, 22333, 23222, 23223
Offset: 1

Views

Author

Keywords

Comments

Identical to A007931 with substitution of digits 2 -> 3, 1 -> 2, i.e., application of the function A048379 or A256079(n) = n + A002275(A055642(n)). - M. F. Hasler, Mar 21 2015

Crossrefs

Cf. A020458, A143967, A248907 (permutation).
Cf. A032804-A032816 (in other bases), A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9).

Programs

  • Haskell
    a032810 = f 0 . (+ 1) where
       f y 1 = a004086 y
       f y x = f (10 * y + m + 2) x' where (x', m) = divMod x 2
    -- Reinhard Zumkeller, Mar 18 2015
    
  • Magma
    [n: n in [1..24000] | Set(Intseq(n)) subset {2, 3}]; // Vincenzo Librandi, May 27 2012
    
  • Magma
    [n eq 1 select 2 else IsOdd(n) select 10*Self(Floor(n/2))+2 else Self(n-1)+1: n in [1..40]]; // Bruno Berselli, May 27 2012
    
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{2,3},n],{n,5}]] (* Vincenzo Librandi, May 27 2012 *)
  • PARI
    A032810(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*2 \\ M. F. Hasler, Mar 26 2015
    
  • Python
    def A032810(n): return int(bin(n+1)[3:])+(10**((n+1).bit_length()-1)-1<<1)//9 # Chai Wah Wu, Jul 15 2023

Formula

a(n) = f(n+1, 0) with f(n, x) = if n=1 then A004086(x) else f(floor(n/2), 10*x + 2 + n mod 2). - Reinhard Zumkeller, Sep 06 2008
a(n) is Theta(n^(log_2 10)); there are about n^(log_10 2) members of this sequence up to n. - Charles R Greathouse IV, Mar 18 2010
a(n) = A007931(n) + A002275(A000523(n+1)). A055642(a(n)) = A000523(n+1). - M. F. Hasler, Mar 21 2015