OFFSET
1,2
COMMENTS
A179970 is a subsequence. - Reinhard Zumkeller, Aug 04 2010
There are A000073(n+2) terms with binary length n. - Rémy Sigrist, Sep 30 2022
LINKS
R. Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
It appears (but has not yet been proved) that the terms of a(n) can be computed recursively as follows. Let {c(i)} be defined for i >= 5 by c(i)=2c(i-1)+1 if i is congruent to 2 mod 4, else c(i)=2c(i-1)-1. I.e., {c(i)}={1,3,5,9,17,35,...} for i=5,6,7,... . Let a(n)=n for n=1,2,...,7. For n>7, choose k so that s(k) < n < s(k+1), where s(k) = Sum_{j=3..k} t(j) with t(j) being the j-th term of the tribonacci sequence A000073 (with initial terms t(0)=0, t(1)=0, t(2)=1). Then a(n) = c(k) + 2a(s(k)) - a(2s(k)+1). This has been verified for n up to 2400.
{i: A043276(i) <= 3}. - R. J. Mathar, Jun 04 2021
MATHEMATICA
Select[Range[100], Max[Length/@Split[IntegerDigits[#, 2]]]<4&] (* Harvey P. Dale, Aug 01 2020 *)
PROG
(PARI) tribonacci(n) = ([0, 1, 0; 0, 0, 1; 1, 1, 1]^n)[2, 1]
a(n) = { if (n<=4, return (n), my (s=1); for (i=1, oo, my (f=tribonacci(i+2)); i
f (n<s+f, return (2^i-1-a(2*s-n-1)), s+=f))) } \\ Rémy Sigrist, Sep 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Oct 16 2009
STATUS
approved