This is an odd idea, but it does pose some interesting problems...
So you would have the starting and ending notes and frequencies, and then only a list of frequencies for the remaining notes in a list below them, right? And then a person who puts them in order correctly hears the song and is let in. I hope i understand this correctly, because im thinking about using this to get my programming skills focused before the semester starts.
One point however, your mathmatical equation, with only pluses and minuses, would not work as you intend it to work. I could easily switch any two numbers being added, or i could switch any two numbers being subtracted, and i would still get the desired 440.
Maybe, instead of dealing with mathmatics, just have each user program a specific melodic fragment and then the user must input the missing pieces. You could also do this with chords. A user creates a chord (lets say, G4 B4 D5 F#5 A5, or G maj 9) and then the user inserts the notes in his chord.