The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A340867 a(n) = (prime(n) - a(n-1)) mod 4; a(0)=0. 1
 0, 2, 1, 0, 3, 0, 1, 0, 3, 0, 1, 2, 3, 2, 1, 2, 3, 0, 1, 2, 1, 0, 3, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 3, 2, 1, 0, 3, 0, 1, 2, 3, 0, 1, 0, 3, 0, 3, 0, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 1, 2, 3, 0, 3, 2, 3, 0, 1, 2, 3, 2, 1, 2, 3, 0, 3, 2, 3, 2, 3, 0, 1, 2, 3, 0 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,2 LINKS Simon Strandgaard, Visualization FORMULA a(n) = A008347(n) mod 4. EXAMPLE a(1) = ( 2 - 0) mod 4 = 2, a(2) = ( 3 - 2) mod 4 = 1, a(3) = ( 5 - 1) mod 4 = 0, a(4) = ( 7 - 0) mod 4 = 3, a(5) = (11 - 3) mod 4 = 0. MATHEMATICA a[0] = 0; a[n_] := a[n] = Mod[Prime[n] - a[n - 1], 4]; Array[a, 100, 0] (* Amiram Eldar, Jan 30 2021 *) PROG (Ruby) require 'prime' values = [0] Prime.first(50).each do |prime|     values << (prime-values[-1]) % 4 end p values CROSSREFS Cf. A008347, A339448. Sequence in context: A159813 A157409 A245960 * A178616 A165252 A127373 Adjacent sequences:  A340864 A340865 A340866 * A340868 A340869 A340870 KEYWORD nonn AUTHOR Simon Strandgaard, Jan 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 23 02:04 EDT 2021. Contains 347609 sequences. (Running on oeis4.)