OFFSET
0,4
COMMENTS
This is the Run Length Transform of S(n) = Fibonacci(n+1).
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g., 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..8191
N. J. A. Sloane, On the No. of ON Cells in Cellular Automata, Video of talk in Doron Zeilberger's Experimental Math Seminar at Rutgers University, Feb 05 2015: Part 1, Part 2
N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168, 2015
Chai Wah Wu, Sums of products of binomial coefficients mod 2 and run length transforms of sequences, arXiv:1610.06166 [math.CO], 2016.
FORMULA
a(n) = Sum_{k=0..n} ((binomial(n-k,2k)*binomial(n,k)) mod 2). - Chai Wah Wu, Oct 19 2016
MAPLE
with(combinat); ans:=[];
for n from 0 to 100 do lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
for i from 1 to L1 do
if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
elif out1 = 0 and t1[i] = 1 then c:=c+1;
elif out1 = 1 and t1[i] = 0 then c:=c;
elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;
fi;
if i = L1 and c>0 then lis:=[c, op(lis)]; fi;
od:
a:=mul(fibonacci(i+1), i in lis);
ans:=[op(ans), a];
od:
ans;
MATHEMATICA
a[n_] := Sum[Mod[Binomial[n-k, 2k] Binomial[n, k], 2], {k, 0, n}];
a /@ Range[0, 100] (* Jean-François Alcover, Feb 28 2020, after Chai Wah Wu *)
PROG
(PARI) a(n)=my(s=1, k); while(n, n>>=valuation(n, 2); k=valuation(n+1, 2); if(k>1, s*=fibonacci(k+1)); n>>=k); s \\ Charles R Greathouse IV, Oct 21 2016
(PARI) a(n)=sum(k=0, n, !bitand(n-3*k, 2*k) && !bitand(n-k, k)) \\ Charles R Greathouse IV, Oct 21 2016
(Python)
def A246028(n): return sum(int(not (~(n-k) & 2*k) | (~n & k)) for k in range(n+1)) # Chai Wah Wu, Sep 27 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Aug 15 2014; revised Sep 05 2014
STATUS
approved