AUTHOR=Zhang Pengfei TITLE=Which headache disorders can be diagnosed concurrently? An analysis of ICHD3 criteria using prime encoding system JOURNAL=Frontiers in Neurology VOLUME=Volume 14 - 2023 YEAR=2023 URL=https://www.frontiersin.org/journals/neurology/articles/10.3389/fneur.2023.1221209 DOI=10.3389/fneur.2023.1221209 ISSN=1664-2295 ABSTRACT=Real life headache presentations may fit more than one ICHD3 diagnoses. This project seeks to exhaustively list all logically consistent "co-diagnoses" according to the ICHD3 criteria. We limit our project to cases of two concurrent diagnoses.We included the criteria for "Migraine" (1.1, 1.2, 1.3), "Tension-type headache" (2.1, 2.2, 2.3, 2.4), "Trigeminal autonomic cephalalgias" (3.1, 3.2, 3.3, 3.4, 3.5), as well as all "Other primary headache disorders". We also excluded "probable" diagnosis criteria.Each characteristic in the above criteria is assigned a unique prime number. We then encoded each ICHD3 criteria into integers through multiplication in a list format; we call these criteria representations. "Codiagnoses representations" are generated by multiplying all possible pairings of criteria representations.We then manually encode a list of logically inconsistent characteristics through multiplication.All co-diagnoses representation divisible by any inconsistency representations are filtered out, generating a list of co-diagnoses representation that are logically consistent. This list is then translated back into ICHD3 diagnoses.We used a total of 103 prime numbers to encode 578 ICHD3 criteria. Once illogical characteristics were excluded, we obtained 145 dual diagnoses. Of the dual diagnoses, 2 contains intersecting characteristics due to subset relationships, 14 contains intersecting characteristic, 4 without subset relationships, 129 contains dual diagnoses as a result of non-intersecting characteristics.Analysis of dual diagnosis in headaches offer insight into "loopholes" in the ICHD3 as well as potential explanation for sources of a number of controversies in headache disorder. The existence of dual diagnosis and their identification may carry implications for future developments and testing of machine learning diagnostic algorithms in headache.