OFFSET
0,1
COMMENTS
Replaced the sums (f(a,b) = a + b) by the operators f(a,b) = a^2 -a*b + b^2 in the construction of triangle in A118340.
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
From G. C. Greubel, Jan 12 2023: (Start)
T(n, k) = A118340(n, k) mod 2.
Sum_{k=0..n} T(n, k) = A168148(n). (End)
EXAMPLE
Triangle begins as:
1;
1, 0;
1, 1, 0;
1, 0, 1, 0;
1, 1, 0, 1, 0;
1, 0, 1, 1, 1, 0;
1, 1, 1, 0, 0, 1, 0;
1, 0, 0, 0, 0, 1, 1, 0;
1, 1, 0, 1, 1, 1, 0, 1, 0;
1, 0, 1, 0, 0, 1, 1, 1, 1, 0;
1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0;
MATHEMATICA
t[n_, k_, p_]:= t[n, k, p]= If[k<0 || k>n, 0, If[k==0, 1, If[n<=2*k, t[n, n-k-1, p] +p*t[n-1, k, p], t[n, n-k, p] +t[n-1, k, p]]]]; (* A118340 *)
T[n_, k_, p_]:= Mod[t[n, k, p], 2]; (* A168030 *)
Table[T[n, k, 1], {n, 0, 15}, {k, 0, n}]//Flatten (* G. C. Greubel, Jan 12 2023 *)
PROG
(Magma)
function t(n, k) // t = A118340
if k lt 0 or k gt n then return 0;
elif k eq 0 then return 1;
elif n gt 2*k then return t(n, n-k) + t(n-1, k);
else return t(n, n-k-1) + t(n-1, k);
end if; return t;
end function;
T:= func< n, k | t(n, k) mod 2 >; // A168030
[T(n, k): k in [0..n], n in [0..15]];
(SageMath)
@CachedFunction
def t(n, k): # t = A118340
if (k<0 or k>n): return 0
elif (k==0): return 1
elif (n>2*k): return t(n, n-k) + t(n-1, k)
else: return t(n, n-k-1) + t(n-1, k)
def A168030(n, k): return t(n, k)%2
flatten([[A168030(n, k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Jan 12 2023
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Philippe Deléham, Nov 17 2009
STATUS
approved