%I #15 Oct 02 2020 18:38:00
%S 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,
%T 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,
%U 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
%N a(n) = the smallest positive integer such that (the n-th prime)+2*a(n) is composite.
%C Every term except a(2) (which is 3) is either 1 or 2.
%H G. C. Greubel, <a href="/A175191/b175191.txt">Table of n, a(n) for n = 1..1000</a>
%p a:= n-> `if`(n=2, 3, `if`(isprime(ithprime(n)+2), 2, 1)):
%p seq(a(n), n=1..105); # _Alois P. Heinz_, Oct 02 2020
%t spi[n_]:=Module[{i=1},While[PrimeQ[Prime[n]+2i],i++];i]; Array[spi,110] (* _Harvey P. Dale_, Apr 23 2012 *)
%K nonn
%O 1,2
%A _Leroy Quet_, Mar 01 2010
%E Extended by _Ray Chandler_, Mar 04 2010
|