cp's OEIS Frontend

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.

A108415 a(n) = 1, 2 or 3 (resp.) if prime(n) is weak, balanced or strong (resp.).

This page as a plain text file.
%I A108415 #14 Mar 26 2018 19:51:56
%S A108415 1,2,1,3,1,3,1,1,3,1,3,3,1,1,2,3,1,3,3,1,3,1,1,3,3,1,3,1,1,3,1,3,1,3,
%T A108415 1,2,3,1,2,3,1,3,1,3,1,2,3,3,1,1,3,1,3,2,2,3,1,3,3,1,1,3,3,1,1,3,1,3,
%U A108415 1,1,1,3,2,3,1,1,3,1,1,3,1,3,1,3,1,1,3,3,1,1,3,3,1,3,1,1,3,1,3,1,3,2,3,1,1
%N A108415 a(n) = 1, 2 or 3 (resp.) if prime(n) is weak, balanced or strong (resp.).
%C A108415 n >= 2: a(n) = 1, 2 or 3 (resp.) if n-th prime is in A051635, A006562 or A051634 (resp.).
%H A108415 Robert Israel, <a href="/A108415/b108415.txt">Table of n, a(n) for n = 2..10000</a>
%H A108415 Wikipedia, <a href="https://en.wikipedia.org/wiki/Balanced_prime">Balanced prime</a>
%p A108415 p:= 2: q:= 3: r:= 5:
%p A108415 for i from 2 to 200 do
%p A108415   t:= q - (p+r)/2;
%p A108415   A[i]:= piecewise(t<0,1,t=0,2,3);
%p A108415   p:= q; q:= r; r:= nextprime(r);
%p A108415 od:
%p A108415 seq(A[i],i=2..200); # _Robert Israel_, Mar 25 2018
%t A108415 A108415[n_]:=2+Sign[Prime[n]-1/2(Prime[n-1]+Prime[n+1])]
%Y A108415 Cf. A006562, A051634, A051635.
%K A108415 nonn
%O A108415 2,2
%A A108415 _Zak Seidov_, Jun 02 2005