At sixes and sevens
A state of confusion and disorder, or of disagreement between parties.
The derivation of this phrase is rather difficult to trace, not least because it has changed in both form and meaning over the nine centuries or so that it has been in use. The phrase was originally 'to set on six and seven' and is thought to have derived in the 14th century from the game of dice. The meaning then was 'to carelessly risk one's entire fortune'. The earliest citation in print is Chaucer's Troilus and Criseyde, 1374:
"Lat nat this wrechched wo thyn herte gnawe, But manly set the world on sexe and seuene."
'Six and seven' is probably a corruption of 'cinque and six', French for the numerals five and six. Some may feel that this is a step too far, and the theory does set the folk-etymology antennae twitching. The OED supports the idea though, which will be good enough authority for most people.
If things had stayed that way the origin of the phrase would be fairly cut and dried and there would be little more to say. As we know though, it is now given as 'at sixes and sevens', having mutated via 'at six and seven', and the current meaning refers to a state of confusion, disorder or disagreement, not one of risk.
There's no question of these different versions arising independently; the movement from one to another was gradual and they overlap each other in time. The first appearance in print of 'at six and seven' is in 1535 and the last citation of 'on six and seven' in 1601. The first appearance of 'at sixes and sevens' was in 1670, in Leti's Il cardinalismo di Santa Chiesa, translated or, as the subtitle of the work helpfully notes, 'faithfully Englished' by G. H., 1670:
"They leave things at sixes and sevens."
There are two other stories that contend for the honour of being the source of this phrase (or one of the versions of it at least). One is the biblical text - Job 5:19 (King James Version):
"He shall deliver thee in six troubles: yea, in seven there shall no evil touch thee."
Other than being old and including the numbers six and seven, this doesn't seem to make a very strong claim. Chaucer would though have been familiar with earlier versions of this Bible story in Latin.
The other is an appealing tale. The mediaeval Livery Companies that were established in London include The Worshipful Company of Merchant Taylors (Tailors) and The Worshipful Company of Skinners (Fur Traders). The precedence of the companies was set in 1515, but these two companies disputed their positions and a compromise was agreed by which they exchange sixth and seventh place each year, at Easter.
Given that the Chaucer quotation is earlier, the Livery Company story can't be the source of 'set on six and seven'. It is quite possible though that, having the existing phrase, the coincidence of the dispute being between the sixth and seventh places caused the migration in meaning. If that is in fact what happened then it could be argued that this is how the present day phrase originated.