A063915 G.f.: (1 + Sum_{ i >= 0 } 2^i*x^(2^(i+1)-1)) / (1-x)^2.
1, 3, 5, 9, 13, 17, 21, 29, 37, 45, 53, 61, 69, 77, 85, 101, 117, 133, 149, 165, 181, 197, 213, 229, 245, 261, 277, 293, 309, 325, 341, 373, 405, 437, 469, 501, 533, 565, 597, 629, 661, 693, 725, 757, 789, 821, 853, 885, 917, 949, 981, 1013, 1045, 1077, 1109
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- 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, pp. 34, 37, 41.
- Ralf Stephan, Some divide-and-conquer sequences ...
- Ralf Stephan, Table of generating functions
Programs
-
Maple
a:= proc(n) option remember; `if`(n<0, 0, 1+ (t-> 2*(a(floor(t))+a(ceil(t))))(n/2-1)) end: seq(a(n), n=0..55); # Alois P. Heinz, Jul 10 2019
-
Mathematica
b[n_] := b[n] = If[EvenQ[n], 2 b[n/2] + 2 b[n/2-1] + 1, 4 b[(n-1)/2] + 1]; b[1] = 1; b[2] = 3; a[n_] := b[n+1]; a /@ Range[0, 55] (* Jean-François Alcover, Nov 02 2020 *)
-
PARI
a(n) = n+=2; my(k=logint(n,2)); n<
Kevin Ryde, Nov 27 2020
Formula
a(n) = b(n+1), with b(2n) = 2*b(n)+2*b(n-1)+1, b(2n+1) = 4*b(n)+1.
a(n) = (n+2)*2^k - (2*4^k + 1)/3 where k = floor(log_2(n+2)) = A000523(n+2). - Kevin Ryde, Nov 27 2020
Extensions
More terms from Ralf Stephan, Sep 15 2003
Comments