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.

A129372 Triangle read by rows: T(n,k) = 1 if k divides n and n/k is odd, T(n,k) = 0 otherwise.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gary W. Adamson, Apr 11 2007

Keywords

Examples

			First few rows of the triangle:
  1;
  0, 1;
  1, 0, 1;
  0, 0, 0, 1;
  1, 0, 0, 0, 1;
  0, 1, 0, 0, 0, 1;
  1, 0, 0, 0, 0, 0, 1;
  0, 0, 0, 0, 0, 0, 0, 1;
  1, 0, 1, 0, 0, 0, 0, 0, 1;
  ...
		

Crossrefs

Cf. A001227 (row sums).

Programs

  • Magma
    A129372:= func< n,k | (n mod k) eq 0 and (Floor(n/k) mod 2) eq 1 select 1 else 0 >;
    [A129372(n,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Feb 01 2024
    
  • Mathematica
    A129372[n_, k_]:= If[Mod[n,k]==0 && OddQ[n/k], 1, 0];
    Table[A129372[n, k], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Feb 01 2024 *)
  • PARI
    T(n,k)=if(n%k, 0, n/k%2==1) \\ Andrew Howroyd, Aug 10 2018
    
  • SageMath
    def A129372(n,k): return 1 if (n%k)==0 and ((n/k)%2)==1 else 0
    flatten([[A129372(n,k) for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Feb 01 2024

Formula

Equals A051731 * A115359.
Sum_{k=1..n} T(n, k) = A001227(n) (row sums).
From G. C. Greubel, Feb 01 2024: (Start)
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = (-1)^(n-1)*A001227(n).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A183063(n+1). (End)

Extensions

Name changed and terms a(56) and beyond from Andrew Howroyd, Aug 10 2018