login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023717 Numbers with no 3's in base-4 expansion. 23
0, 1, 2, 4, 5, 6, 8, 9, 10, 16, 17, 18, 20, 21, 22, 24, 25, 26, 32, 33, 34, 36, 37, 38, 40, 41, 42, 64, 65, 66, 68, 69, 70, 72, 73, 74, 80, 81, 82, 84, 85, 86, 88, 89, 90, 96, 97, 98, 100, 101, 102, 104, 105, 106, 128, 129, 130, 132, 133, 134, 136, 137, 138 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
A032925 is the intersection of this sequence and A023705; cf. A179888. - Reinhard Zumkeller, Jul 31 2010
Fixed point of the morphism: 0-> 0,1,2; 1-> 4,5,6; 2-> 8,9,10; ...; n-> 4n,4n+1,4n+2. - Philippe Deléham, Oct 22 2011
LINKS
FORMULA
a(n) = Sum_{i=0..m} d(i)*4^i, where Sum_{i=0..m} d(i)*3^i is the base-3 representation of n. - Clark Kimberling
a(3n) = 4*a(n); a(3n+1) = 4*a(n)+1; a(3n+2) = 4*a(n)+2; a(n) = 4*a(floor(n/3)) + n - 3*floor(n/3). - Benoit Cloitre, Apr 27 2003
a(n) = Sum_{k>=0} A030341(n,k)*4^k. - Philippe Deléham, Oct 22 2011
MATHEMATICA
Select[ Range[ 0, 140 ], (Count[ IntegerDigits[ #, 4 ], 3 ]==0)& ]
PROG
(PARI) a(n)=if(n<1, 0, if(n%3, a(n-1)+1, 4*a(n/3))) or a(n)=if(n<1, 0, 4*a(floor(n/3))+n-3*floor(n/3))
(Haskell)
a023717 n = a023717_list !! (n-1)
a023717_list = filter f [0..] where
f x = x < 3 || (q < 3 && f x') where (x', q) = divMod x 4
-- Reinhard Zumkeller, Apr 18 2015
(Julia)
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 3)
r += b * q
b *= 4
end
r end; [a(n) for n in 0:58] |> println # Peter Luschny, Jan 03 2021
(C)
uint32_t a_next(uint32_t a_n) {
uint32_t t = ((a_n ^ 0xaaaaaaaa) | 0x55555555) >> 1;
return (a_n - t) & t;
} // Falk Hüffner, Jan 22 2022
CROSSREFS
Sequence in context: A095775 A035063 A004128 * A324639 A171599 A328594
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 12:59 EDT 2024. Contains 371254 sequences. (Running on oeis4.)