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.

A322936 Triangular array in which the n-th row lists the numbers strongly prime to n (in ascending order). For the empty rows n = 2, 3, 4 and 6 we set by convention 0.

Original entry on oeis.org

1, 0, 0, 0, 3, 0, 4, 5, 3, 5, 5, 7, 7, 3, 4, 6, 7, 8, 9, 5, 7, 5, 7, 8, 9, 10, 11, 3, 5, 9, 11, 4, 8, 11, 13, 7, 9, 11, 13, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 5, 7, 11, 13, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 3, 7, 9, 11, 13, 17, 8, 11, 13, 16, 17, 19
Offset: 1

Views

Author

Peter Luschny, Apr 01 2019

Keywords

Comments

a is strongly prime to n if and only if a <= n is prime to n and a does not divide n-1. See the link to 'Strong Coprimality'. (Our terminology follows the plea of Knuth, Graham and Patashnik in Concrete Mathematics, p. 115.)

Examples

			The length of row n is A181830(n) = phi(n) - tau(n-1). The triangular array starts:
[1] {1}
[2] {}
[3] {}
[4] {}
[5] {3}
[6] {}
[7] {4, 5}
[8] {3, 5}
[9] {5, 7}
[11] {3, 4, 6, 7, 8, 9}
[12] {5, 7}
[10] {7}
[13] {5, 7, 8, 9, 10, 11}
[14] {3, 5, 9, 11}
[15] {4, 8, 11, 13}
[16] {7, 9, 11, 13}
[17] {3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15}
[18] {5, 7, 11, 13}
[19] {4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17}
[20] {3, 7, 9, 11, 13, 17}
		

Crossrefs

Programs

  • Maple
    StrongCoprimes := n -> select(k -> igcd(k, n)=1, {$1..n}) minus numtheory:-divisors(n-1):
    A322936row:=  proc(n) if n in {2, 3, 4, 6} then return 0 else op(StrongCoprimes(n)) fi end:
    seq(A322936row(n), n=1..20);
  • Mathematica
    Table[If[n == 1, {1}, Select[Range[2, n], And[GCD[#, n] == 1, Mod[n - 1, #] != 0] &] /. {} -> {0}], {n, 21}] // Flatten (* Michael De Vlieger, Apr 01 2019 *)
  • Sage
    def primeto(n):
        return [p for p in range(n) if gcd(p, n) == 1]
    def strongly_primeto(n):
        return [p for p in set(primeto(n)) - set((n-1).divisors())]
    def A322936row(n):
        if n == 1: return [1]
        if n in [2, 3, 4, 6]: return [0]
        return sorted(strongly_primeto(n))
    for n in (1..21): print(A322936row(n))