OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
For n=3, we have the reciprocals {1, 1/2, 1/3} with sums of pairs {1+1, 1+1/2, 1+1/3, 1/2+1/2, 1/2+1/3, 1/3+1/3} = {2, 3/2, 4/3, 1, 5/6, 2/3}. These are all distinct, so a(3) = 6.
MAPLE
N:= 1000;
S:= {}:
for n from 1 to N do
S:= S union {seq(1/n + 1/j, j=1..n)};
A[n]:= nops(S);
od:
seq(A[n], n=1..N);
# Robert Israel, Jul 09 2014
MATHEMATICA
M = 100; S = {};
For[n = 1, n <= M, n++, S = S ~Union~ Table[1/n + 1/j, {j, 1, n}]; A[n] = Length[S]];
Array[A, M] (* Jean-François Alcover, Mar 22 2019, from Maple *)
PROG
(PARI) a(n) = {vr = vector(n, i, 1/i); vds = []; for (i=1, n, for (j=1, i, vds = Set(concat(vds, vr[i]+vr[j])); ); ); #vds; } \\ Michel Marcus, Jul 09 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Mar 31 2010
STATUS
approved