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.

A172980 a(1)=1, a(2)=3; for n>=3, a(n) is the smallest number larger than a(n-1) such that, for every k

Original entry on oeis.org

1, 3, 4, 9, 11, 12, 13, 15, 16, 33, 37, 42, 43, 117, 154, 159, 163, 168, 173, 231, 338, 555, 557, 558, 649, 1161, 1168, 1209, 1213, 1254, 1259, 1263, 1406, 1467, 1573, 1578, 1579, 2595, 2752, 2805, 2813, 2964, 2969, 2997, 3014, 5013, 5021, 5022, 5057, 5115
Offset: 1

Views

Author

Vladimir Shevelev, Nov 21 2010

Keywords

Comments

Using the Chinese remainder theorem, it is easy to prove that the sequence is infinite.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
         local ok, m, k;
         if n<3 then 2*n-1
       else for m from a(n-1)+1 do
              ok:= true;
              for k from 1 to n-1 do
                if igcd(n, k)=1 xor igcd(m, a(k))=1
                   then ok:= false; break fi
              od;
              if ok then break fi
            od; m
         fi
        end:
    seq (a(n), n=1..50);  # Alois P. Heinz, Nov 21 2010
  • Mathematica
    a[1]=1; a[2]=3; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[AllTrue[ Range[n-1], CoprimeQ[k, a[#]] == CoprimeQ[n, #]&], Return[k]]]; Table[ a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 25 2017 *)

Extensions

More terms from Alois P. Heinz, Nov 21 2010