login
Numbers of the form 3^r * 5^s whose decimal representation has a prime number of each digit 0-9.
13

%I #30 Apr 06 2020 18:39:50

%S 38171039656829610443115234375,129892841018736362457275390625,

%T 1766298261467341813095601383375,83480063729486358039093017578125,

%U 715350795894273434303718560266875,172661884789704345166683197021484375,65186341275865666700926353804318984375,5280093643345119002775034658149837734375

%N Numbers of the form 3^r * 5^s whose decimal representation has a prime number of each digit 0-9.

%C This sequence in particular is motivated by the coincidence that both (2^41)*(3^43) and (3^43)*(5^47) have prime numbers of each digit.

%H Robert Israel, <a href="/A217407/b217407.txt">Table of n, a(n) for n = 1..11</a>

%F a(n) = 3^A217408(n) * 5^A217409(n).

%e The first term here is (3^35)*(5^17), corresponding to A217408(1)=35 and A217409(1)=17. Its decimal representation has two each of 0's, 2's, 7's, 8's and 9's; three each of 4's, 5's and 6's; and 5 each of 1's and 3's.

%p N:= 10^100: # to get all terms <= N

%p filter:= proc(n) local L,P,d;

%p L:= convert(n,base,10);

%p P:= Vector(10);

%p for d in L do P[d+1]:= P[d+1]+1 od:

%p andmap(isprime,P);

%p end proc:

%p sort(select(filter, [seq(seq(3^r*5^s, r=0..floor(log[3](N/5^s))),s=0..floor(log[5](N)))])); # _Robert Israel_, May 08 2017

%o (PARI) prDigits(n)=my(d=digits(n), v=vector(10)); for(i=1, #d, v[d[i]+1]++); for(i=1, 10, if(!isprime(v[i]), return(0))); 1

%o list(lim)=my(v=List(), t); for(a=0, log(lim+.5)\log(5), t=5^a; while(t<=lim, if(prDigits(t), listput(v, t)); t*=3)); vecsort(Vec(v)) \\ _Charles R Greathouse IV_, Sep 19 2013

%Y Subsequence of A215876.

%Y Cf. A216854, A217408, A217409, A217404, A217410, A217413, A217416, A217419, A217422, A217425, A217428, A217431.

%K nonn,base,less

%O 1,1

%A _James G. Merickel_, Oct 02 2012

%E More terms from _Robert Israel_, May 08 2017