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.

A054690 n consecutive primes differ by 4 or more starting at a(n), or n consecutive primes with no twin primes.

Original entry on oeis.org

7, 19, 43, 73, 73, 349, 349, 349, 349, 349, 349, 661, 661, 661, 661, 661, 661, 661, 661, 8629, 8629, 8629, 8629, 13399, 13399, 13399, 14629, 14629, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421
Offset: 2

Views

Author

Jeff Burch, Apr 19 2000

Keywords

Crossrefs

Programs

  • Maple
    P:= select(isprime, [seq(i,i=3..10^7,2)]):
    A:= 'A':
    state:= 0: smax := 0:
    for i from 2 to nops(P) do
      if P[i] - P[i-1] >= 4 then
        state:= state + 1;
        if state > smax then smax:= state; A[state+1]:= P[i-state] fi
      else
        state:= 0;
      fi
    od:
    seq(A[i],i=2..smax+1); # Robert Israel, Jun 27 2017
  • Mathematica
    Prime[#]&/@With[{pd=If[#>2,1,0]&/@Differences[Prime[Range[3000]]]}, Flatten[ Table[ SequencePosition[pd,PadRight[{},n,1],1][[All,1]],{n,45}]]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 29 2018 *)