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-7 of 7 results.

A030997 Smallest prime which is a concatenation of n consecutive primes.

Original entry on oeis.org

2, 23, 5711, 2357, 711131719, 113127131137139149, 29313741434753, 107109113127131137139149, 211223227229233239241251257, 691701709719727733739743751757, 2329313741434753596167
Offset: 1

Views

Author

Keywords

Examples

			a(5) = 711131719 is the smallest prime which is the concatenation of five consecutive primes 7, 11, 13, 17 and 19.
		

Crossrefs

Cf. A030461 (primes that are concatenations of two primes), A030469 (three primes), A030473 (four primes), A086041 (five primes).

Programs

  • PARI
    for(k=1,19, for(i=0,1e9, isprime( eval( p=concat( vector( k,j,Str( prime( i+j )))))) & break); print1(p,", ")) \\ M. F. Hasler, Nov 10 2009

A052079 Concatenation of n consecutive ascending numbers starting from a(n) produces the smallest possible prime of this form, 0 if no such prime exists.

Original entry on oeis.org

2, 2, 0, 4, 15, 0, 7, 2, 0, 4, 129, 0, 5, 50, 0, 128, 3, 0, 23, 38, 0, 9998, 17, 0, 25, 2, 0, 16, 341, 0, 569, 42, 0, 14, 1203, 0, 2465, 102, 0, 212, 1161, 0, 197
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Comments

Next term a(44)=10^348-32 (only probable prime with 15324 digits). a(110)=9999968. If n is divisible by 22 then either a(n)=0 or a(n)=10^x-b for some bJens Kruse Andersen, Feb 03 2003

Examples

			For n = 7 we have a(7) = 7 so the seven consecutive ascending numbers 7,8,9,10,11,12 and 13 concatenated together gives the smallest possible prime of this form, 78910111213.
		

Crossrefs

