login
Numbers whose digits are primes.
103

%I #102 Feb 15 2024 01:53:36

%S 2,3,5,7,22,23,25,27,32,33,35,37,52,53,55,57,72,73,75,77,222,223,225,

%T 227,232,233,235,237,252,253,255,257,272,273,275,277,322,323,325,327,

%U 332,333,335,337,352,353,355,357,372,373,375,377,522,523,525,527,532

%N Numbers whose digits are primes.

%C If n is represented as a zerofree base-4 number (see A084544) according to n=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=2,3,5,7 for k=1..4. - _Hieronymus Fischer_, May 30 2012

%C According to A153025, it seems that 5, 235 and 72335 are the only terms whose square is also a term, i.e., which are also in the sequence A275971 of square roots of the terms which are squares, listed in A191486. - _M. F. Hasler_, Sep 16 2016

%H Reinhard Zumkeller, <a href="/A046034/b046034.txt">Table of n, a(n) for n = 1..10000</a>

%H Robert Baillie and Thomas Schmelzer, <a href="https://library.wolfram.com/infocenter/MathSource/7166/">Summing Kempner's Curious (Slowly-Convergent) Series</a>, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SmarandacheSequences.html">Smarandache Sequences</a>.

%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.

%F A055642(a(n)) = A193238(a(n)). - _Reinhard Zumkeller_, Jul 19 2011

%F From _Hieronymus Fischer_, Apr 20, May 30 and Jun 25 2012: (Start)

%F a(n) = Sum_{j=0..m-1} ((2*b(j)+1) mod 8 + floor(b(j)/4) - floor((b(j)-1)/4))*10^j, where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).

%F a(n) = Sum_{j=0..m-1} (A010877(A005408(b(j)) + A002265(b(j)) - A002265(b(j)-1))*10^j.

%F Special values:

%F a(1*(4^n-1)/3) = 2*(10^n-1)/9.

%F a(2*(4^n-1)/3) = 1*(10^n-1)/3.

%F a(3*(4^n-1)/3) = 5*(10^n-1)/9.

%F a(4*(4^n-1)/3) = 7*(10^n-1)/9.

%F Inequalities:

%F a(n) <= 2*(10^log_4(3*n+1)-1)/9, equality holds for n = (4^k-1)/3, k>0.

%F a(n) <= 2*A084544(n), equality holds iff all digits of A084544(n) are 1.

%F a(n) > A084544(n).

%F Lower and upper limits:

%F lim inf a(n)/10^log_4(n) = (7/90)*10^log_4(3) = 0.48232167706987..., for n -> oo.

%F lim sup a(n)/10^log_4(n) = (2/9)*10^log_4(3) = 1.378061934485343..., for n -> oo.

%F where 10^log_4(n) = n^1.66096404744...

%F G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(2 + z(j) + 2*z(j)^2 + 2*z(j)^3 - 7*z(j)^4)/(1-z(j)^4), where z(j) = x^4^j.

%F Also g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1-z(j))*(2 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3)/(1-z(j)^4), where z(j)=x^4^j.

%F Also: g(x) = (1/(1-x))*(2*h_(4,0)(x) + h_(4,1)(x) + 2*h_(4,2)(x) + 2*h_(4,3)(x) - 7*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3)*x^(k*4^j)/(1-x^4^(j+1)). (End)

%F Sum_{n>=1} 1/a(n) = 1.857333779940977502574887651449435985318556794733869779170825138954093657197... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - _Amiram Eldar_, Feb 15 2024

%e a(100) = 2277,

%e a(10^3) = 55327,

%e a(9881) = 3233232,

%e a(10^4) = 3235757,

%e a(10922) = 3333333,

%e a(10^5) = 227233257.

%t Table[FromDigits /@ Tuples[{2, 3, 5, 7}, n], {n, 3}] // Flatten (* _Michael De Vlieger_, Sep 19 2016 *)

%o (PARI) is_A046034(n)=Set(isprime(digits(n)))==[1] \\ _M. F. Hasler_, Oct 12 2013

%o (Haskell)

%o a046034 n = a046034_list !! (n-1)

%o a046034_list = filter (all (`elem` "2357") . show ) [0..]

%o -- _Reinhard Zumkeller_, Jul 19 2011

%o (Magma) [n: n in [2..532] | Set(Intseq(n)) subset [2, 3, 5, 7]]; // _Bruno Berselli_, Jul 19 2011

%o (Python)

%o def A046034(n):

%o m = (3*n+1).bit_length()-1>>1

%o return int(''.join(('2357'[(3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3] for j in range(m)))) # _Chai Wah Wu_, Feb 08 2023

%Y Cf. A046035, A118950, A019546 (primes), A203263, A035232, A039996, A085823, A052382, A084544, A084984, A017042, A001743, A001744, A014261, A014263, A153025, A191486, A193238, A202267, A202268, A211681, A365471 (complement).

%K nonn,base,easy

%O 1,1

%A _Eric W. Weisstein_

%E More terms from _Cino Hilliard_, Aug 06 2006

%E Typo in second formula corrected by _Hieronymus Fischer_, May 12 2012

%E Two typos in example section corrected by _Hieronymus Fischer_, May 30 2012