Emulating Primality with Multiset Representations of Natural Numbers

  • Paul Tarau
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6916)


Factorization results in multisets of primes and this mapping can be turned into a bijection between multisets of natural numbers and natural numbers. At the same time, simpler and more efficient bijections exist that share some interesting properties with the bijection derived from factorization.

This paper describes mechanisms to emulate properties of prime numbers through isomorphisms connecting them to computationally simpler representations involving bijections from natural numbers to multisets of natural numbers.

As a result, interesting automorphisms of ℕ and emulations of the rad, Möbius and Mertens functions emerge in the world of our much simpler multiset representations.

The paper is organized as a self-contained literate Haskell program. The code extracted from the paper is available as a standalone program at http://logic.cse.unt.edu/tarau/research/2011/mprimes.hs .


bijective datatype transformations multiset encodings and prime numbers Möbius and Mertens functions experimental mathematics and functional programming automorphisms of ℕ 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Cégielski, P., Richard, D., Vsemirnov, M.: On the additive theory of prime numbers. Fundam. Inform. 81(1-3), 83–96 (2007)MathSciNetMATHGoogle Scholar
  2. 2.
    Crandall, R., Pomerance, C.: Prime Numbers–a Computational Approach, 2nd edn. Springer, New York (2005)MATHGoogle Scholar
  3. 3.
    Riemann, B.: Ueber die anzahl der primzahlen unter einer gegebenen grösse. Monatsberichte der Berliner Akademie (November 1859)Google Scholar
  4. 4.
    Miller, G.L.: Riemann’s hypothesis and tests for primality. In: STOC, pp. 234–239. ACM, New York (1975)Google Scholar
  5. 5.
    Lagarias, J.C.: An Elementary Problem Equivalent to the Riemann Hypothesis. The American Mathematical Monthly 109(6), 534–543 (2002)MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    Conrey, B.: The Riemann Hypothesis. Not. Amer. Math. Soc. 60, 341–353 (2003)MathSciNetMATHGoogle Scholar
  7. 7.
    Chaitin, G.: Thoughts on the riemann hypothesis. Math. Intelligencer 26(1), 4–7 (2004)MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    Pippenger, N.: The average amount of information lost in multiplication. IEEE Transactions on Information Theory 51(2), 684–687 (2005)MathSciNetCrossRefMATHGoogle Scholar
  9. 9.
    Tarau, P.: A Groupoid of Isomorphic Data Transformations. In: Carette, J., Dixon, L., Coen, C.S., Watt, S.M. (eds.) MKM 2009, Held as Part of CICM 2009. LNCS, vol. 5625, pp. 170–185. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  10. 10.
    Tarau, P.: Isomorphisms, Hylomorphisms and Hereditarily Finite Data Types in Haskell. In: Proceedings of ACM SAC 2009, pp. 1898–1903. ACM, New York (2009)Google Scholar
  11. 11.
    Tarau, P.: An Embedded Declarative Data Transformation Language. In: Proceedings of 11th International ACM SIGPLAN Symposium PPDP 2009, Coimbra, Portugal, pp. 171–182. ACM, New York (2009)Google Scholar
  12. 12.
    Gödel, K.: Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I. Monatshefte für Mathematik und Physik 38, 173–198 (1931)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Singh, D., Ibrahim, A.M., Yohanna, T., Singh, J.N.: An overview of the applications of multisets. Novi Sad J. Math 52(2), 73–92 (2007)MathSciNetMATHGoogle Scholar
  14. 14.
    Hartmanis, J., Baker, T.P.: On Simple Goedel Numberings and Translations. In: Loeckx, J. (ed.) ICALP 1974. LNCS, vol. 14, pp. 301–316. Springer, Heidelberg (1974)CrossRefGoogle Scholar
  15. 15.
    Tarau, P.: Declarative modeling of finite mathematics. In: PPDP 2010: Proceedings of the 12th International ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, pp. 131–142. ACM, New York (2010)Google Scholar
  16. 16.
    Sloane, N.J.A.: The On-Line Encyclopedia of Integer Sequences (2010), published electronically at http://www.research.att.com/~njas/sequences
  17. 17.
    Granville, A.: ABC allows us to count squarefrees. International Mathematics Research Notices (19), 991 (1998)MathSciNetCrossRefMATHGoogle Scholar
  18. 18.
    Odlyzko, A.M., Te Riele, A.M., Disproof, H.J.J.: of the Mertens conjecture. J. Reine Angew. Math. 357, 138–160 (1985)MathSciNetMATHGoogle Scholar
  19. 19.
    Derbyshire, J.: Prime Obsession: Bernhard Riemann and the Greatest Unsolved Problem in Mathematics. Penguin, New York (2004)MATHGoogle Scholar
  20. 20.
    Kaye, R., Wong, T.L.: On Interpretations of Arithmetic and Set Theory. Notre Dame J. Formal Logic 48(4), 497–510 (2007)MathSciNetCrossRefMATHGoogle Scholar
  21. 21.
    Avigad, J.: The Combinatorics of Propositional Provability. In: ASL Winter Meeting, San Diego (January 1997)Google Scholar
  22. 22.
    Kirby, L.: Addition and multiplication of sets. Math. Log. Q. 53(1), 52–65 (2007)MathSciNetCrossRefMATHGoogle Scholar
  23. 23.
    Martínez, C., Molinero, X.: Generic algorithms for the generation of combinatorial objects. In: Rovan, B., Vojtáš, P. (eds.) MFCS 2003. LNCS, vol. 2747, pp. 572–581. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  24. 24.
    Ruskey, F., Proskurowski, A.: Generating binary trees by transpositions. J. Algorithms 11, 68–84 (1990)MathSciNetCrossRefMATHGoogle Scholar
  25. 25.
    Tarau, P.: Declarative Combinatorics: Isomorphisms, Hylomorphisms and Hereditarily Finite Data Types in Haskell, p. 150 (January 2009), Unpublished draft, http://arXiv.org/abs/0808.2953, updated version at http://logic.cse.unt.edu/tarau/research/2010/ISO.pdf
  26. 26.
    Cousot, P., Cousot, R.: Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: 4th ACM Symp. Principles of Programming Languages, pp. 238–278 (1977)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Paul Tarau
    • 1
  1. 1.Department of Computer Science and EngineeringUniversity of North TexasDenton

Personalised recommendations