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
KEYWORD
nonn
AUTHOR
Simon Strandgaard, Jan 24 2021
STATUS
approved