In January 1999, while preparing some work for his students, he identified a highly structured prime number with exactly two thousand digits. Dubbing this prime a millennium prime, he wrote an email about it to a niece and nephew, which was subsequently published by Folding Landscapes, the publishing house of the cartographer Tim Robinson. He donated his author royalties to the Irish Cancer Society, and subsequently wrote an Irishman's Diary column about it for the Irish Times newspaper. In July 1999 – while a participant in the Proth Search Group – he became the discoverer of the then-largest known composite Fermat number, a record which his St. Patrick's College based Proth-Gallot Group twice broke in 2003, the 1999 record having stood until then. The third of those records continued to stand until it was broken in June 2011.
Cosgrave, John B. and Dilcher, Karl. Mod p^3 analogues of theorems of Gauss and Jacobi on binomial coefficients, Acta Arithmetica, Vol. 142, No. 2, 103–118, 2010.
Cosgrave, John B. and Dilcher, Karl. Extensions of the Gauss-Wilson theorem, Integers: Electronic Journal of Combinatorial Number Theory, Vol. 8, #A39, 2008.
Cosgrave, John B. Number Theory and Cryptography , in David Joyner USNA, Coding Theory and Cryptography: From Enigma to Geheimschreiber to Quantum Theory, Springer-Verlag, 2000, pp 124–143.
Cosgrave, John B. A Prime for the Millennium, published by Folding Landscapes.
Cosgrave, John B. An Introduction to Number Theory with Talented Youth, USA School Science and Mathematics, Vol 99, No 6, October 1999.
Cosgrave, John B. Teaching Mathematics by Questioning – The Socratic Method, Newsletter of Irish Mathematics Teachers Association, Nos 81–82, 1993, 32–47.
Cosgrave, John B. A Halmos Problem and a Related Problem, American Mathematical Monthly, Vol. 101, No. 10, 993–996, December 1994.
Cosgrave, John B. A Remark on Euclid's Proof of the Infinitude of Primes, American Mathematical Monthly, Vol. 96, No. 4, 339–341, April 1989.
Cosgrave, John B. Transcendental numbers in the p-adic domain.
Cosgrave, John B. An application of Wilson's theorem to prove that 2^p = 2 when p is prime, A theorem about certain sequences, and A theorem about primes of the form a^2 + n^2, Mathematical Gazette, Oct. 1969.
Cosgrave, J. B. A new proof of Wilson's Theorem and A new proof of Wilson's theorem for primes of the form , Mathematical Gazette, Feb. 1967.