%I #14 Feb 25 2018 22:53:18
%S 1,3,7,7,13,15,15,15,25,27,31,31,31,31,31,31,49,51,55,55,61,63,63,63,
%T 63,63,63,63,63,63,63,63,97,99,103,103,109,111,111,111,121,123,127,
%U 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127
%N The largest number z less than or equal to 3n+1 such that binomial(z,n) is odd.
%C This sequence is related to and derived from a problem in algebraic topology which asks you to find the largest a+b such that (x+z)^a * (y+z)^b is nonzero mod 2 when x^{n+1}=y^{n+1}=z^{n+1}=0. See the paper at the url below for more information.
%H D. M. Davis, <a href="http://www.lehigh.edu/~dmd1/TCBP.pdf">Bounds for higher topological complexity of real projective spaces implied by BP</a>, preprint. See Section 3.
%H Donald M. Davis, <a href="https://arxiv.org/abs/1709.04443">A lower bound for higher topological complexity of real projective space</a>, arXiv:1709.04443 [math.AT], 2017.
%F If n=2^e + d with 0<= d < 2^e, then a(n)=min(3* 2^e + a(d), 2^{e+2}-1). I can prove this, and also the following explicit formula. If n=A+B, where A==0 mod 2^{e+2}, and 2^e + 2^{e-1} <= B < 2^{e+1}, then a(n)=3A + 2^{e+2}-1. (This is saying that the highest adjacent 1's in the binary expansion of n are in positions e and e-1. If there are none, then a(n)=3n+1 if n is even, and 3n if n is odd.)
%o (PARI) a(n) = my(z=3*n+1); while(z > 0, if(Mod(binomial(z, n), 2)==1, return(z)); z--); 0 \\ _Felix Fröhlich_, Aug 08 2017
%K nonn,easy
%O 0,2
%A _Donald M Davis_, Aug 08 2017