OFFSET
1,2
LINKS
Iain Fox, Table of n, a(n) for n = 1..10000
FORMULA
Lim_{n->infinity} (a(1) + a(2) + ... + a(n))/n = 1.64948851...
EXAMPLE
Sequence starts with 1, 2, 3. Then 3 copies of 1, 2 are appended, giving 1, 2, 3, 1, 2, 1, 2, 1, 2. Then 2 copies of everything but the final entry 2 are appended, giving 9 + 8 + 8 + 8 = 33 terms.
MATHEMATICA
Nest[Join[#, Flatten@ ConstantArray[Drop[#, -1], #[[-1]]] ] &, {1, 2, 3}, 4] (* Michael De Vlieger, Dec 08 2018 *)
PROG
(PARI) gen(n, v=[1, 2, 3], w) = for(x=1, n, w=vector(#v-1, i, v[i]); for(y=1, v[#v], v=concat(v, w))); v
CROSSREFS
KEYWORD
nonn
AUTHOR
Iain Fox, Dec 07 2018
EXTENSIONS
Self-contained definition from M. F. Hasler, Dec 10 2018
STATUS
approved