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.

A333955 Numbers k with digits in nondecreasing order and each digit greater than 1 such that the iterated product of digits of k is a prime.

This page as a plain text file.
%I A333955 #21 Apr 23 2020 23:04:40
%S A333955 2,3,5,7,26,34,35,37,57,223,278,279,299,355,359,367,369,389,447,469,
%T A333955 557,579,666,999,2247,2269,2337,2339,2349,2366,2699,2799,3335,3336,
%U A333955 3338,3346,3357,3399,3499,3669,3679,3889,3999,4689,4788,5579,5777,6668,22227,22239,22336
%N A333955 Numbers k with digits in nondecreasing order and each digit greater than 1 such that the iterated product of digits of k is a prime.
%C A333955 Primitive sequence of A028843. If k is in this sequence, then one can concatenate as many 1s as one likes, and/or permute the digits, to get terms of A028843 that are not in this sequence. For example, from 35 in this sequence, we can obtain 135, 1135, 11135, ... as well as 153, 315, 351, 1153, 1315, 1351, 1513, 1531, etc.
%e A333955 For 35, we have 3 * 5 = 15 and then 1 * 5 = 5, which is a prime. Furthermore, the digits of 35 are nondecreasing and all digits of 35 are greater than 1, so 35 is in the sequence.
%e A333955 Likewise with 37, we see that 3 * 7 = 21 and 2 * 1 = 2, which is prime, and 3 < 7, so 37 is also in the sequence. The numbers 137, 1137, 11137, etc., are in A028843 but are not in this sequence of account of containing the digit 1.
%e A333955 With 43, we confirm that 4 * 3 = 12 and 1 * 2 = 2, which is prime, but 4 > 3, so 43 is not in the sequence.
%t A333955 Select[Range[25000], Min[(d = IntegerDigits[#])] > 1 && (Length[d] < 2 || Min @ Differences[d] > -1) && PrimeQ[FixedPoint[IntegerDigits @ (Times @@ #)&, d][[1]]] &] (* _Amiram Eldar_, Apr 14 2020 *)
%o A333955 (PARI) is(n) = my(d=digits(n), v); if(d!=(v=vecsort(d))||v[1]<2, return(0)); while(n>=10, n=vecprod(digits(n))); isprime(n)
%o A333955 (Scala) def hasDigitsSorted(n: Int): Boolean = {
%o A333955   val digSort = Integer.parseInt(n.toString.toCharArray.sorted.mkString)
%o A333955   n == digSort
%o A333955 }
%o A333955 def iterDigitProd(n: Int): Int = n.toString.length match {
%o A333955   case 1 => n
%o A333955   case _ => iterDigitProd(n.toString.toCharArray.map(_ - 48).scanRight(1)(_ * _).head)
%o A333955 }
%o A333955 val prelim = (1 to 20000).filter(hasDigitsSorted(_)).filter(n => List(2, 3, 5, 7).contains(iterDigitProd(n)))
%o A333955 prelim.filter(!_.toString.startsWith("1")) // _Alonso del Arte_, Apr 20 2020
%Y A333955 Cf. A002473, A003001, A009994, A028843.
%K A333955 nonn,base
%O A333955 1,1
%A A333955 _David A. Corneth_, Apr 11 2020