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.

Previous Showing 11-12 of 12 results.

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.

A375487 a(n) is the number of integers k between 0 and n such that n AND k is a prime number (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 0, 1, 2, 0, 1, 2, 4, 0, 0, 4, 5, 0, 3, 2, 6, 0, 1, 8, 10, 0, 6, 4, 11, 0, 4, 4, 10, 0, 7, 2, 11, 0, 0, 16, 16, 0, 9, 8, 17, 0, 1, 8, 14, 0, 12, 4, 16, 0, 8, 8, 16, 0, 13, 4, 17, 0, 8, 4, 15, 0, 15, 2, 18, 0, 0, 32, 33, 0, 16, 16, 34, 0, 1, 16, 27, 0, 18, 8
Offset: 0

Views

Author

Rémy Sigrist, Aug 17 2024

Keywords

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  ------------------
   0     0  None
   1     0  None
   2     1  2
   3     2  2, 3
   4     0  None
   5     1  5
   6     2  2, 3
   7     4  2, 3, 5, 7
   8     0  None
   9     0  None
  10     4  2, 3, 6, 7
  11     5  2, 3, 6, 7, 11
  12     0  None
  13     3  5, 7, 13
  14     2  2, 3
  15     6  2, 3, 5, 7, 11, 13
		

Crossrefs

Cf. A000720, A102210, A117494, A375485 (XOR variant), A375486 (OR variant).

Programs

  • PARI
    a(n) = sum(k = 0, n, isprime(bitand(n, k)))

Formula

a(n) = 0 iff n = 0 or n belongs to A102210.
a(2^k-1) = A000720(2^k-1) for any k > 0.
Previous Showing 11-12 of 12 results.