Programs

  • PARI
    isok(vc) = {my(x=""); for (i=1, #vc, x = concat(x, Str(vc[i]))); ispseudoprime(eval(x));}
    a(n) = if (n % 3, for(i=1, oo, my(vc = vector(n, k, k+i-1)); if (isok(vc), return(i))), 0); \\ Michel Marcus, Mar 04 2021

Extensions

Terms a(7)-a(43) calculated by Carlos Rivera and Felice Russo

A309191 a(n) is the least prime such that each concatenation of 1 <= k <= n consecutive primes beginning with a(n) is prime, or 0 if no such prime exists.

Original entry on oeis.org

2, 2, 31, 4603, 910307, 352367441, 23908162969, 483148266971
Offset: 1

Views

Author

Jean-Marc Rebert, Jul 16 2019

Keywords

Examples

			a(2)=2; 2, 3 are 2 consecutive primes and their concatenation 23 is also prime.
a(3)=31 since 31, 37, and 41 are 3 consecutive primes and 3137 and 313741 are both prime.
		

Crossrefs

Cf. A030996.

Programs

  • Mathematica
    a[n_] := Block[{p = Prime@ Range@ n}, While[! AllTrue[Range[2, n], PrimeQ@ FromDigits@ Flatten@ IntegerDigits@ Take[p, #] &], p = Append[ Rest@ p, NextPrime@ Last@ p]]; p[[1]]]; Array[a, 5] (* Giovanni Resta, Jul 16 2019 *)

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

A297935 Least prime k such that n concatenations of n+1 consecutive primes in base 2, starting from k, generate another prime in base 10.

Original entry on oeis.org

2, 2, 3, 2, 19, 53, 163, 53, 167, 31, 3, 37, 743, 97, 271, 17, 3, 41, 131, 691, 97, 181, 587, 523, 227, 211, 229, 3, 1697, 151, 1009, 23, 131, 151, 3137, 1621, 71, 439, 389, 521, 811, 1039, 179, 23, 311, 193, 227, 5869, 577, 6263, 31, 1901, 113, 1439, 1451, 107
Offset: 0

Views

Author

Paolo P. Lava, Jan 09 2018

Keywords

Examples

			a(4) = 19 because the concatenation of 19, 23, 29, 31, 37 in base 2 is concat(concat(concat(concat(10011, 10111), 11101), 11111), 100101) that is the prime 41414629 in base 10 and 19 is the least prime to have this property.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,i,k,n;
    for n from 1 to q do for k from 1 to q do
    a:=ithprime(k); b:=convert(a,binary,decimal);
    for i from 1 to n-1 do a:=nextprime(a);
    c:=convert(a,binary,decimal); b:=b*10^(ilog10(c)+1)+c; od;
    a:=convert(b,decimal,binary); if isprime(a) then print(ithprime(k)); break; fi; od; od; end: P(10^3);
  • Mathematica
    Table[Prime@ SelectFirst[Range[2^12], Function[k, PrimeQ@ FromDigits[Join @@ IntegerDigits[Prime@ Range[k, k + n], 2],2]]], {n, 0, 55}] (* Michael De Vlieger, Jan 09 2018 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    concat_primes(start, num) = my(v=[], s=""); forprime(p=start, , v=concat(v, [eva(binary(p))]); if(#v==num, break)); for(k=1, #v, s=concat(s, Str(v[k]))); eval(s)
    a(n) = forprime(k=1, , if(ispseudoprime(decimal(digits(concat_primes(k, n+1)), 2)), return(k))) \\ Felix Fröhlich, Jan 09 2018

A173448 Smallest prime(k) such that the concatenation prime(k)//prime(k+1)//...//prime(k+n-1) represents an emirp.

Original entry on oeis.org

13, 151, 353, 139, 101, 70451, 97, 15193, 3821, 9319, 7717, 103619, 10883, 18353, 108821, 701, 10091, 99251, 78497, 3559, 930043, 99787, 18671, 12251, 711751, 9293, 10861, 121921, 103099, 986189, 74287, 796567, 323003, 108707, 365779, 192377, 393901, 380251, 98479, 114343, 329729
Offset: 1

Views

Author

Lekraj Beedassy, Feb 18 2010

Keywords

Examples

			a(5) = 101 because 101103107109113 = A086041(6) is the smallest emirp formed by concatenating 5 consecutive primes (101, 103, 107, 109, 113).
		

Crossrefs

Extensions

Keyword:base added and definition reworded by R. J. Mathar, Feb 24 2010
More terms from Sean A. Irvine, Nov 14 2010

A359406 Integers k such that the concatenation of k consecutive primes starting at 31 is prime.

Original entry on oeis.org

1, 2, 3, 23, 43, 141
Offset: 1

Views

Author

Mikk Heidemaa, Dec 30 2022

Keywords

Comments

The corresponding primes (p) known (31, 3137, 313741, ...) have an even number of digits and p (mod 10) == 1|7. For those at a(1)...a(6), p (mod 3) == p (mod 5) holds.
a(7): 3472 corresponds to a 15968-digit probable prime (certification in progress).
For a(8), k > 15000 (if it exists).
a(8) > 30000. - Tyler Busby, Feb 13 2023

Examples

			2 is a term because the consecutive primes 31 and 37 concatenated to 3137 yield another prime.
		

Crossrefs

Programs

  • Mathematica
    UpToK[k_] := Block[{a := FromDigits @ Flatten @ IntegerDigits @ Join[{}, Prime @ Range[11, i]]}, Reap[ Do[ If[ PrimeQ[a], Sow[i - 10], Sow[Nothing]], {i, k}]]][[2, 1]]; UpToK[3500] (* or *)
    UpToK[k_] := Flatten @ Parallelize @ MapIndexed[ If[ PrimeQ[#1], #2, Nothing] &, DeleteCases[ FromDigits /@ Flatten /@ IntegerDigits @ Prime @ Range[11, Range[k]], 0]]; UpToK[3500]
Showing 1-7 of 7 results.