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.

A281684 Least composite k such that the concatenation of n consecutive composites, starting from k, is a prime.

Original entry on oeis.org

8, 138, 87, 88, 14, 122, 121, 70, 21, 206, 405, 94, 15, 82, 195, 27, 729, 266, 358, 136, 318, 592, 18, 342, 202, 1182, 268, 155, 85, 292, 386, 888, 295, 551, 892, 118, 63, 95, 696, 1497, 315, 400, 954, 574, 33, 72, 85, 1377, 140, 1417, 158, 448, 994, 1370, 3399
Offset: 2

Views

Author

Paolo P. Lava, Jan 27 2017

Keywords

Comments

If k = 1 is allowed then a(27) = 1 and a(50) = 1.
From Michel Marcus, Mar 06 2021: (Start)
Some small values:
a(2) = 8 = A002808(3);
a(646) = 10 = A002808(5);
a(14662) = 12 = A002808(6) [Hans Havermann];
a(6) = 14 = A002808(7);
a(14) = 15 = A002808(8);
a(302) = 16 = A002808(9);
a(24) = 18 = A002808(10);
a(1388) = 20 = A002808(11) [seqfan user cwwuieee]. (End)
Records: 8, 138, 206, 405, 729, 1182, 1497, 3399, 3588, 8097, 11064, 11076, 12806, 28089, 35084, 37912, 39897, 45330, 50828, 76589, ..., . - Robert G. Wilson v, Mar 12 2021

Examples

			a(2) = 8 because the next composite after 8 is 9: concat(8, 9) = 89 is prime and 8 is the least number with this property;
a(3) = 138 because the next composites after 138 are 140, 141: concat(138, 140, 141) = 138140141 is prime and 138 is the least number with this property.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,i,j,k,n; for n from 2 to q do
    for k from 1 to q do if not isprime(k) then a:=k; b:=a; j:=1; while j
    				
  • Mathematica
    With[{c = Select[Range[10^5], CompositeQ]}, Table[k = 1; While[! PrimeQ@ FromDigits@ Flatten@ IntegerDigits@ Take[c, {k, k + n}], k++]; c[[k]], {n, 55}]] (* Michael De Vlieger, Jan 27 2017 *)
    NextComposite[n_Integer /; n > -1] := If[-1 < n < 3, 4, If[ PrimeQ[n + 1], n + 2, n + 1]]; a[n_] := Block[{k = 4}, While[ !PrimeQ[ FromDigits[ Flatten[ IntegerDigits[ NestList[ NextComposite, k, n - 1]]]]], k = NextComposite@ k]; k]; Array[a, 55, 2] (* Robert G. Wilson v, Mar 12 2021 *)
  • PARI
    nextc(c, n) = {my(vc = vector(n), j = 2, x = c+1); vc[1] = c; while (j <= n, if (!isprime(x), vc[j] = x; j++); x++;); vc;}
    isok(vc) = {my(x=""); for (i=1, #vc, x = concat(x, Str(vc[i]))); ispseudoprime(eval(x));}
    a(n) = {forcomposite(c=4, oo, my(vc = nextc(c, n)); if (isok(vc), return(c)););} \\ Michel Marcus, Mar 03 2021
    
  • PARI
    {inv_A281684(n,L=oo,k=1)=forcomposite(c=1+n=A002808(n),L,k++;ispseudoprime(n=n*10^(logint(c,10)+1)+c)&&return(k))} \\ "reversed function" (cf. comments): Find the least k such that the concatenation of k composites, starting with the n-th composite, yield a prime. 2nd optional arg allows to specify a search limit L, then an empty/zero result means that k > L. - M. F. Hasler, Aug 07 2021