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.

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

This page as a plain text file.
%I A228286 #21 Nov 17 2020 14:06:24
%S A228286 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,
%T A228286 15,11,16,12,14,17,12,12,17,21,16,13,18,13,19,15,14,19,24,14,14,15,20,
%U A228286 17,21,15,16,15,22,25,28,16,22,27,16,16,18,17,23,21,25,17
%N A228286 Smallest x + y*z, given x*y + z = n (for positive integers x, y, z).
%C A228286 One of the terms in this sequence is the subject of a problem on the 2013 ARML contest (Team Round).
%C A228286 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).
%H A228286 Peter Kagey, <a href="/A228286/b228286.txt">Table of n, a(n) for n = 2..10000</a>
%e A228286 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.
%p A228286 A228286 := proc(n)
%p A228286     local a,x,y,z ;
%p A228286     a := n+n^2 ;
%p A228286     for z from 1 to n-1 do
%p A228286         for x in numtheory[divisors](n-z) do
%p A228286             y := (n-z)/x ;
%p A228286             a := min(a, x+y*z) ;
%p A228286         end do:
%p A228286     end do:
%p A228286     return a;
%p A228286 end proc: # _R. J. Mathar_, Sep 02 2013
%t A228286 a[n_] := Module[{X, bX, bT, m},
%t A228286   bT = n + 1;
%t A228286   bX = {n - 1, 1, 1, n};
%t A228286   X = bX;
%t A228286   m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]];
%t A228286   While[bT >= m && X[[3]] <= n/2,
%t A228286    X[[2]] = Max[1, Floor[(n - bX[[3]])/bT]];
%t A228286    While[X[[2]] <= Floor[bT/X[[3]]],
%t A228286     If[Mod[n - X[[3]], X[[2]]] == 0,
%t A228286      X[[1]] = (n - X[[3]])/X[[2]];
%t A228286      X[[4]] = X[[1]] + X[[2]]*X[[3]];
%t A228286      If[X[[4]] < bX[[4]], bX = X]];
%t A228286     X[[2]] = X[[2]] + 1];
%t A228286    X[[3]] = X[[3]] + 1;
%t A228286    m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]]];
%t A228286   Return[bX]]; Table[a[n][[-1]], {n, 2, 100}]
%Y A228286 Cf. A228287 (z-coordinate of the triple (x, y, z) that minimizes x + yz).
%Y A228286 Cf. A228288 (least k such that z = n, given xy + z = k and x + yz is minimized).
%K A228286 nonn,look
%O A228286 2,1
%A A228286 _Andy Niedermaier_, Aug 19 2013