cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A028843 Numbers whose iterated product of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 21, 26, 31, 34, 35, 37, 43, 51, 53, 57, 62, 71, 73, 75, 112, 113, 115, 117, 121, 126, 131, 134, 135, 137, 143, 151, 153, 157, 162, 171, 173, 175, 211, 216, 223, 232, 261, 278, 279, 287, 297, 299, 311, 314, 315, 317, 322, 341, 351, 355
Offset: 1

Views

Author

Keywords

Examples

			For 53, the product of digits is 5 * 3 = 15, iterated to 1 * 5 = 5, which is a prime, so 53 is in the sequence.
For 54, the product of digits is 5 * 4 = 20, iterated to 2 * 0 = 0, which is not prime, so 54 is not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    iterDigitProd[n_] := NestWhile[Times@@IntegerDigits[#] &, n, # > 9 &]; Select[Range[355], PrimeQ[iterDigitProd[#]] &] (* Jayanta Basu, Jun 02 2013 *)
  • Scala
    def iterDigitProd(n: Int): Int = n.toString.length match {
      case 1 => n
      case  => iterDigitProd(n.toString.toCharArray.map( - 48).scanRight(1)( * ).head)
    }
    (1 to 400).filter(n => List(2, 3, 5, 7).contains(iterDigitProd(n))) // Alonso del Arte, Apr 11 2020

Extensions

More terms from Patrick De Geest, Jun 15 1999
Corrected by Franklin T. Adams-Watters, Jan 17 2007