%I #18 Aug 12 2023 01:08:41
%S 1,10,148,1300,10111,100234,1001395,10000546,100002526,1000005742,
%T 10000000753,100000012369,1000000005658,10000000094572,
%U 100000000006744,1000000000134649,10000000000032523,100000000000043071,1000000000000213927,10000000000000256116,100000000000000008172
%N a(n) is the smallest n-digit number m such that 10*m+1, 10*m+3, 10*m+7 & 10*m+9 are primes.
%C a(n) is the smallest n-digit term of A007811. a(50)=10^49+10718757, can you find a(100)?
%H G. C. Greubel, <a href="/A097638/b097638.txt">Table of n, a(n) for n = 1..50</a>
%F Let f(n, m) be the set of primes 10^n + 10*m + 1, 10^n + 10*m + 3, 10^n + 10*m + 7, and 10^n + 10*m + 9, and let b(n) be the smallest number m that is not in f(n, m). a(n) is then 10^(n-1) + b(n).
%e a(4)=1300 because 13001,13003,13007 & 13009 are primes and 1300 is the smallest 4-digit number with this property.
%t a[n_]:=(For[m=0, !(PrimeQ[10^n+10m+1] && PrimeQ[10^n+10m+3] && PrimeQ[10^n+10m+7] && PrimeQ[10^n+10m+9]), m++ ]; 10^(n-1)+m);
%t Table[a[n], {n, 28}]
%o (PARI) isok(m, n) = my(s=10^(n-1)+ m); ispseudoprime(10*s+1) && ispseudoprime(10*s+3) && ispseudoprime(10*s+7) && ispseudoprime(10*s+9);
%o a(n) = my(m=0); while (!isok(m, n), m++); 10^(n-1)+m; \\ _Michel Marcus_, Aug 09 2023
%o (Magma)
%o F:= func< n,m | IsPrime(10^n +10*m+1) and IsPrime(10^n +10*m+3) and IsPrime(10^n +10*m+7) and IsPrime(10^n +10*m+9) >;
%o function a(n)
%o t:=0;
%o while not F(n,t) do
%o t+:=1;
%o end while;
%o return t+10^(n-1);
%o end function;
%o [a(n): n in [1..15]]; // _G. C. Greubel_, Aug 11 2023
%o (SageMath)
%o def isp(n,m,j): return is_prime(10^n +10*m+j)
%o def f(n,m): return isp(n,m,1) and isp(n,m,3) and isp(n,m,7) and isp(n,m,9)
%o def b(n):
%o k=0
%o while not f(n,k):
%o k+=1
%o return k
%o def A097638(n): return b(n) + 10^(n-1)
%o for n in range(1,23):
%o print(A097638(n), end=", ") # _G. C. Greubel_, Aug 11 2023
%Y Cf. A007811, A097639.
%K base,nonn
%O 1,2
%A _Farideh Firoozbakht_, Aug 18 2004
%E More terms from _Michel Marcus_, Aug 09 2023
|