[seqfan] Re: Sum +-j +-(j+1) +-(j+2) ... +-i equals zero.

Ron Hardin rhhardin at att.net
Mon Mar 22 15:15:28 CET 2010


I guess that makes another sequence

%S A000001 1,1,1,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,1,1,0,1,1,1,0,1,1,0,0,1,1,1,
%T A000001 1,0,0,1,1,0,1,1,1,1,0,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,0,1,1,1,0,1,1,0,0,1,
%U A000001 1,1,0,1,1,1,1,0,0,1,1,0,0,1,1,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1
%N A000001 T(n,k) = 1 if the sum of +-k..+-n with arbitrary signs never equals zero, 0 otherwise (lower triangle)
%o A000001 # awk
%o A000001 {for(n=1; n<10; n++)for(k=1; k<=n; k++)print T(n,k);}
%o A000001 function T(n,k) {
%o A000001 if(int((n+1)/2)%2!=int(k/2)%2)return 1;
%o A000001 else if((n-k)%2==0) {
%o A000001 if(k>((n-k)/2)^2)return 1;
%o A000001 else return 0;
%o A000001 }
%o A000001 else return 0;
%o A000001 }
%H A000001  <a href="b000001.txt">Table of n, a(n) for n=1..3486</a>
%K A000001 nonn,tabl
%O A000001 1,1

Suggestions for better wording?  Additions?

the b-file is being produced from the definition, not from the program.

 rhhardin at mindspring.com
rhhardin at att.net (either)





More information about the SeqFan mailing list