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.

A327133 The difference between 10^n and the lesser of the twin primes immediately before.

This page as a plain text file.
%I A327133 #42 Dec 14 2019 08:17:25
%S A327133 5,29,119,71,11,41,29,413,809,299,239,41,1511,29,2033,359,1193,1073,
%T A327133 1499,2261,5003,2429,1793,4331,833,5879,359,779,2813,1061,2099,1811,
%U A327133 3281,5201,533,5483,1679,1421,26801,12089,2843,27773,9641,10841,4763,2129,1019,20531,8519,14339
%N A327133 The difference between 10^n and the lesser of the twin primes immediately before.
%C A327133 All terms are congruent to 5 (mod 6).
%C A327133 Records: 5, 29, 119, 413, 809, 1511, 2033, 2261, 5003, 5879, 26801, ..., 37058441, ... - _Robert G. Wilson v_, Dec 10 2019
%H A327133 Robert G. Wilson v, <a href="/A327133/b327133.txt">Table of n, a(n) for n = 1..1250</a>
%F A327133 a(n) = A011557(n) - A092250(n).
%e A327133 a(1) = 5 because the greatest twin prime pair less than 10 is {5, 7};
%e A327133 a(2) = 29 since the greatest 2-digit twin prime pair is {71, 73};
%e A327133 a(3) = 119 since the greatest 3-digit twin prime pair is {881, 883}; etc.
%p A327133 f:= proc(n) local w,p,q;
%p A327133 w:= 10^n; q:= w;
%p A327133 do
%p A327133   p:= q;
%p A327133   q:= prevprime(p);
%p A327133   if p-q = 2 then return w-q fi;
%p A327133 od
%p A327133 end proc:
%p A327133 map(f, [$1..100]); # _Robert Israel_, Nov 28 2019
%t A327133 p[n_] := Block[{d = PowerMod[10, n, 6]}, 10^n - NestWhile[# -6 &, 10^n -d -1, !PrimeQ[#] || !PrimeQ[# +2] &]]; Array[p, 50] (* updated Nov 29 2019 *)
%o A327133 (PARI) prectwin(n)=n++; while(!isprime(2+n=precprime(n-1)),); n
%o A327133 a(n)=10^n - prectwin(10^n) \\ _Charles R Greathouse IV_, Nov 28 2019
%Y A327133 Cf. A011557, A092250.
%K A327133 nonn
%O A327133 1,1
%A A327133 _Robert G. Wilson v_, Nov 28 2019