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”).

A175191
a(n) = the smallest positive integer such that (the n-th prime)+2*a(n) is composite.
2
1, 3, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1
OFFSET
1,2
COMMENTS
Every term except a(2) (which is 3) is either 1 or 2.
LINKS
MAPLE
a:= n-> `if`(n=2, 3, `if`(isprime(ithprime(n)+2), 2, 1)):
seq(a(n), n=1..105); # Alois P. Heinz, Oct 02 2020
MATHEMATICA
spi[n_]:=Module[{i=1}, While[PrimeQ[Prime[n]+2i], i++]; i]; Array[spi, 110] (* Harvey P. Dale, Apr 23 2012 *)
CROSSREFS
Sequence in context: A181715 A077089 A156352 * A328928 A370560 A342468
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 01 2010
EXTENSIONS
Extended by Ray Chandler, Mar 04 2010
STATUS
approved