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!)
A339448 a(n) = (prime(n) - a(n-1)) mod 3; a(0)=0. 1
0, 2, 1, 1, 0, 2, 2, 0, 1, 1, 1, 0, 1, 1, 0, 2, 0, 2, 2, 2, 0, 1, 0, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 1, 0, 2, 2, 2, 2, 0, 2, 0, 1, 1, 0, 2, 2, 2, 2, 0, 1, 1, 1, 0, 2, 0, 2, 0, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 2, 0, 1, 1, 1, 0, 1, 0, 2, 0, 1, 1, 0, 2, 2, 0, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
EXAMPLE
a(1) = ( 2 - 0) mod 3 = 2,
a(2) = ( 3 - 2) mod 3 = 1,
a(3) = ( 5 - 1) mod 3 = 1,
a(4) = ( 7 - 1) mod 3 = 0,
a(5) = (11 - 0) mod 3 = 2.
MATHEMATICA
a[0]=0; a[n_]:=Mod[Prime[n]-a[n-1], 3]; Table[a[n], {n, 0, 85}] (* Stefano Spezia, Dec 05 2020 *)
PROG
(Ruby) require 'prime'
values = [0]
Prime.first(50).each do |prime|
values << (prime-values[-1]) % 3
end
p values
CROSSREFS
Cf. A008347.
Sequence in context: A101979 A369241 A308061 * A060582 A060450 A180918
KEYWORD
nonn
AUTHOR
Simon Strandgaard, Dec 05 2020
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 July 18 06:32 EDT 2024. Contains 374377 sequences. (Running on oeis4.)