OFFSET
1,5
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.)
LINKS
Peter Luschny, Strong Coprimality
EXAMPLE
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}
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 *)
PROG
(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))
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Peter Luschny, Apr 01 2019
STATUS
approved