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.

A175191 a(n) = the smallest positive integer such that (the n-th prime)+2*a(n) is composite.

Original entry on oeis.org

1, 3, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1
Offset: 1

Views

Author

Leroy Quet, Mar 01 2010

Keywords

Comments

Every term except a(2) (which is 3) is either 1 or 2.

Programs

  • Maple
    a:= n-> `if`(n=2, 3, `if`(isprime(ithprime(n)+2), 2, 1)):
    seq(a(n), n=1..105);  # Alois P. Heinz, Oct 02 2020
  • Mathematica
    spi[n_]:=Module[{i=1},While[PrimeQ[Prime[n]+2i],i++];i]; Array[spi,110] (* Harvey P. Dale, Apr 23 2012 *)

Extensions

Extended by Ray Chandler, Mar 04 2010