cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A097638 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.

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