login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A174600
T(n,k) = 1 if the sum of +-k..+-n with arbitrary signs never equals zero, = 0 otherwise (lower triangle)
1
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, 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, 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
OFFSET
1,1
LINKS
EXAMPLE
Triangle begins
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;
1, 0, 0, 1, 1, 0, 1, 1, 1;
1, 0, 0, 1, 1, 1, 0, 1, 1, 1; ...
MATHEMATICA
t[n_, k_] := If[Mod[Floor[(n+1)/2], 2] != Mod[Floor[k/2], 2], 1, If[Mod[n-k, 2] == 0, If[k > ((n-k)/2)^2, 1, 0], 0]]; Flatten[Table[t[n, k], {n, 1, 15}, {k, 1, n}]][[;; 108]] (* Jean-François Alcover, Jul 11 2011, after awk program *)
PROG
(AWK)
{ for(n=1; n<10; n++)
for(k=1; k<=n; k++)
print ++i, T(n, k);
}
function T(n, k) {
if ( int((n+1)/2)%2 != int(k/2)%2 ) return 1;
else if ( (n-k)%2 == 0 ) {
if ( k > ((n-k)/2)^2 ) return 1;
else return 0;
}
else return 0;
}
(PARI)
T(n, k)=
{
if ( ((n+1)\2)%2 != (k\2)%2,
return(1);
, /* else */
if ( (n-k)%2 == 0,
if ( k > ((n-k)/2)^2, return(1), return(0) );
, /* else */
return(0);
);
);
}
{ for(n=1, 10, /* show triangle */
for(k=1, n,
print1(T(n, k), ", ");
);
print();
); }
CROSSREFS
Related to A063865.
Sequence in context: A145362 A261092 A285960 * A265186 A248392 A188318
KEYWORD
nonn,tabl
AUTHOR
R. H. Hardin Mar 23 2010, with formula and reference from Franklin T. Adams-Watters and Olivier Gérard, on the Sequence Fans Mailing list.
STATUS
approved