OFFSET
1,2
COMMENTS
It appears that a(n) exists for each n, and that the sequence is increasing.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = 7 because the Fibonacci-like sequence 2, 1, 3, 4, 7, 11, ... contains 7 and the sum of the first two terms is 3, while no smaller sequences work. (All terms must be nonnegative.)
MATHEMATICA
A249783[n_] := A249783[n] = Module[{a, k, A, B}, If[n<2, Return[n]]; For[k = 1, k <= n-1, k++, For[a=0, a <= k-1, a++, A = a; B = k-A; While[B<n, {A, B} = {B, A+B}]; If[B==n, Return[k]]]]; n]; a[1]=1; a[n_] := a[n] = For[k = a[n-1], True, k++, If[A249783[k] == n, Return[k]]]; Array[a, 50] (* Jean-François Alcover, Jan 06 2017, adapted from PARI *)
PROG
A249783(n)=if(n<2, return(n)); for(k=1, n-1, for(a=0, k-1, my(A=a, B=k-A); while(B<n, [A, B]=[B, A+B]); if(B==n, return(k)))); n
v=vector(100); least=1; for(n=1, 1e7, if(aa(n)<least, next); t=a(n); if(t>=least&&t<=#v&&v[t]==0, v[t]=n; while(v[least], if(least++>#v, return(v)))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Nov 13 2014
STATUS
approved