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!)
A032911 Numbers whose set of base-4 digits is a subset of {1,3}. 4

%I #34 Oct 13 2023 14:03:32

%S 1,3,5,7,13,15,21,23,29,31,53,55,61,63,85,87,93,95,117,119,125,127,

%T 213,215,221,223,245,247,253,255,341,343,349,351,373,375,381,383,469,

%U 471,477,479,501,503,509,511,853,855,861,863,885,887,893,895,981,983

%N Numbers whose set of base-4 digits is a subset of {1,3}.

%C Numbers that have ones in all even bit positions, counted from least significant bit as position 0. - _Ralf Stephan_, Nov 01 2003

%H Vincenzo Librandi, <a href="/A032911/b032911.txt">Table of n, a(n) for n = 1..1000</a>

%F a(2n) = 4a(n) + 1, a(2n+1) = 4a(n) + 3. - _Ralf Stephan_, Nov 01 2003

%e Sequence in binary: 1 11 101 111 1101 1111 10101 10111 11101 11111 ...

%t Flatten[Table[FromDigits[#,4]&/@Tuples[{1,3},n],{n,5}]] (* _Vincenzo Librandi_, May 31 2012 *)

%o (Magma) [n: n in [1..1000] | Set(IntegerToSequence(n, 4)) subset {1, 3}]; // _Vincenzo Librandi_, May 31 2012

%o (C) uint32_t a_next(uint32_t a_n) { return (a_n + 1) | (a_n & 0x55555555); } /* _Falk Hüffner_, Jan 24 2022 */

%o (Python)

%o def A032911(n): return (int(bin(m:=n+1)[3:],4)<<1) + ((1<<(m.bit_length()-1<<1))-1)//3 # _Chai Wah Wu_, Oct 13 2023

%Y Cf. A007090.

%K nonn,base,easy

%O 1,2

%A _Clark Kimberling_

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 April 25 13:26 EDT 2024. Contains 371971 sequences. (Running on oeis4.)