It wasn't quite my first program, but during one of my introductory high school programming courses I independently derived binary search (though of course I didn't realize it at the time). Additionally, this was well before I discovered what recursion was (I wonder if anyone else vividly remembers having their mind blown the first time they were introduced to recursion).
The funny part is that I abandoned the binary search strategy nearly immediately after conceiving it. Why? Because I realized that the array needed to be sorted in order for the search to work... and, at the time, the only sorting routine that I knew of was bubble sort. :)