OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
a(9) = 2 because choosing a(9) = 1 gives the blocks (3,1,2) and (1,4,1), which are both of length 3 and sum to 6.
MAPLE
b:= proc(n) option remember; local i, t, ok;
if n<2 then n
else for t from 1+b(n-1) do ok:=true;
for i to n/2 while ok
do ok:=b(n-2*i)+t <> 2*b(n-i) od;
if ok then return t fi
od
fi
end:
a:= n-> b(n) -b(n-1):
seq(a(n), n=1..120); # Alois P. Heinz, May 26 2014
MATHEMATICA
b[n_] := b[n] = Module[{i, t, ok}, If[n<2, n, For[t = 1+b[n-1], True, t++, ok = True; For[i = 1, i <= n/2 && ok, i++, ok = b[n-2i] + t != 2b[n-i]]; If[ok, Return[t]]]]];
a[n_] := b[n] - b[n-1];
Array[a, 120] (* Jean-François Alcover, Nov 13 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, May 26 2014
STATUS
approved