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.

A347309 a(n) = gcd(b(n-1)+1, b(n)), where b is A347113.

Original entry on oeis.org

2, 5, 11, 23, 47, 5, 2, 3, 7, 3, 4, 3, 13, 9, 5, 2, 19, 13, 7, 8, 17, 5, 3, 5, 31, 21, 11, 3, 4, 3, 37, 25, 2, 29, 59, 17, 3, 2, 41, 83, 167, 5, 3, 2, 43, 29, 2, 3, 7, 19, 5, 23, 2, 3, 5, 61, 41, 7, 2, 53, 107, 43, 11, 7, 2, 67, 3, 4, 5, 71, 13, 3, 2, 3, 73, 3, 5, 2, 79, 53, 2, 7
Offset: 2

Views

Author

N. J. A. Sloane, Sep 01 2021

Keywords

Comments

The definition of A347113 forbids a(n) to be 1.

Crossrefs

Cf. A347113.

Programs

  • Maple
    b:= proc() true end:
    g:= proc(n) option remember; local j, k; j:= g(n-1)+1;
          for k from 2 do if b(k) and k<>j and igcd(k, j)>1
            then b(k):= false; return k fi od
        end: g(1):= 1:
    a:= n-> igcd(g(n-1)+1, g(n)):
    seq(a(n), n=2..100);  # Alois P. Heinz, Sep 02 2021
  • Mathematica
    b[_] = True;
    g[n_] := g[n] = Module[{j = g[n - 1] + 1, k},
         For[k = 2, True, k++, If[ b[k] && k != j && GCD[k, j] > 1,
              b[k] = False; Return[k]]]];
    g[1] = 1;
    a[n_] := GCD[g[n - 1] + 1, g[n]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, May 06 2022, after Alois P. Heinz *)