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.

A188794 a(n) is the smallest integer k >= 2 such that the number of divisors d>1 of n-k with k|(n-d) equals A188550(n).

Original entry on oeis.org

2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 5, 2, 3, 4, 2, 2, 3, 2, 3, 2, 5, 4, 2, 2, 3, 4, 2, 2, 3, 2, 3, 2, 2, 3, 7, 2, 3, 4, 2, 2, 5, 2, 3, 2, 3, 4, 2, 2, 3, 4, 5, 2, 2, 4, 3, 2, 2, 2, 3, 2, 3, 4, 2, 6, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 2, 2, 7, 2, 3, 4, 5, 6, 2, 2, 3, 4, 2, 2, 3, 8, 5, 2, 2, 3, 4, 2, 3, 2, 3, 2
Offset: 4

Views

Author

Vladimir Shevelev, Apr 10 2011

Keywords

Comments

a(n) <= floor(sqrt(n)) follows from the definition of A188550.

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) local h, i, k, m;
           m,i:= 0,0;
           for k from 2 to floor(sqrt(n)) do
              h:= nops(select(x-> irem(x, k)=0,
                  [seq (n-d, d=divisors(n-k) minus{1})]));
              if h>m then m,i:= h,k fi
           od; i
        end:
    seq(a(n), n=4..120);  # Alois P. Heinz, Apr 10 2011
  • Mathematica
    a[n_] := Module[{h, i = 0, k, m = 0}, For[k = 2, k <= Floor[Sqrt[n]], k++, h = Length[Select[Table[n-d, {d, Rest[Divisors[n-k]]}], Mod[#, k] == 0&]]; If[h > m, {m, i} = {h, k}]]; i];
    a /@ Range[4, 120] (* Jean-François Alcover, Oct 28 2020, after Alois P. Heinz *)