OFFSET
1,2
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..500
Sean A. Irvine, Java program (github)
EXAMPLE
The arithmetic mean of the first 7 elements is (1 + 2 + 4 + 7 + 11 + 16 + 24) / 7 = 65 / 7; this is not an integer. But skipping a(5) = 11 yields m = 54 / 6 = 9, so we have a(8) = a(7) + m = 24 + 9 = 33.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Module[{k, s}, For[k = n-1, k >= 1, k--, s = Select[Mean /@ Subsets[Array[a, n-1], {k}], IntegerQ] // Sort; If[s != {}, Return[a[n-1] + Last[s]]]]]; Table[a[n], {n, 1, 45}] (* Jean-François Alcover, Dec 11 2014 *)
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
Reinhard Zumkeller, Jul 28 2001
STATUS
approved