OFFSET
1,2
COMMENTS
For even n, a(n) is just the smallest positive integer not already in the sequence. For odd n>=3, say n=2k-1, a(n) = 3^k - (a(k)+...+a(n-1)).
MATHEMATICA
a[n_] := a[n]=Module[{s, sm, i, k}, s=Table[a[i], {i, 1, n-1}]; If[EvenQ[n], For[i=1, MemberQ[s, i], i++, Null]; Return[i]]; sm=Sum[a[i], {i, k=(n+1)/2, n-1}]; For[i=Ceiling[(sm+1)^(1/k)], MemberQ[s, i^k-sm], i++, Null]; i^k-sm]
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Oct 25 2002
EXTENSIONS
Edited by Dean Hickerson, Dec 02 2002
STATUS
approved