Allan G. Bromley, in the 1990 article Difference and Analytical Engines, wrote,
All but one of the programs cited in her notes had been prepared by Babbage from three to seven years earlier. The exception was prepared by Babbage for her, although she did detect a 'bug' in it. Not only is there no evidence that Ada ever prepared a program for the Analytical Engine, but her correspondence with Babbage shows that she did not have the knowledge to do so.
Bruce Collier wrote in his PhD thesis,
She made a considerable contribution to publicizing the Analytical Engine, but there is no evidence that she advanced the design or theory of it in anyway.
What are the primary sources?
Babbage wrote in his Autobiography in 1864 ,
I then suggested that she add some notes to Menabrea's memoir, an idea which was immediately adopted. We discussed together the various illustrations that might be introduced; I suggested several but the selection was entirely her own. So also was the algebraic working out of the different problems, except, indeed, that relating to the numbers of Bernoulli, which I had offered to do to save Lady Lovelace the trouble. This she sent back to me for an amendment, having detected a grave mistake which I had made in the process.
My Interpretation: Babbage states, that he developed the Bernoulli numbers program published in Ada Lovelace's Note G in 1843.
In a letter to Babbage dated 5 July 1843 Lovelace wrote,
I am doggedly attacking and sifting to the very bottom, all the ways
of deducing the Bernoulli Numbers.
In a letter to Babbage dated 10 July 1843 Lovelace wrote,
I want to put in something about Bernoulli’s Numbers, in one of my Notes, as an example of how an implicit function may be worked out by the engine, without having been worked out by human head & hands first. Give me the necessary data & formulae.
In her Note G she explained, what is meant by "data" for the Bernoulli numbers:
Six numerical data are in this case necessary for making the requisite combinations. These data are 1, 2, n, B1, B3, B5.
Beside the data, the Bernoulli numbers diagram contains also formulae. These formulae are 2n-1, 2n+1, etc..
My interpretation: Lovelace got the whole content of the Bernoulli numbers diagram (Figure 1) from Babbage.
In a letter to Babbage dated 21 July 1843 Lovelace wrote,
I am in much dismay at having got into so amazing a quagmire and
botheration with these Numbers, that I cannot possibly get the thing
done today... . at this moment I am in a charming state of confusion.
The Notes were completed by August 1843, and that they appeared as the last article of Volume 3 of Taylor's Scientific Memoirs in September 1843.
By the end of July 1843, Ada had pretty much finished writing her notes.
In a letter to Babbage dated 14 August 1843 Lovelace wrote,
...arrangement of the notes are shaped, they are very complete...
So she did the work on the Bernoulli numbers program (Figure 1) in a month. In this short period of time, she also must have written at least large parts of Note G (the part concerning the Bernoulli program) and did make this ready for publication.
Is the Bernoulli numbers program the "first computer program"?
Kim and Toole wrote,
Many people, for instance, incorrectly claim that Ada was the first computer programmer. (Babbage, not Ada, wrote the first programs for his Analytical Engine, although most were never published.)
Allan G. Bromley wrote:
Some two dozen programs for the Analytical Engine exist dated between 1837 and 1840.
The programs concerning the Gauss elimination are as complex as the Bernoulli numbers program.
My interpretation: The Bernoulli numbers program is not the first computer program.