Windows XP (and later versions) batch script. This batch function when given a single argument - amount, generates amount+1 Fibonacci numbers and returns them as a string (BATCH doesn't really have sets) in variable %r% (369 characters, or 347 characters - if we remove indentation):
:f
set i=0
set r=1
set n=1
set f=0
:l
if %n% GTR %~1 goto e
set f=%f% %r%
set /A s=%i%+%r%
set i=%r%
set r=%s%
set /A n+=1
goto l
:e
set r=%f%
exit /B 0
And here's the complete script, to see it in action (just copy-past it into a CMD or BAT file and run it):
@echo off
call :ff 0
call :ff 1
call :ff 2
call :ff 3
call :ff 5
call :ff 10
call :ff 15
call :ff 20
exit /B 0
:ff
call :f "%~1"
echo %~1: %r%
exit /B 0
:f
set i=0
set r=1
set n=1
set f=0
:l
if %n% GTR %~1 goto e
set f=%f% %r%
set /A s=%i%+%r%
set i=%r%
set r=%s%
set /A n+=1
goto l
:e
set r=%f%
exit /B 0