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.

A228287 Smallest value of z in the minimal value of x + y*z, given x*y + z = n (where x, y, z are positive integers).

This page as a plain text file.
%I A228287 #24 Feb 09 2025 17:30:54
%S A228287 1,1,1,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,1,1,2,1,2,1,1,2,
%T A228287 1,1,2,1,1,1,2,1,2,1,1,2,3,1,1,1,1,1,2,1,1,1,1,2,3,1,2,3,1,1,1,1,2,1,
%U A228287 2,1,2,1,2,3,1,1,1,1,2,1,1,2,3,1,1,2,1
%N A228287 Smallest value of z in the minimal value of x + y*z, given x*y + z = n (where x, y, z are positive integers).
%C A228287 If there are multiple triples (x, y, z) for which xy + z = n and x + yz is minimized, consider the triple with smallest z. I.e., this sequence illustrates the smallest z needed to minimize x + y*z.
%e A228287 For n = 215 the triples (53, 4, 3) and (35, 6, 5) both give the minimal value of x + yz = 65. Thus a(215) = 3.
%p A228287 A228287 := proc(n)
%p A228287     local a,x,y,z,zfin ;
%p A228287     a := n+n^2 ;
%p A228287     zfin := n ;
%p A228287     for z from 1 to n-1 do
%p A228287         for x in numtheory[divisors](n-z) do
%p A228287             y := (n-z)/x ;
%p A228287             if x+y*z < a then
%p A228287                 a := x+y*z ;
%p A228287                 zfin := z ;
%p A228287             end if;
%p A228287         end do:
%p A228287     end do:
%p A228287     return zfin;
%p A228287 end proc: # _R. J. Mathar_, Sep 02 2013
%t A228287 A228287[n_] := Module[{a, x, y, z, zfin}, a = n + n^2; zfin = n; Do[Do[y = (n-z)/x; If[x + y*z < a, a = x + y*z; zfin = z], {x, Divisors[n-z]}], {z, 1, n-1}]; zfin];
%t A228287 Table[A228287[n], {n, 2, 100}] (* _Jean-François Alcover_, Aug 08 2023, after _R. J. Mathar_ *)
%Y A228287 Cf. A228286.
%K A228287 nonn
%O A228287 2,7
%A A228287 _Andy Niedermaier_, Aug 19 2013