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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A341952 Let x = (prime(n+1) - prime(n))/2 modulo 3 for n >= 2, then a(n) = -1 if x = 2, otherwise a(n) = x. 2
1, 1, -1, 1, -1, 1, -1, 0, 1, 0, -1, 1, -1, 0, 0, 1, 0, -1, 1, 0, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, 0, 0, -1, 0, 0, 1, -1, 1, -1, 1, 0, 0, -1, 1, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 1, -1, 1, -1, 1, -1, 1, 0, -1, 1, -1, 0, 1, 0, 0, -1, 0, 1, -1, 1, -1, 1, -1, 1, 0, -1, 0, 1, -1, 1, -1, 0, 1, -1, 1, -1, 0, 0, 1, 0, 0, -1, 0, 0, 1, 0, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
2
COMMENTS
Theorem B: apart from the initial term, the subsequence of nonzero terms is alternately +1 and -1 (the subsequence {1, 1} occurs only once, at the start)- for proof see A342156.
LINKS
FORMULA
a(n) = (A028334(n) mod 3), when 2 -> -1.
a(n) = A102283(A028334(n)).
a(n) = ((prime(n+1) - prime(n))/2 + 1) mod 3 - 1. - Jon E. Schoenfield, Mar 04 2021
EXAMPLE
a(5)=1 (note that offset is 2, so n-th successive number in this sequence has index n+1) because prime(5+1)=13 and prime(5)=11, then gap=13-11=2, and now gap/2=1 which is congruent to 1 (mod 3).
MATHEMATICA
aa = {}; Do[gap = Prime[n + 1] - Prime[n];
If[Mod[gap/2, 3] == 1, AppendTo[aa, 1],
If[Mod[gap/2, 3] == 2, AppendTo[aa, -1],
If[Mod[gap/2, 3] == 0, AppendTo[aa, 0]]]], {n, 2, 106}]; aa
a[n_] := Mod[(Prime[n + 1] - Prime[n])/2, 3, -1]; Array[a, 100, 2] (* Amiram Eldar, Feb 25 2021 *)
PROG
(PARI) a(n) = my(x=(prime(n+1) - prime(n))/2 % 3); if (x==2, -1, x); \\ Michel Marcus, Feb 26 2021
CROSSREFS
Sequence in context: A350070 A359834 A179775 * A167686 A190207 A156706
KEYWORD
sign
AUTHOR
Artur Jasinski, Feb 24 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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 1 14:59 EDT 2024. Contains 374818 sequences. (Running on oeis4.)