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.

A175220 The fifth nonprimes after the primes.

Original entry on oeis.org

10, 10, 12, 14, 18, 20, 24, 25, 28, 35, 36, 44, 48, 49, 52, 58, 65, 66, 74, 77, 78, 85, 88, 94, 104, 108, 110, 114, 115, 118, 133, 136, 143, 144, 155, 156, 162, 169, 172, 178, 185, 186, 198, 200, 203, 204, 216, 230, 234, 235, 238, 245, 246, 256, 262, 268, 275
Offset: 1

Views

Author

Jaroslav Krizek, Mar 06 2010

Keywords

Comments

From Robert Israel, Jul 05 2016: (Start)
For n>1, there are the following cases:
If prime(n)+2 and prime(n)+4 are composite, then a(n) = prime(n)+5.
If exactly one of prime(n)+2 and prime(n)+4 is prime, and prime(n)+6 is composite, then a(n) = prime(n) + 6.
Otherwise, a(n) = prime(n) + 7. (End)

Programs

  • Maple
    N:= 1000: # to get all entries <= N
    Primes:= select(isprime, [2,seq(i,i=3..N+7,2)]):
    nprimes:= nops(Primes):
    A[1]:= 10:
    A[2]:= 10:
    for i from 3 to nprimes-1 do
      p:= Primes[i];
      if p + 5 > N then break fi;
      if Primes[i+1] > p + 4 then A[i]:= p + 5
      elif (i = nprimes-1 or Primes[i+2] <> p+6) and p+6 <= N  then A[i]:= p + 6
      elif p+7 <= N then A[i]:= p + 7
      else break
      fi
    od:
    seq(A[j],j=1..i-1); # Robert Israel, Jul 05 2016