The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A341765 Let b(2*m) be the number of even gaps 2*m between successive odd primes from 3 up to prime(n). Let k1 = sum of all b(2*m) when m == 1 (mod 3) and let k2 = sum of all b(2*m) when m == 2 (mod 3). Then a(n) = k1 - k2. 2
 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Theorem A: for all n, a(n) belongs to the set: {1,2}, for proof see A342156. The indices n for which numbers of 1's and 2's in this sequence are equal are 2, 4, 6, 10, 12, 20, 36, 46, 48 and no other up to n=10^6. LINKS Table of n, a(n) for n=1..104. MAPLE a(1)=1 because prime(2+1)-prime(2)=5-3=2 then 2*m = 2 -> m=1 and 1 is congruent to 1 mod 3, then k1=1 and k2=0 so k1 - k2 = 1. MATHEMATICA k1 = 0; k2 = 0; cc = {}; Do[ gap = Prime[n + 1] - Prime[n]; If[Mod[gap/2, 3] == 1, k1 = k1 + 1, If[Mod[gap/2, 3] == 2, k2 = k2 + 1]]; AppendTo[cc, k1 - k2]; If[k1 - k2 == 1, , If[k1 - k2 == 2, , Print[{n, k1 - k2}]]], {n, 2, 105}]; cc PROG (PARI) a(n) = {my(vp = vector(n+1, k, prime(k+1)), dp = vector(#vp-1, k, (vp[k+1] - vp[k])/2)); my(s=0); for (k=1, #dp, if ((dp[k]%3)==1, s++); if ((dp[k]%3) == 2, s--)); s; } \\ Michel Marcus, Feb 27 2021 CROSSREFS Cf. A000230, A001223, A028334, A321856, A341952, A342156. Sequence in context: A081129 A022934 A107450 * A104248 A358359 A249973 Adjacent sequences: A341762 A341763 A341764 * A341766 A341767 A341768 KEYWORD nonn AUTHOR Artur Jasinski, Feb 19 2021 STATUS approved

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

Last modified July 25 06:53 EDT 2024. Contains 374586 sequences. (Running on oeis4.)