Leo van de Pas, produced the following table which he posted to Gen-Med Dec 2012 showing the nearest royal ancestor for each British Prime Minister
Sir Robert Walpole - Edward III
Spencer Compton, Earl of Wilmington Edward III
Henry Pelham (Henry VIII) Edward III
Thomas Pelham-Holles Duke of Newcastle (Henry VIII) Edward III
William Cavendish Duke of Devonshire Henry IV
John Stuart, Earl of Bute James V
George Grenville Edward III
Marquess of Rockingham Edward III
Earl of Chatham (Henry VIII) Edward III
Duke of Grafton Charles II
Frederick North (Henry VIII) Edward III
Marquess of Lansdowne Edward I
Duke of Portland Edward IV
William Pitt the Younger (Henry VIII) Edward III
Henry Addington Aethelred II
Lord Grenville (Henry VIII) Edward III
Spencer Perceval (Henry VIII) Edward III
Frederick John Robinson James V
Duke of Wellington James II
Earl Grey Edward III
Viscount Melbourne Edward III
John Russell Charles II
Earl of Derby James IV
Earl of Aberdeen James IV
Marquess of Salisbury Edward IV
Earl of Rosebery James V
Arthur Balfour James IV
Neville Chamberlain Edward III
Sir Winston Churchill James IV
Sir Anthony Eden Charles II
Sir Alec Douglas Home Charles II
Margaret Thatcher ?Henry IV
Tony Blair James V
David Cameron William IV