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.

Showing 1-2 of 2 results.

A228286 Smallest x + y*z, given x*y + z = n (for positive integers x, y, z).

Original entry on oeis.org

2, 3, 4, 4, 6, 5, 7, 6, 6, 7, 9, 7, 10, 9, 8, 8, 12, 9, 12, 9, 10, 13, 15, 10, 10, 15, 12, 11, 15, 11, 16, 12, 14, 17, 12, 12, 17, 21, 16, 13, 18, 13, 19, 15, 14, 19, 24, 14, 14, 15, 20, 17, 21, 15, 16, 15, 22, 25, 28, 16, 22, 27, 16, 16, 18, 17, 23, 21, 25, 17
Offset: 2

Views

Author

Andy Niedermaier, Aug 19 2013

Keywords

Comments

One of the terms in this sequence is the subject of a problem on the 2013 ARML contest (Team Round).
The Mathematica code below computes the quadruple {x, y, z, a(n)}, where z is as small as possible (in the event of a tie).

Examples

			For n = 160, a(n) = 50, as 26 * 6 + 4 = 160 and 26 + 6 * 4 = 50 and no triple of positive integers (x, y, z) with xy + z = 160 gives a smaller value for x + yz.
		

Crossrefs

Cf. A228287 (z-coordinate of the triple (x, y, z) that minimizes x + yz).
Cf. A228288 (least k such that z = n, given xy + z = k and x + yz is minimized).

Programs

  • Maple
    A228286 := proc(n)
        local a,x,y,z ;
        a := n+n^2 ;
        for z from 1 to n-1 do
            for x in numtheory[divisors](n-z) do
                y := (n-z)/x ;
                a := min(a, x+y*z) ;
            end do:
        end do:
        return a;
    end proc: # R. J. Mathar, Sep 02 2013
  • Mathematica
    a[n_] := Module[{X, bX, bT, m},
      bT = n + 1;
      bX = {n - 1, 1, 1, n};
      X = bX;
      m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]];
      While[bT >= m && X[[3]] <= n/2,
       X[[2]] = Max[1, Floor[(n - bX[[3]])/bT]];
       While[X[[2]] <= Floor[bT/X[[3]]],
        If[Mod[n - X[[3]], X[[2]]] == 0,
         X[[1]] = (n - X[[3]])/X[[2]];
         X[[4]] = X[[1]] + X[[2]]*X[[3]];
         If[X[[4]] < bX[[4]], bX = X]];
        X[[2]] = X[[2]] + 1];
       X[[3]] = X[[3]] + 1;
       m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]]];
      Return[bX]]; Table[a[n][[-1]], {n, 2, 100}]

A228288 Smallest k such that z = n in the minimal value of x + y*z, given x*y + z = k (for positive integers x, y, z).

Original entry on oeis.org

2, 8, 48, 160, 720, 790, 1690, 4572, 13815, 22031, 22032, 79965, 209013, 546035, 546036, 546037, 2932793, 2037794, 2932795, 12433772, 17529248, 9945922, 72105623, 72105624, 72105625, 195099674, 205216242, 222426196, 222426197, 984126926
Offset: 1

Views

Author

Andy Niedermaier, Aug 19 2013

Keywords

Comments

The first decrease in the sequence is at a(17) > a(18). [Andy Niedermaier, Sep 01 2013]
No value of z larger than 25 appears in the first 10^8 terms of A228287.

Examples

			For n = 3, a(n) = 48. This is because for 2 <= n < 48, z = 1 or z = 2 in the smallest value of x + yz (given xy + z = n). But for xy + z = 48, the minimal x + yz is given for (x, y, z) = (15, 3, 3).
In cases where multiple triples (x, y, z) achieve the smallest value for x + yz, we consider the triple with the smaller value of z. (See A228287.) Thus, even though for n = 215, (53, 4, 3) and (35, 6, 5) give the minimum value for x + yz, a(5) cannot equal 215. (720 is the smallest n for which we MUST have z = 5 in order to achieve the minimum x + yz.)
		

Crossrefs

Formula

a(n) = min {k: A228287(k)=n}. Smallest greedy inverse of A228287. - R. J. Mathar, Sep 02 2013

Extensions

Added terms a(17) through a(25). - Andy Niedermaier, Sep 02 2013
Added terms a(26) through a(30). - Andy Niedermaier, Sep 11 2013
Showing 1-2 of 2 results.