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.

Showing 1-1 of 1 results.

A230358 a(n) is the smallest number k > 0 such that k, k + 1, ... , k + n - 1 are nonprime numbers, but k + n is prime.

Original entry on oeis.org

2, 1, 9, 8, 25, 24, 91, 90, 119, 118, 117, 116, 115, 114, 527, 526, 525, 524, 889, 888, 1131, 1130, 1339, 1338, 1337, 1336, 1335, 1334, 1333, 1332, 1331, 1330, 1329, 1328, 9553, 9552, 15691, 15690, 15689, 15688, 15687, 15686, 15685, 15684, 19617, 19616, 19615
Offset: 0

Views

Author

Michel Lagneau, Dec 10 2013

Keywords

Examples

			a(0) = 2 because 2 is prime.
a(1) = 1 because 1 is nonprime, but 1 + 1 = 2 is prime.
a(2) = 9 because 9 and 10 are nonprimes, but 11 is prime.
a(3) = 8 because 8, 9 and 10 are nonprimes, but 11 is prime.
		

Crossrefs

Cf. A233418.

Programs

  • Maple
    for n from 0 to 50 do: ii:=0:for k from 1 to 10000 while(ii=0) do:i:=0:for m from 0 to n while(type(k+m,prime)=false ) do :i:=i+1:od:if i=n then ii:=1: printf(`%d, `,k):else fi:od:od: ~
  • Mathematica
    nn = 50; t = Table[0, {nn}]; cnt = 0; k = 0; While[cnt < nn, k++; i = 0; While[! PrimeQ[k + i], i++]; If[i < nn && t[[i + 1]] == 0, t[[i + 1]] = k; cnt++]]; t (* *** program from T. D. Noe adapted for this sequence - see A233418 *** *)
    Flatten[Table[SequencePosition[Table[If[PrimeQ[n],0,1],{n,30000}],PadLeft[ {0},k,1],1],{k,50}],1][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 20 2018 *)
Showing 1-1 of 1 results.