OFFSET
0,2
FORMULA
a(n) = 2*A007017(n-1) for n>0. - Alois P. Heinz, Nov 05 2016
EXAMPLE
Some solutions for n=3:
0 0 0 1 1 1
0 1 1 0 1 1 0 0 1 0 0 1
1 0 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 0
PROG
(PARI) nextrowcomb(rowarr) = my(k=#rowarr, i=0); while(rowarr[k]==1, rowarr[k]=0; i++; k--); while(rowarr[k]==0 && k > 1, k--); if(rowarr[k]==1, rowarr[k]=0; rowarr[k+1]=1; k=k+2; while(i > 0, rowarr[k]=1; k++; i--), for(x=k, k+i, rowarr[x]=1)); rowarr
is_validcombination(toprow, bottomrow) = for(v=1, #toprow, if(toprow[v]==bottomrow[v] && toprow[v]==bottomrow[v+1], return(0))); for(w=2, #toprow, if(toprow[w-1]==bottomrow[w] && toprow[w]==bottomrow[w], return(0))); return(1)
terms(n) = my(toprows=[[0], [1]], bottomrow=[0, 0], validrows=[]); while(1, for(k=1, #toprows, if(is_validcombination(toprows[k], bottomrow), validrows=concat(validrows, [bottomrow]))); if(vecmin(bottomrow)==1, bottomrow=vector(#bottomrow+1); print1(#validrows, ", "); toprows=validrows; validrows=[], bottomrow=nextrowcomb(bottomrow)); if(#bottomrow==n+2, break))
terms(5) \\ print initial five terms
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Nov 05 2016
EXTENSIONS
Thanks to R. H. Hardin and Charles R Greathouse IV for helpful suggestions.
a(7)-a(18) from Alois P. Heinz, Nov 05 2016
STATUS
approved