cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A168030 Variant of pendular triangle A118340.

Original entry on oeis.org

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, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0
Offset: 0

Views

Author

Philippe Deléham, Nov 17 2009

Keywords

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.

Examples

			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;
		

Crossrefs

Cf. A118340, A168148 (row sums).

Programs

  • 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]];
    
  • 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 *)
  • 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

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)
Showing 1-1 of 1 results.