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.

A096870 Difference between the n-th repunit and the previous prime.

This page as a plain text file.
%I A096870 #10 Feb 23 2017 22:20:37
%S A096870 4,2,2,18,2,20,10,2,14,52,8,18,58,58,72,4,20,74,84,58,14,18,82,168,28,
%T A096870 50,168,84,8,138,112,82,2,28,2,62,34,50,74,24,8,54,204,22,428,40,118,
%U A096870 200,72,40,30,42,284,44,114,268,80,18,4,74,142,182,140,112,214,152,90
%N A096870 Difference between the n-th repunit and the previous prime.
%H A096870 Robert Israel, <a href="/A096870/b096870.txt">Table of n, a(n) for n = 2..1000</a>
%F A096870 a(n) = A002275(n) - A096498(n) = A096499(n) - A096869(n).
%p A096870 f:= proc(n) local r; r:= (10^n-1)/9; r - prevprime(r) end proc:
%p A096870 map(f, [$2..100]); # _Robert Israel_, Feb 23 2017
%t A096870 PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; Table[(10^n - 1)/9 - PrevPrim[(10^n - 1)/9], {n, 2, 70}]
%t A096870 Table[With[{ru=(10^n-1)/9},ru-NextPrime[ru,-1]],{n,2,70}] (* _Harvey P. Dale_, Aug 14 2011 *)
%Y A096870 Cf. A096869.
%K A096870 nonn
%O A096870 2,1
%A A096870 _Robert G. Wilson v_, Jul 12 2004