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.

A302245 Maximum remainder of p*q divided by p+q with 0 < p <= q <= n.

This page as a plain text file.
%I A302245 #38 Apr 11 2018 04:59:22
%S A302245 1,2,3,5,7,8,11,11,15,15,19,19,23,23,27,27,31,31,35,35,39,39,43,43,47,
%T A302245 47,51,51,55,55,59,59,63,63,67,67,71,71,75,75,79,79,83,83,87,87,91,91,
%U A302245 95,95,99,99,103,103,107,107,111,111,115,115,119,119,123,123
%N A302245 Maximum remainder of p*q divided by p+q with 0 < p <= q <= n.
%F A302245 Conjecture: a(n) = 2*(n - 2) - (-1)^n for n > 6.
%F A302245 From _Altug Alkan_ and _Robert Israel_, Apr 05 2018: (Start)
%F A302245 Proof of conjecture:
%F A302245 For n >= 3 odd, we do have p=n-2, q=n, p*q = n^2-2*n = (n-3)/2 * (p+q) + 2*n-3, so a remainder of 2*n-3 is possible.
%F A302245 The only possible p <= q <= n with p+q-1 > 2*n-3 are p=n-1,q=n and p=n,q=n, neither of which can improve on this:
%F A302245 For p=q=n, p*q = (n-1)/2 * (p+q) + n with n <= 2*n-3.
%F A302245 For p=n-1, q=n, p*q = (n-1)/2 * (p+q) + (n-1)/2 with (n-1)/2 < n
%F A302245 For n >= 8 even, we have all the cases that worked for n-1, with maximum remainder 2*(n-1)-3 = 2*n-5, and additional possibilities q=n,p=n-3 to n, which don't improve on this:
%F A302245 For p=n-3, q=n, p*q = (n/2-1)*(p+q) + n/2-3 with n/2-3 < 2*n-5
%F A302245 For p=n-2, q=n, p*q = (n/2-1)*(p+q) + n-2 with n-2 < 2*n-5
%F A302245 For p=n-1, q=n, p*q = (n/2-1)*(p+q) + 3*n/2-1 with 3*n/2-1 < 2*n-5.
%F A302245 For p=n, q=n, p*q = (n/2)*(p+q) + 0.
%F A302245 (End)
%e A302245 For n=2 the three possible pairs of positive numbers are enumerated in the following table
%e A302245 (i,j) (i*j) (i+j) (i*j) mod (i+j)
%e A302245 (1,1)   1     2          1
%e A302245 (1,2)   2     3          2
%e A302245 (2,2)   4     4          0
%e A302245 The greatest remainder is 2 then a(2)=2, and similarly for n=3 the corresponding table is
%e A302245 (i,j) (i*j) (i+j) (i*j) mod (i+j)
%e A302245 (1,1)   1     2          1
%e A302245 (1,2)   2     3          2
%e A302245 (2,2)   4     4          0
%e A302245 (1,3)   3     4          3
%e A302245 (2,3)   6     5          1
%e A302245 (3,3)   9     6          3
%e A302245 The greatest remainder is 3, then a(3)=3.
%p A302245 1, 2, 3, 5, 7, 8, seq(2*(n-2)-(-1)^n, n=7..100); # _Robert Israel_, Apr 05 2018
%t A302245 a[n_]:=Table[Table[Mod[i*j, i + j], {i, 1, j}], {j, 1, n}]//Flatten//Max;
%t A302245 Table[a[n], {n, 1, 64}]
%o A302245 (PARI) a(n) = vecmax(vector(n, q, vecmax(vector(q, p, (p*q) % (p+q))))); \\ _Michel Marcus_, Apr 05 2018
%o A302245 (PARI) a(n) = if(n<7,(n+2)*(n+4)\9, 2*(n-2)-(-1)^n); \\ _Altug Alkan_, Apr 07 2018
%Y A302245 Cf. A168269, A302446.
%K A302245 nonn,easy
%O A302245 1,2
%A A302245 _Andres Cicuttin_, Apr 03 2018