OFFSET
0,2
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197.
J.-P. Allouche and J. Shallit, On the subword complexity of the fixed point of a -> aab, b -> b, and generalizations, arXiv preprint arXiv:1605.02361 [math.CO], 2016.
Gabriele Fici, The Shortest Interesting Binary Words, arXiv:2412.21145 [math.CO], 2024. See p. 12.
FORMULA
G.f.: 1 + 1/(1-x) + 1/(1-x)^2 * [1/(1-x) - sum(k>=1, x^(2^k+k-1))] (conjectured). - Ralf Stephan, Mar 05 2004
a(n) = sum(k=0,n,min(2^k,n-k+1)) = 2^(m+1)-1 + (n-m)(n-m+1)/2 with m = [ n+1-LambertW( 2^(n+1) * log(2) ) / log(2) ] = integer part of the solution to 2^m = n+1-m. (conjectured). - M. F. Hasler, Dec 14 2007
MATHEMATICA
A103354[n_] := Floor[ FullSimplify[ ProductLog[ 2^n*Log[2]]/Log[2]]]; Accumulate[ Table[ A103354[n], {n, 1, 54}]] (* Jean-François Alcover, Dec 13 2011, after M. F. Hasler *)
PROG
(PARI)
LambertW(y) = solve( X=1, log(y), X*exp(X)-y)
A006697(n, b=2)=local(m=floor(n+1-LambertW(b^(n+1)*log(b))/log(b))); (b^(m+1)-1)/(b-1)+(n-m)*(n-m+1)/2 \\ M. F. Hasler, Dec 14 2007
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from Michel ten Voorde, Apr 11 2001
STATUS
approved