|
|
A077664
|
|
Triangle in which the n-th row contains n smallest numbers greater than n and coprime to n.
|
|
6
|
|
|
2, 3, 5, 4, 5, 7, 5, 7, 9, 11, 6, 7, 8, 9, 11, 7, 11, 13, 17, 19, 23, 8, 9, 10, 11, 12, 13, 15, 9, 11, 13, 15, 17, 19, 21, 23, 10, 11, 13, 14, 16, 17, 19, 20, 22, 11, 13, 17, 19, 21, 23, 27, 29, 31, 33, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 13, 17, 19, 23, 25, 29, 31, 35, 37, 41, 43, 47
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
Triangle begins:
2;
3, 5;
4, 5, 7;
5, 7, 9, 11;
6, 7, 8, 9, 11;
7, 11, 13, 17, 19, 23;
8, 9, 10, 11, 12, 13, 15;
...
|
|
MATHEMATICA
|
T[n_] := Module[{j, k}, Reap[For[j = n+1; k = 1, k <= n, j++, If[CoprimeQ[n, j], Sow[j]; k++]]][[2, 1]]];
|
|
PROG
|
(Haskell)
a077664 n k = a077664_tabl !! (n-1) !! (k-1)
a077664_row n = a077664_tabl !! (n-1)
a077664_tabl = map (\x -> take x $ filter ((== 1). gcd x) [x + 1 ..]) [1..]
(Python)
from math import gcd
def arow(n):
rown, k = [], n + 1
while len(rown) < n:
if gcd(k, n) == 1: rown.append(k)
k += 1
return rown
def agen(rows):
for n in range(1, rows+1): yield from arow(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|