[go: up one dir, main page]

login
Number of different values assumed by a/b+c/d as a,b,c,d range between 1 and n.
2

%I #8 Apr 26 2015 18:01:43

%S 1,6,21,44,124,158,382,558,899,1087,2022,2328,3936,4542,5463,6755,

%T 10366,11306,16488,18315,21092,23455,32562,34901,43833,47945,56749,

%U 61726,80278,83515,106455,117566,129575,139126,156439,164489,203153,216586,235914,249462

%N Number of different values assumed by a/b+c/d as a,b,c,d range between 1 and n.

%H Robert Israel, <a href="/A119868/b119868.txt">Table of n, a(n) for n = 1..100</a>

%e a(2)=6 since we can obtain 6 values, i.e., {1, 3/2, 2, 5/2, 3, 4}.

%p fracs:= {1}:

%p A[1]:= 1:

%p for n from 2 to 100 do

%p fracs:= fracs union {seq(n/i,i=1..n-1)} union {seq(i/n,i=1..n-1)};

%p A[n]:= nops({seq(seq(fracs[i]+fracs[j],j=1..i),i=1..nops(fracs))});

%p od:

%p seq(A[n],n=1..100); # _Robert Israel_, Apr 26 2015

%t Table[Length@Union@Flatten@Table[a/b + c/d, {a,n}, {b,n}, {c,n}, {d,n}], {n,24}]

%t Table[Length[Union[#[[1]]/#[[2]]+#[[3]]/#[[4]]&/@Tuples[Range[n],{4}]]],{n,25}] (* _Harvey P. Dale_, Mar 04 2013 *)

%Y Cf. A119867.

%K nonn

%O 1,2

%A _Giovanni Resta_, May 26 2006

%E More terms from _Harvey P. Dale_, Mar 04 2013

%E a(31) to a(40) from _Robert Israel_, Apr 26 2015