A112484 Array where n-th row contains the primes < n and coprime to n.
2, 3, 2, 3, 5, 2, 3, 5, 3, 5, 7, 2, 5, 7, 3, 7, 2, 3, 5, 7, 5, 7, 11, 2, 3, 5, 7, 11, 3, 5, 11, 13, 2, 7, 11, 13, 3, 5, 7, 11, 13, 2, 3, 5, 7, 11, 13, 5, 7, 11, 13, 17, 2, 3, 5, 7, 11, 13, 17, 3, 7, 11, 13, 17, 19, 2, 5, 11, 13, 17, 19, 3, 5, 7, 13, 17, 19, 2, 3, 5, 7, 11, 13, 17, 19, 5, 7, 11, 13
Offset: 3
Examples
Row 9 is [2, 5, 7], since 2, 5 and 7 are the primes < 9 and coprime to 9. The irregular triangle begins: n\k 1 2 3 4 5 6 7 8 ... 3: 2 4: 3 5: 2 3 6: 5 7: 2 3 5 8: 3 5 7 9: 2 5 7 10: 3 7 11: 2 3 5 7 12: 5 7 11 13: 2 3 5 7 11 14: 3 5 11 13 15: 2 7 11 13 16: 3 5 7 11 13 17: 2 3 5 7 11 13 18: 5 7 11 13 17 19: 2 3 5 7 11 13 17 20: 3 7 11 13 17 19 21: 2 5 11 13 17 19 22: 3 5 7 13 17 19 23: 2 3 5 7 11 13 17 19 ... - _Wolfdieter Lang_, Jan 18 2017
Links
- Michael De Vlieger, Table of n, a(n) for n = 3..16603 (rows 3 <= n <= 400).
Programs
-
Mathematica
f[l_] := Block[{n}, n = Length[l] + 1; Return[Append[l, Select[Range[n - 1], PrimeQ[ # ] && Mod[n, # ] > 0 &]]];]; Flatten[Nest[f, {}, 24]] (* Ray Chandler, Dec 26 2005 *) Table[Complement[Prime@ Range@ PrimePi@ n, FactorInteger[n][[All, 1]]], {n, 3, 23}] // Flatten (* Michael De Vlieger, Sep 04 2017 *)
-
Python
from sympy import primerange, gcd def a(n): return [i for i in primerange(1, n) if gcd(i, n)==1] for n in range(3, 24): print(a(n)) # Indranil Ghosh, Apr 27 2017
Extensions
Extended by Ray Chandler, Dec 26 2005
Comments