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.

A366192 Pairs (i, j) of noncoprime positive integers sorted first by i + j then by i.

Original entry on oeis.org

2, 2, 2, 4, 3, 3, 4, 2, 2, 6, 4, 4, 6, 2, 3, 6, 6, 3, 2, 8, 4, 6, 5, 5, 6, 4, 8, 2, 2, 10, 3, 9, 4, 8, 6, 6, 8, 4, 9, 3, 10, 2, 2, 12, 4, 10, 6, 8, 7, 7, 8, 6, 10, 4, 12, 2, 3, 12, 5, 10, 6, 9, 9, 6, 10, 5, 12, 3, 2, 14, 4, 12, 6, 10, 8, 8, 10, 6, 12, 4, 14, 2
Offset: 1

Views

Author

Peter Luschny, Oct 10 2023

Keywords

Comments

The rows of A290600 interleaved term by term with the reversed rows of A290600. - Peter Munn, Jan 28 2024

Examples

			The first few pairs are, seen as an irregular triangle (where rows with a prime index are empty (and are therefore missing)):
  [2,  2],
  [2,  4], [3,  3], [4, 2],
  [2,  6], [4,  4], [6, 2],
  [3,  6], [6,  3],
  [2,  8], [4,  6], [5, 5], [6, 4], [ 8, 2],
  [2, 10], [3,  9], [4, 8], [6, 6], [ 8, 4], [ 9, 3], [10, 2],
  [2, 12], [4, 10], [6, 8], [7, 7], [ 8, 6], [10, 4], [12, 2],
  [3, 12], [5, 10], [6, 9], [9, 6], [10, 5], [12, 3],
  ...
There are A016035(n) pairs in row n.
		

Crossrefs

Cf. A016035, A290600 (first bisection), A352911 (complement).

Programs

  • Maple
    aList := proc(upto) local F, P, n, t, count;
    P := NULL; count := 0:
    for n from 2 while count < upto do
        F := select(t -> igcd(t, n - t) <> 1, [$1..n-1]);
        P := P, seq([t, n - t], t = F);
        count := count + nops([F]) od:
    ListTools:-Flatten([P]) end:
    aList(16);
  • Mathematica
    A366192row[n_]:=Select[Array[{#,n-#}&,n-1],!CoprimeQ[First[#],Last[#]]&];
    Array[A366192row,20,2] (* Paolo Xausa, Nov 28 2023 *)
  • Python
    from math import gcd
    from itertools import chain, count, islice
    def A366192_gen(): # generator of terms
        return chain.from_iterable((i,n-i) for n in count(2) for i in range(1,n) if gcd(i,n-i)>1)
    A366192_list = list(islice(A366192_gen(),30)) # Chai Wah Wu, Oct 10 2023