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.).

Original entry on oeis.org

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, 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, 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
Offset: 2

Views

Author

Zak Seidov, Jun 02 2005

Keywords

Comments

n >= 2: a(n) = 1, 2 or 3 (resp.) if n-th prime is in A051635, A006562 or A051634 (resp.).

Crossrefs

Programs

  • Maple
    p:= 2: q:= 3: r:= 5:
    for i from 2 to 200 do
      t:= q - (p+r)/2;
      A[i]:= piecewise(t<0,1,t=0,2,3);
      p:= q; q:= r; r:= nextprime(r);
    od:
    seq(A[i],i=2..200); # Robert Israel, Mar 25 2018
  • Mathematica
    A108415[n_]:=2+Sign[Prime[n]-1/2(Prime[n-1]+Prime[n+1])]