Ulam Spiral and Prime-Rich Polynomials

  • Arkadiusz OrłowskiEmail author
  • Leszek J. ChmielewskiEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11114)


The set of prime numbers visualized as Ulam spiral was considered from the image processing perspective. Sequences of primes forming line segments were detected with the special version of the Hough transform. The polynomials which generate the numbers related to these sequences were investigated for their potential richness in prime numbers. One of the polynomials which generates the numbers forming the 11-point sequence was found exceptionally prime-rich, although it was not the longest sequence found. This polynomial is \(4 n^2 - 1260 n + 98827\) and it generates 613 primes (20 of them with the minus sign) for the first 1000 non-negative integers as arguments. This is more than generated by some other well-known prime-rich polynomials, the Euler one included.


Ulam spiral Line segment Prime-rich Polynomial Hough transform 


  1. 1.
    Caldwell, C.K.: How many primes are there? In: Caldwell, C.K. (ed.) The Prime Pages (2018). Accessed 15 July 2018
  2. 2.
    Chmielewski, L.J., Janowicz, M., Gawdzik, G., Orłowski, A.: Contiguous line segments in the Ulam spiral: experiments with larger numbers. In: Rutkowski, L., Korytkowski, M., Scherer, R., Tadeusiewicz, R., Zadeh, L., Zurada, J. (eds.) ICAISC 2017. LNCS (LNAI), vol. 10245, pp. 463–472. Springer, Cham (2017). Scholar
  3. 3.
    Chmielewski, L.J., Orłowski, A.: Hough transform for lines with slope defined by a pair of co-primes. Mach. Graph. Vis. 22(1/4), 17–25 (2013).
  4. 4.
    Chmielewski, L.J., Orłowski, A.: Finding line segments in the Ulam square with the Hough transform. In: Chmielewski, L.J., Datta, A., Kozera, R., Wojciechowski, K. (eds.) ICCVG 2016. LNCS, vol. 9972, pp. 617–626. Springer, Cham (2016). Scholar
  5. 5.
    Chmielewski, L.J., Orłowski, A., Gawdzik, G.: Segment counting versus prime counting in the Ulam square. In: Nguyen, N., Tojo, S., et al. (eds.) ACIIDS 2017, Part II. LNCS (LNAI), vol. 10192, pp. 227–236. Springer, Cham (2017). Scholar
  6. 6.
    Chmielewski, L.J., Orłowski, A., Janowicz, M.: A study on directionality in the Ulam square with the use of the Hough transform. In: Kobayashi, S., Piegat, A., et al. (eds.) ACS 2016. AISC, vol. 534, pp. 81–90. Springer, Cham (2016). Scholar
  7. 7.
    Cyganski, D., Noel, W.F., Orr, J.A.: Analytic Hough transform. In: Proceedings of the SPIE. Sensing and Reconstruction of Three-Dimensional Objects and Scenes, vol. 1260, pp. 148–159 (1990).
  8. 8.
    Fung, G.W., Williams, H.C.: Quadratic polynomials which have a high density of prime values. Math. Comput. 55(191), 345–353 (1990). Scholar
  9. 9.
    Guy, R.K.: Unsolved Problems in Number Theory. Springer, New York (1994). Scholar
  10. 10.
    Jacobson, M.J., Williams, H.C.: New quadratic polynomials with high densities of prime values. Math. Comput. 72(241), 499–519 (2002). Scholar
  11. 11.
    Kiryati, N., Lindenbaum, M., Bruckstein, A.M.: Digital or analog Hough transform? Pattern Recogn. Lett. 12(5), 291–297 (1991). Scholar
  12. 12.
    Liu, Y., Cyganski, D., Vaz, R.F.: Efficient implementation of the analytic Hough transform for exact linear feature extraction. In: Proceedings of the SPIE. Intelligent Robots and Computer Vision X: Algorithms and Techniques, vol. 1607, pp. 298–309 (1992).
  13. 13.
    Mollin, R.A.: Prime-producing quadratics. Am. Math. Monthly 104(6), 529–544 (1997). Scholar
  14. 14.
    Narkiewicz, W.: The Development of Prime Number Theory: From Euclid to Hardy and Littlewood. Springer, Heidelberg (2000). Scholar
  15. 15.
    Ribenboim, P.: The Book of Prime Number Records, 2nd edn. Springer, New York (1989). Scholar
  16. 16.
    Riesel, H.: Prime Numbers and Computer Methods for Factorization. Progress in Mathematics, vol. 126, 2nd edn. Springer (Birkhäuser, Basel), New York (1994). Scholar
  17. 17.
    Stein, M.L., Ulam, S.M., Wells, M.B.: A visual display of some properties of the distribution of primes. Am. Math. Monthly 71(5), 516–520 (1964). Scholar
  18. 18.
    Weisstein, E.W.: Prime counting function. From MathWorld-A Wolfram Web Resource (2018) Accessed 15 July 2018
  19. 19.
    Weisstein, E.W.: Prime spiral. From MathWorld-A Wolfram Web Resource (2018) Accessed 15 July 2018
  20. 20.
    Wells, D.: Prime Numbers. The Most Mysterious Figures in Math. Wiley, Hoboken (2005)Google Scholar
  21. 21.
    Wikipedia: Ulam spiral – Wikipedia, The Free Encyclopedia (2018). Accessed 15 July 2018

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.Faculty of Applied Informatics and Mathematics (WZIM)Warsaw University of Life Sciences (SGGW)WarsawPoland

Personalised recommendations