login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096870 Difference between the n-th repunit and the previous prime. 4
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, 50, 168, 84, 8, 138, 112, 82, 2, 28, 2, 62, 34, 50, 74, 24, 8, 54, 204, 22, 428, 40, 118, 200, 72, 40, 30, 42, 284, 44, 114, 268, 80, 18, 4, 74, 142, 182, 140, 112, 214, 152, 90 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

LINKS

Robert Israel, Table of n, a(n) for n = 2..1000

FORMULA

a(n) = A002275(n) - A096498(n) = A096499(n) - A096869(n).

MAPLE

f:= proc(n) local r; r:= (10^n-1)/9; r - prevprime(r) end proc:

map(f, [$2..100]); # Robert Israel, Feb 23 2017

MATHEMATICA

PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; Table[(10^n - 1)/9 - PrevPrim[(10^n - 1)/9], {n, 2, 70}]

Table[With[{ru=(10^n-1)/9}, ru-NextPrime[ru, -1]], {n, 2, 70}] (* Harvey P. Dale, Aug 14 2011 *)

CROSSREFS

Cf. A096869.

Sequence in context: A136202 A075418 A199221 * A261253 A328334 A134977

Adjacent sequences:  A096867 A096868 A096869 * A096871 A096872 A096873

KEYWORD

nonn

AUTHOR

Robert G. Wilson v, Jul 12 2004

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 29 23:37 EST 2020. Contains 338780 sequences. (Running on oeis4.)