login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1

%I #30 May 20 2018 12:18:12

%S 2,1,9,8,25,24,91,90,119,118,117,116,115,114,527,526,525,524,889,888,

%T 1131,1130,1339,1338,1337,1336,1335,1334,1333,1332,1331,1330,1329,

%U 1328,9553,9552,15691,15690,15689,15688,15687,15686,15685,15684,19617,19616,19615

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

%H Harvey P. Dale, <a href="/A230358/b230358.txt">Table of n, a(n) for n = 0..100</a>

%e a(0) = 2 because 2 is prime.

%e a(1) = 1 because 1 is nonprime, but 1 + 1 = 2 is prime.

%e a(2) = 9 because 9 and 10 are nonprimes, but 11 is prime.

%e a(3) = 8 because 8, 9 and 10 are nonprimes, but 11 is prime.

%p 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: ~

%t 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 *** *)

%t 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 *)

%Y Cf. A233418.

%K nonn

%O 0,1

%A _Michel Lagneau_, Dec 10 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 08:01 EDT 2024. Contains 371265 sequences. (Running on oeis4.)