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.

A282025 a(r) is the maximum number of secretaries for which the first r should be rejected, if selecting the one with the highest or lowest ranking are both considered a success.

Original entry on oeis.org

3, 8, 13, 18, 23, 27, 32, 37, 42, 47, 52, 57, 62, 67, 72, 77, 82, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 214, 219, 224, 229, 234, 239, 244, 249, 254, 259, 264, 269, 273, 278, 283
Offset: 0

Views

Author

N. J. A. Sloane, Feb 11 2017

Keywords

Comments

According to Bayon et al, the probability P(n,r) = 2*r*((r/n-1)+sum_{i=r..n-1} 1/i)/n of success in a generalized Secretary problem for a given number n of applicants has a maximum at some value of r, 1<=r
The Beatty sequence of A106533, b(n) = floor(n*A106533), is a good approximation to r for large n. So the indices n-1 of the steps where b(n) = b(n+1)-1 are an approximation to this sequence.
We added numbers 27, 86 and 91 that are apparently missing in the preprint. R. J. Mathar, Feb 22 2017

Crossrefs

Programs

  • Maple
    P := proc(n,
        option remember;
        local i;
        2*r/n*((r/n-1)+add(1/i,i=r..n-1)) ;
    end proc:
    Pmax := proc(n)
        option remember;
        local r;
        for r from 1 to n-1 do
            if P(n,r+1) < P(n,r) then
                return r ;
            end if;
        end do:
    end proc:
    A282025 := proc(r)
        local n ;
        if r = 0 then
            return 3;
        end if;
        for n from r+1 do
            if Pmax(n+1) = r+1 then
                return n;
            end if;
        end do:
        return -1 ;
    end proc:
    seq(A282025(r),r=0..80) ; # R. J. Mathar, Feb 22 2017
  • Mathematica
    P[n_, r_] := 2 r ((r/n - 1) + Sum[ 1/i, {i, r, n - 1}])/n; Function[s, {3}~Join~Map[-1 + Position[s, #][[1, 1]] &, Range@ Max@ s]]@ Map[Length@ TakeWhile[#, # == 0 &] &, Table[If[P[n, k + 1] < P[n, k], k, 0], {n, 300}, {k, n - 1}]] (* Michael De Vlieger, Feb 22 2017, after Maple *)