A302706 a(n) is the maximum remainder of x^2 + y^2 divided by x + y with 0 < x <= y <= n.
0, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 16, 18, 18, 18, 26, 27, 28, 29, 30, 32, 32, 33, 34, 35, 40, 40, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 72, 72, 72, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 98, 98, 98, 98, 98, 98, 99, 100, 104, 104, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132
Offset: 1
Examples
a(1) = 0 because x = y = 1 is only option. a(13) = a(14) = a(15) = 18 because (7^2 + 13^2) mod (7 + 13) = 18 is the largest corresponding remainder for them.
Links
- Altug Alkan, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
a[n_]:=Table[Table[Mod[x^2+y^2 ,x+y],{x,1,y}],{y,1,n}]//Flatten//Max; Table[a[n],{n,1,100}]
-
PARI
a(n) = vecmax(vector(n, x, vecmax(vector(x, y, (x^2+y^2) % (x+y))))); \\ after Michel Marcus at A302245
Comments