login
A387379
a(n) = number of quartets (n,u,v,w) of type 4; see Comments.
1
0, 0, 1, 3, 4, 11, 8, 17, 18, 28, 17, 49, 23, 46, 57, 64, 34, 91, 40, 108, 95, 91, 52, 169, 92, 113, 125, 177, 73, 247, 81, 194, 176, 162, 198, 329, 104, 188, 216, 356, 118, 391, 126, 320, 374, 244, 140, 507, 232, 388, 311, 401, 165, 514, 365, 559, 361, 327
OFFSET
1,4
COMMENTS
A 4-tuple (n,u,v,w) is a quartet of type 4 if n,u,v,w are positive integers such that n > v > 1 and n*(n - u) = v*(v + w).
EXAMPLE
For n=3, the unique quartet of type 4 is (3,1,2,1).
For n=4, the 3 quartets are (4,1,2,4), (4,1,3,1), (4,2,2,2).
For n=5, the 4 quartets are (5,1,2,8), (5,1,4,1), (5,2,3,2), (5,3,2,3).
For n=6, the 11 quartets are (6,1,2,13), (6,1,3,7), (6,1,5,1), (6,2,2,10), (6,2,3,5), (6,2,4,2), (6,3,2,7), (6,3,3,3), (6,4,2,4), (6,4,3,1), (6,5,2,1).
For n=7, the 8 quartets are (7,1,2,19), (7,1,3,11), (7,1,6,1), (7,2,5,2), (7,3,2,12), (7,3,4,3), (7,4,3,4), (7,5,2,5)
MATHEMATICA
ClearAll[solns4];
Options[solns4]={distinct->False};
(*types:1:m(m+u)=v(v+w) 2:m(m+u)=v(v-w) 3:m(m-u)=v(v-w) 4:m(m-u)=v(v+w), v>1*)
solns4[m_, u_, type:(1|2|3|4), OptionsPattern[]]:=Module[{sU, sW, n, nn, sgn, divs, tups, unique},
{sU, sW}=Switch[type, 1, {1, 1}, 2, {1, -1}, 3, {-1, -1}, 4, {-1, 1}];
n=m*(m+sU*u);
tups=If[sW==1, If[n<=0, {}, divs=Select[Divisors[n], #>n/#&]; (Map[{m, u, n/#, #-n/#}&, divs])], If[n==0, {}, nn=Abs[n]; sgn=Sign[n];
divs=Divisors[nn];
If[sgn>0, divs=Select[divs, #<nn/#&]]; ({m, u, nn/#, nn/#-sgn #}&/@divs)]];
unique=TrueQ[OptionValue[distinct]];
Select[tups, #[[3]]>1&&#[[4]]>0&&(!unique||Length@DeleteDuplicates[#]==4)&]];
Table[Total[Map[Length, Table[solns4[m, u, 4, distinct->False], {u, m-1}]]], {m, 200}]
(* Peter J. C. Moses, Aug 27 2025 *)
CROSSREFS
Sequence in context: A220848 A370605 A232891 * A096223 A232862 A344460
KEYWORD
nonn
AUTHOR
Clark Kimberling, Sep 03 2025
STATUS
approved