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.

A122414 Triangle T(n,k) for 1 <= k <= n read by rows, where T(n,k) = 1 if gcd(n,k) is prime, 0 otherwise.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Sep 03 2006

Keywords

Examples

			The triangle starts
  0
  0 1
  0 0 1
  0 1 0 0
  0 0 0 0 1
  0 1 1 1 0 0
  0 0 0 0 0 0 1
  0 1 0 0 0 1 0 0
  0 0 1 0 0 1 0 0 0
  0 1 0 1 1 1 0 1 0 0
  0 0 0 0 0 0 0 0 0 0 1
  0 1 1 0 0 0 0 0 1 1 0 0
  0 0 0 0 0 0 0 0 0 0 0 0 1
  0 1 0 1 0 1 1 1 0 1 0 1 0 0
  0 0 1 0 1 1 0 0 1 1 0 1 0 0 0
		

Crossrefs

Cf. A010051 (diagonal), A122415 (sub-triangle).
Row sums are in A117494. [From Klaus Brockhaus, May 29 2009]

Programs

  • Maple
    A122414 := proc(n,k)
        if isprime(igcd(n,k)) then
            1;
        else
            0;
        end if;
    end proc: # R. J. Mathar, Apr 21 2021
  • Mathematica
    row[n_] := Boole[PrimeQ[GCD[n, Range[n]]]]; Array[row, 14] // Flatten (* Amiram Eldar, May 23 2025 *)
  • PARI
    {m=14; v=vector(m,x,vector(x)); for(n=1,m,for(k=1,n,if(isprime(gcd(n,k)),v[n][k]=1))); for(n=1,m,for(k=1,n,print1(v[n][k],",")))}

Formula

T(n,n) = A010051(n).
T(n,1) = 0.