login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A077664 Triangle in which the n-th row contains n smallest numbers greater than n and coprime to n. 6

%I #17 Sep 21 2021 19:55:21

%S 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,

%T 9,11,13,15,17,19,21,23,10,11,13,14,16,17,19,20,22,11,13,17,19,21,23,

%U 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

%N Triangle in which the n-th row contains n smallest numbers greater than n and coprime to n.

%C A260910 gives the triangle of Frobenius numbers of n, T(n,k). - _Reinhard Zumkeller_, Aug 04 2015

%H Reinhard Zumkeller, <a href="/A077664/b077664.txt">Rows n = 1..125 of triangle, flattened</a>

%e Triangle begins:

%e 2;

%e 3, 5;

%e 4, 5, 7;

%e 5, 7, 9, 11;

%e 6, 7, 8, 9, 11;

%e 7, 11, 13, 17, 19, 23;

%e 8, 9, 10, 11, 12, 13, 15;

%e ...

%t T[n_] := Module[{j, k}, Reap[For[j = n+1; k = 1, k <= n, j++, If[CoprimeQ[n, j], Sow[j]; k++]]][[2, 1]]];

%t Table[T[n], {n, 1, 12}] // Flatten (* _Jean-François Alcover_, Sep 21 2021 *)

%o (Haskell)

%o a077664 n k = a077664_tabl !! (n-1) !! (k-1)

%o a077664_row n = a077664_tabl !! (n-1)

%o a077664_tabl = map (\x -> take x $ filter ((== 1). gcd x) [x + 1 ..]) [1..]

%o -- _Reinhard Zumkeller_, Aug 03 2015

%o (Python)

%o from math import gcd

%o def arow(n):

%o rown, k = [], n + 1

%o while len(rown) < n:

%o if gcd(k, n) == 1: rown.append(k)

%o k += 1

%o return rown

%o def agen(rows):

%o for n in range(1, rows+1): yield from arow(n)

%o print([an for an in agen(12)]) # _Michael S. Branicky_, Sep 21 2021

%Y Cf. A077665, A077666.

%Y Cf. A077581, A260895 (number of primes per row), A260910.

%K nonn,tabl,look

%O 1,1

%A _Amarnath Murthy_, Nov 14 2002

%E More terms from _Sascha Kurz_, Jan 03 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 5 10:46 EDT 2024. Contains 372275 sequences. (Running on oeis4.)