A032810 Numbers using only digits 2 and 3.
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
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for 10-automatic sequences.
Crossrefs
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
Comments