A033052 a(1) = 1, a(2n) = 16a(n), a(2n+1) = a(2n)+1.
0, 1, 16, 17, 256, 257, 272, 273, 4096, 4097, 4112, 4113, 4352, 4353, 4368, 4369, 65536, 65537, 65552, 65553, 65792, 65793, 65808, 65809, 69632, 69633, 69648, 69649, 69888, 69889, 69904, 69905, 1048576, 1048577, 1048592, 1048593, 1048832
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 45.
Programs
-
C
int a_next(int a_n) { return (a_n + 0xeeeeeeef) & 0x11111111; } /* Falk Hüffner, Jan 24 2022 */
-
Magma
[n: n in [1..1050000] | Set(IntegerToSequence(n, 16)) subset {0, 1}]; // Vincenzo Librandi, May 04 2012
-
Mathematica
FromDigits[#,16]&/@Tuples[{0,1},5] (* Vincenzo Librandi, Jun 04 2012 *)
-
PARI
a(n)=n=Vecrev(binary(n));sum(i=1,#n,n[i]<<(4*i))>>4 \\ Charles R Greathouse IV, Sep 23 2012
-
PARI
a(n)=fromdigits(binary(n),16); \\ Alan Michael Gómez Calderón, Mar 23 2025
Formula
a(n) = Sum_{i=0..m} d(i)*16^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097262(n)/15.
a(2n) = 16*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*16^k. - Philippe Deléham, Oct 19 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 16^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017
Extensions
Extended by Ray Chandler, Aug 03 2004
Simpler definition from Ralf Stephan, Jun 18 2005
Comments