A023705 Numbers with no 0's in base-4 expansion.
1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 21, 22, 23, 25, 26, 27, 29, 30, 31, 37, 38, 39, 41, 42, 43, 45, 46, 47, 53, 54, 55, 57, 58, 59, 61, 62, 63, 85, 86, 87, 89, 90, 91, 93, 94, 95, 101, 102, 103, 105, 106, 107, 109, 110, 111, 117, 118, 119, 121, 122, 123
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Index entries for 10-automatic sequences.
Crossrefs
Programs
-
C
#include
uint32_t a_next(uint32_t a_n) { return (a_n + 1) | ((a_n & (a_n + 0xaaaaaaab)) >> 1); } /* Falk Hüffner, Jan 22 2022 */ -
Haskell
a023705 n = a023705_list !! (n-1) a023705_list = iterate f 1 where f x = 1 + if r < 3 then x else 4 * f x' where (x', r) = divMod x 4 -- Reinhard Zumkeller, Mar 06 2015, Oct 19 2011
-
Magma
[n: n in [1..130] | not 0 in Intseq(n,4)]; // Vincenzo Librandi, Oct 04 2018
-
Maple
R:= [1,2,3]: A:= 1,2,3: for i from 1 to 4 do R:= map(t -> (4*t+1,4*t+2,4*t+3), R); A:= A, op(R); od: A; # Robert Israel, Oct 04 2018
-
Mathematica
Select[ Range[ 120 ], (Count[ IntegerDigits[ #, 4 ], 0 ]==0)& ] Select[Range[200],DigitCount[#,4,0]==0&] (* Harvey P. Dale, Dec 23 2015 *)
-
PARI
isok(n) = vecmin(digits(n, 4)); \\ Michel Marcus, Jul 04 2015
-
Python
from sympy import integer_log def A023705(n): m = integer_log(k:=(n<<1)+1,3)[0] return sum(1+(k-3**m)//(3**j<<1)%3<<(j<<1) for j in range(m)) # Chai Wah Wu, Jun 27 2025
Formula
G.f. g(x) satisfies g(x) = (x+2*x^2+3*x^3)/(1-x^3) + 4*(x+x^2+x^3)*g(x^3). - Robert Israel, Oct 04 2018
Comments