login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A098084
a(n) satisfies P(n) + P(n+1) + a(n) = least prime >= P(n) + P(n+1), where P(i)=i-th prime.
3
0, 3, 1, 1, 5, 1, 1, 1, 1, 1, 3, 1, 5, 7, 1, 1, 7, 3, 1, 5, 5, 1, 1, 5, 1, 7, 1, 7, 1, 1, 5, 1, 1, 5, 7, 3, 11, 1, 7, 1, 7, 1, 5, 7, 1, 9, 5, 7, 1, 1, 7, 7, 7, 1, 1, 9, 1, 9, 5, 5, 1, 1, 1, 7, 1, 5, 5, 7, 5, 7, 7, 1, 3, 5, 7, 1, 1, 11, 1, 1, 13, 1, 13, 5, 1, 15, 1, 1, 5, 7, 1, 1, 5, 1, 7, 1, 1, 5, 5, 3, 5, 3, 19
OFFSET
1,2
COMMENTS
a(n) = 1 iff prime(n) is in A177017. - Robert Israel, Feb 04 2020
LINKS
EXAMPLE
P(1) + P(2) = 2 + 3 = 5; least prime >= 5 = 5, so a(1)=0.
P(2) + P(3) = 3 + 5 = 8; least prime > 8 = 11, so a(2) = 11 - 8 = 3.
P(3) + P(4) = 5 + 7 = 12; least prime > 12 = 13, so a(3) = 13 - 12 = 1.
MAPLE
P:= [seq(ithprime(i), i=1..200)]:
map(t -> nextprime(t-1)-t, P[1..-2]+P[2..-1]); # Robert Israel, Feb 04 2020
MATHEMATICA
f[n_] := Block[{k = 0, p = Prime[n] + Prime[n + 1]}, While[ !PrimeQ[p + k], k++ ]; k]; Table[ f[n], {n, 103}] (* Robert G. Wilson v, Sep 24 2004 *)
CROSSREFS
The primes are in A098085.
Cf. A177017.
Sequence in context: A167284 A016463 A155727 * A016562 A087501 A294951
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Sep 13 2004
EXTENSIONS
More terms from Robert G. Wilson v, Sep 25 2004
STATUS
approved