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.

A129321 Triangle where the n-th row is the smallest n positive integers which are coprime to the n-th triangular number (n(n+1)/2).

Original entry on oeis.org

1, 1, 2, 1, 5, 7, 1, 3, 7, 9, 1, 2, 4, 7, 8, 1, 2, 4, 5, 8, 10, 1, 3, 5, 9, 11, 13, 15, 1, 5, 7, 11, 13, 17, 19, 23, 1, 2, 4, 7, 8, 11, 13, 14, 16, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 1, 5, 7, 13, 17, 19, 23, 25, 29, 31, 35, 1, 5, 7, 11, 17, 19, 23, 25, 29, 31, 35, 37, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11
Offset: 1

Views

Author

Leroy Quet, May 26 2007

Keywords

Examples

			The 6th triangular number is 21. So row 6 gives the six smallest positive integers which are coprime to 21: (1,2,4,5,8,10).
From _John Tyler Rascoe_, Mar 20 2024: (Start)
Triangle begins:
  1;
  1, 2;
  1, 5, 7;
  1, 3, 7, 9;
  1, 2, 4, 7, 8;
  1, 2, 4, 5, 8, 10;
(End)
		

Crossrefs

Cf. A124823.

Programs

  • Maple
    A129321 := proc(nrow) local a,n; a := [] ; n := 1; while nops(a) < nrow do if gcd(n, nrow*(nrow+1)/2) = 1 then a := [op(a),n] ; fi ; n := n+1 ; od: RETURN(a) ; end: seq( op(A129321(n)),n=1..15);
  • Mathematica
    A129321row[n_] := Block[{t = n*(n+1)/2, c = 0}, Table[While[!CoprimeQ[++c, t]]; c, n]]; Array[A129321row, 10] (* Paolo Xausa, Mar 20 2024 *)
  • PARI
    A129321row_n(n) ={my(r = vector(n), x=1, i=1 ); while(iJohn Tyler Rascoe, Mar 20 2024