Two celebrities who share the same name found themselves struggling to check into a hotel due to the computer system not allowing a duplicate.

Scottish actor Brian Cox, who plays Logan Roy on Succession, and Professor Brian Cox, the former musician turned physics professor who found fame presenting the BBC’s Wonders Of The Solar System, were both staying at the same London hotel on Thursday night ahead of an appearance on BBC Breakfast.

After Breakfast presenter Charlie Stayt asked them about any confusion from sharing a name with someone else in the spotlight, the 76-year-old actor said: “Sometimes sharing a name can be a bit confusing.”

“Well, last night was very confusing because (Prof) Brian arrived at the hotel and (they) said there are two Brian Coxes, so you’ve got two rooms.

READ MORE: Twitter ‘temporarily closes offices’ as more staff depart the company

“And he said, ‘no no, there’s only one, but I think there might be another Brian Cox’, and the hotel said to Brian, ‘we can’t have two Brian Coxes’.”

To which Prof Cox, 54, added: “They wouldn’t check me in!”

The Succession star added: “They wouldn’t check him in, so he had to use his assistant’s name.”

Prof Cox said: “I had to change my name. They couldn’t do it on their computer system. They didn’t believe me!

“And I got a picture up on my phone and said: ‘Look, this is Brian Cox, he’ll be coming later, and then this one…’ and (the hotel worker) said: ‘I know neither of you, I don’t watch television’.”

The actor, who first gained recognition for his extensive work with the Royal Shakespeare Company and the Royal National Theatre, had previously revealed he was initially “irked” to find he had a namesake after the pair were almost mixed up on a restaurant reservation.

In an interview with them both for The Guardian earlier this year, the actor said: “It annoyed me initially – but has been such a great lesson – to find someone who is extraordinarily successful with the same name as me.

“It irked me at first, then I thought, it’s not important.”

Stayt, 60, spoke to the Coxes on his own after his co-host Naga Munchetty had to “step away” from the sofa after losing her voice.