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.

A285788 Irregular triangle T(n,m): nonprime 1 <= k <= n such that n and k are coprime.

This page as a plain text file.
%I A285788 #22 Jun 12 2025 12:58:12
%S A285788 1,1,1,1,1,4,1,1,4,6,1,1,4,8,1,9,1,4,6,8,9,10,1,1,4,6,8,9,10,12,1,9,1,
%T A285788 4,8,14,1,9,15,1,4,6,8,9,10,12,14,15,16,1,1,4,6,8,9,10,12,14,15,16,18,
%U A285788 1,9,1,4,8,10,16,20,1,9,15,21,1,4,6,8,9,10
%N A285788 Irregular triangle T(n,m): nonprime 1 <= k <= n such that n and k are coprime.
%C A285788 Row n is a subset of A038566(n) such that the union of a(n) and A112484(n) = A038566(n).
%C A285788 Row lengths are A048864(n) = A000010(n)-(A000720(n)-A001221(n)), i.e., phi(n)-(pi(n)-omega(n)).
%C A285788 1 appears in every row since 1 is not prime and coprime to all n.
%C A285788 4 is the smallest composite and appears first in row 5 since 4 divides 4.
%C A285788 Rows that contain the single term 1 are in A048597; the largest n = 30 such that the only term is 1.
%C A285788 For prime p, row p contains 1 and all composites k < p, since 1 < m < p are coprime to p.
%H A285788 Michael De Vlieger, <a href="/A285788/b285788.txt">Table of n, a(n) for n = 1..11055</a> (rows 1 <= n <= 240)
%e A285788 Triangle begins:
%e A285788   n\m  1  2   3   4  5   6   7
%e A285788    1:  1
%e A285788    2:  1
%e A285788    3:  1
%e A285788    4:  1
%e A285788    5:  1  4
%e A285788    6:  1
%e A285788    7:  1  4   6
%e A285788    8:  1
%e A285788    9:  1  4   8
%e A285788   10:  1  9
%e A285788   11:  1  4   6   8  9  10
%e A285788   12:  1
%e A285788   13:  1  4   6   8  9  10  12
%e A285788   14:  1  9
%e A285788   15:  1  4   8  14
%e A285788   16:  1  9  15
%e A285788   ...
%t A285788 Table[Select[Range@ n, And[! PrimeQ@ #, CoprimeQ[#, n]] &], {n, 23}] // Flatten
%o A285788 (Python)
%o A285788 from sympy import gcd, isprime
%o A285788 def a(n): return list(filter(lambda k: isprime(k)==0 and gcd(k, n)==1, range(1, n + 1)))
%o A285788 for n in range(1, 21): print(a(n)) # _Indranil Ghosh_, Apr 26 2017
%Y A285788 Cf. A038566, A048597, A048864, A112484.
%K A285788 nonn,easy,tabf
%O A285788 1,6
%A A285788 _Michael De Vlieger_, Apr 26 2017