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.

A281531 a(n) is the least numerator k such that the proper fraction k/n needs three or more terms as an Egyptian fraction, or 0 if no such numerator exists.

Original entry on oeis.org

0, 0, 0, 4, 0, 3, 7, 7, 8, 5, 11, 3, 6, 7, 7, 4, 13, 3, 13, 9, 5, 5, 17, 4, 6, 8, 12, 4, 14, 3, 7, 5, 8, 11, 17, 3, 6, 9, 17, 4, 18, 3, 7, 11, 7, 5, 21, 3, 8, 7, 11, 4, 13, 9, 13, 7, 7, 7, 28, 3, 5, 13, 7, 4, 10, 3, 11, 11, 13, 5, 23, 3, 6, 11, 9, 5, 11, 3, 19
Offset: 2

Views

Author

Arkadiusz Wesolowski, Jan 23 2017

Keywords

Comments

If n > 3 is prime, a(n) = A007978(n+1). - Robert Israel, Dec 26 2019

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [2..80] do for k in [1..n-1] do f:=k/n; x:=1; v:=0; if Numerator(f) eq 1 then v:=1; else while f lt 2/x do if Numerator(f-1/x) eq 1 then v:=1; break; end if; x+:=1; end while; end if; if v eq 0 then Append(~lst, k); break; end if; if k eq n-1 then Append(~lst, 0); end if; end for; end for; lst;
  • Maple
    f:= proc(n) option remember; local k,T;
      T:= numtheory:-divisors(n^2);
      for k from 2 to n-1 do
        g:= igcd(k,n);
        if g > 1 then
           r:= procname(n/g);
           if k = r*g then return k fi;
        else
           if not member(-n mod k,  T mod k) then return k fi
        fi
      od;
    0
    end proc;
    map(f, [$2..100]); # Robert Israel, Dec 25 2019
  • Mathematica
    a[n_] := a[n] = Module[{k, T}, T = Divisors[n^2]; For[k = 2, k <= n - 1, k++, g = GCD[k, n]; If[g > 1, r = a[n/g]; If[k == r g, Return [k]], If[FreeQ[Mod[T, k], Mod[-n, k]], Return [k]]]]; 0];
    a /@ Range[2, 100] (* Jean-François Alcover, Oct 06 2020, after Robert Israel *)