login
a(n) is the smallest number m such that for the n-digit number s=10^(n-1)+ m, 10*s+1, 10*s+3, 10*s+7 and 10*s+9 are primes.
1

%I #16 Aug 09 2023 07:07:28

%S 0,0,48,300,111,234,1395,546,2526,5742,753,12369,5658,94572,6744,

%T 134649,32523,43071,213927,256116,8172,431904,57138,433125,123225,

%U 711447,318501,40758,150063,184602,134661,377778,129048,504678,88113,3174738

%N a(n) is the smallest number m such that for the n-digit number s=10^(n-1)+ m, 10*s+1, 10*s+3, 10*s+7 and 10*s+9 are primes.

%C a(50)= 10718757, can you find a(100)?

%F a(n) = A097638(n) - 10^(n-1).

%e a(4)=300 because 10(10^3+300)+ 1, 10(10^3+300)+ 3, 10(10^3+300)+ 7 and 10(10^3+300)+1, are primes and 300 is the smallest 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++ ];m);Table[a[n], {n, 43}]

%t Table[Module[{m=0,s=10^n},While[AnyTrue[10(s+m)+{1,3,7,9},CompositeQ],m++];m],{n,0,35}] (* _Harvey P. Dale_, Sep 19 2022 *)

%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++); m; \\ _Michel Marcus_, Aug 09 2023

%Y Cf. A011557, A097638, A007811.

%K base,nonn

%O 1,3

%A _Farideh Firoozbakht_, Aug 18 2004