This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A339448 #12 Dec 23 2020 19:52:31 %S A339448 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, %T A339448 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, %U A339448 2,0,1,1,1,0,1,0,2,0,1,1,0,2,2,0,1,0 %N A339448 a(n) = (prime(n) - a(n-1)) mod 3; a(0)=0. %e A339448 a(1) = ( 2 - 0) mod 3 = 2, %e A339448 a(2) = ( 3 - 2) mod 3 = 1, %e A339448 a(3) = ( 5 - 1) mod 3 = 1, %e A339448 a(4) = ( 7 - 1) mod 3 = 0, %e A339448 a(5) = (11 - 0) mod 3 = 2. %t A339448 a[0]=0; a[n_]:=Mod[Prime[n]-a[n-1],3]; Table[a[n],{n,0,85}] (* _Stefano Spezia_, Dec 05 2020 *) %o A339448 (Ruby) require 'prime' %o A339448 values = [0] %o A339448 Prime.first(50).each do |prime| %o A339448 values << (prime-values[-1]) % 3 %o A339448 end %o A339448 p values %Y A339448 Cf. A008347. %K A339448 nonn %O A339448 0,2 %A A339448 _Simon Strandgaard_, Dec 05 2020