A097220 Numbers n such that pi(n) = product of digits of n.
16, 17, 63, 73, 364, 437, 545, 573, 963, 6475, 23797, 67458, 2475989, 2475998
Offset: 1
Examples
2475998 is in the sequence because pi(2475998)=2*4*7*5*9*9*8. 1152 is in A002473. As 8643 <= prime(1152) <= 9794. Examples of the 13 numbers with product of digits is 1152 in that interval are: 8944, 9288, 9448, 9484 none of which are terms. - _David A. Corneth_, Nov 06 2018
Programs
-
Magma
[n: n in [1..10^5] | &*Intseq((n)) eq #PrimesUpTo(n)]; // Vincenzo Librandi, Nov 06 2018
-
Mathematica
v={}; Do[If[h=IntegerDigits[n]; l=Length[h]; p=Product[h[[k]], {k, l}]; PrimePi[n]==p, v=Append[v, n]; Print[v], If[Mod[n, 1000000]==0, Print[ -n]]], {n, 200000000}] Select[Range[2500000],PrimePi[#]==Times@@IntegerDigits[#]&] (* Harvey P. Dale, Dec 04 2012 *)
-
PARI
isok(n) = primepi(n) == factorback(digits(n)); \\ Michel Marcus, Apr 23 2018
Extensions
Keyword fini from Jeppe Stig Nielsen, Nov 04 2018
Comments