a[1] := 1; a[2] := 1; i := 3; sum := 0; while (a < 1000) do begin a := a[i - 1] + a[i - 2]; inc(i); end; for j := 1 to i do sum := sum + a; write(sum);