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.

A092245 Lesser of the first twin prime pair with n digits.

This page as a plain text file.
%I A092245 #34 Dec 08 2022 01:00:54
%S A092245 3,11,101,1019,10007,100151,1000037,10000139,100000037,1000000007,
%T A092245 10000000277,100000000817,1000000000061,10000000001267,
%U A092245 100000000000097,1000000000002371,10000000000001549,100000000000000019
%N A092245 Lesser of the first twin prime pair with n digits.
%C A092245 Sum of reciprocals = 0.43523579465477...
%H A092245 Robert G. Wilson v, <a href="/A092245/b092245.txt">Table of n, a(n) for n = 1..1000</a> First 101 from _Abhiram R Devesh_
%F A092245 a(n) = A124001(n-1) + 10^(n-1). - _Robert G. Wilson v_, Nov 28 2015
%p A092245 for n from 1 to 100 do
%p A092245   r:= 10^(n-1);
%p A092245   p:= nextprime(r); q:= nextprime(p);
%p A092245   while q - p > 2 do
%p A092245     p:= q; q:= nextprime(p);
%p A092245   od;
%p A092245   A[n]:= p;
%p A092245 od:
%p A092245 seq(A[n],n=1..100); # _Robert Israel_, Aug 04 2014
%t A092245 a[n_] := Block[{p = NextPrime[10^(n -1)]}, While[ !PrimeQ[p +2], p = NextPrime@ p]; p]; Array[a, 18] (* _Robert G. Wilson v_, Dec 04 2022 *)
%o A092245 (PARI) firsttwpr(n) = { sr=0; for(m=0,n, c=0; for(x=10^m+1,10^(m+1), if(isprime(x)&& isprime(x+2),print1(x",");sr+=1./x;break) ) ); print(); print(sr) }
%o A092245 (Python)
%o A092245 import sympy
%o A092245 for i in range(100):
%o A092245     p=sympy.nextprime(10**i)
%o A092245     while not sympy.isprime(p+2):
%o A092245         p=sympy.nextprime(p)
%o A092245     print(p)
%o A092245 # _Abhiram R Devesh_, Aug 02 2014
%Y A092245 Cf. A092250, A124001.
%K A092245 base,nonn
%O A092245 1,1
%A A092245 _Cino Hilliard_, Feb 17 2004
%E A092245 Corrected by _T. D. Noe_, Nov 15 2006