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

A019518 Smarandache-Wellin numbers: a(n) is the concatenation of first n primes (written in base 10).

Original entry on oeis.org

2, 23, 235, 2357, 235711, 23571113, 2357111317, 235711131719, 23571113171923, 2357111317192329, 235711131719232931, 23571113171923293137, 2357111317192329313741, 235711131719232931374143, 23571113171923293137414347
Offset: 1

Views

Author

R. Muller

Keywords

Examples

			E.g. a(6) = 2_3_5_7_11_13 = 23571113.
		

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 72. [The 2002 printing states incorrectly that a(719) is prime. Cf. A046035.] This book uses the name "Smarandache-Wellin numbers", referring to a 1998 private communication from P. Wellin.
  • H. Ibstedt, A Few Smarandache Sequences, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 170-183.
  • M. Le, On Smarandache Concatenated Sequences I: Prime Power Sequences, Smarandache Notions Journal, Vol. 9, No. 1-2, 1998, 129-130.
  • S. Smarandoiu, Convergence of Smarandache continued fractions, Abstract 96T-11-195, Abstracts Amer. Math. Soc., 17 (No. 4, 1996), 680.

Crossrefs

For the primes in this sequence see A069151. For where the primes occur see A046035.
Cf. A000040, A038394, A046284, A068670 (number of digits).

Programs

  • Haskell
    a019518 n = a019518_list !! (n-1)
    a019518_list = map read $ scanl1 (++) $ map show a000040_list :: [Integer]
    -- Reinhard Zumkeller, Mar 03 2014
    
  • Magma
    [Seqint(Reverse(&cat[Reverse(Intseq(NthPrime(k))): k in [1..n]])): n in [1..20]]; // Vincenzo Librandi, Aug 23 2015
  • Mathematica
    ConsecutivePrimes[n_] := FromDigits[Flatten[IntegerDigits /@ Prime[Range[n]]]] (* Eric W. Weisstein *)
    Table[FromDigits[Flatten[IntegerDigits[Prime[Range[i]]]]],{i,15}] (* Jayanta Basu, May 30 2013 *)
  • PARI
    s="";for(n=1,30,print1(s=Str(s,prime(n))",")) \\ Cino Hilliard; simplified by M. F. Hasler, Oct 06 2013
    
  • PARI
    A019518(n)=eval(concat(concat([""],primes(n)))) \\ Faster than concat(apply(s->Str(s),primes(n))) or forprime(...s=Str(s,p)). - M. F. Hasler, Oct 06 2013
    

Extensions

Definition edited by N. J. A. Sloane, Jul 02 2017

A046035 Numbers k such that the concatenation of the first k primes (A019518) is a prime.

Original entry on oeis.org

1, 2, 4, 128, 174, 342, 435, 1429
Offset: 1

Views

Author

Keywords

Comments

No other terms with k <= 34736. - Eric W. Weisstein, Oct 30 2015

Examples

			4 is a term since 2357 is a prime. [Corrected by Ed Murphy (emurphy42(AT)socal.rr.com), May 15 2007]
		

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 72. [The 2002 printing states incorrectly that 719 is a term.]

Crossrefs

Cf. A033308 (Decimal expansion of Copeland-Erdős constant: concatenate primes).

Programs

  • Mathematica
    max = 1500; With[{primes = Prime[Range[max]]}, Flatten[Position[ Table[ FromDigits[Flatten[IntegerDigits/@Take[primes, n]]], {n, max}], ?PrimeQ]]] (* _Harvey P. Dale, Dec 17 2013 *)
    Position[FromDigits /@ Rest[FoldList[Join, {}, IntegerDigits[Prime[Range[ 10^3]]]]], ?PrimeQ] // Flatten (* _Eric W. Weisstein, Oct 30 2015 *)
  • PARI
    p=""; for(n=1, 2000, p=concat(p, prime(n)); if(ispseudoprime(eval(p)), print1(n", "))) \\ Altug Alkan, Oct 30 2015

Formula

a(n) = A000720(A046284(n)), or A046284(n) = prime(a(n)).

A069151 Concatenations of consecutive primes, starting with 2, that are also prime.

Original entry on oeis.org

2, 23, 2357
Offset: 1

Views

Author

Joseph L. Pe, Apr 08 2002

Keywords

Comments

Primes in A019518.
The next term is the 355-digit number 2357111317192329313741434753...677683691701709719 which is too large to include here. See A046035, A046284.
The term after the 355-digit term has 499 digits, and the next two terms after that have 1171 and 1543 digits respectively. - Harvey P. Dale, Oct 03 2024

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, 2nd ed., Springer, NY, 2005; see p. 78. [The 2002 printing states incorrectly that 2357...5441 is prime.]

Crossrefs

Cf. A019518.
Cf. A046035 (Numbers n such that the concatenation of the first n primes is prime)
Cf. A046284 (Primes p such that concatenation of primes from 2 through p is a prime).
Cf. A030997 (Smallest prime which is a concatenation of n consecutive primes).

Programs

  • Mathematica
    Cases[FromDigits /@ Rest[FoldList[Join, {}, IntegerDigits[Prime[ Range[10^3]]]]], ?PrimeQ] (* _Eric W. Weisstein, Oct 30 2015 *)
    Select[Table[FromDigits[Flatten[IntegerDigits/@Prime[Range[n]]]],{n,500}],PrimeQ] (* Harvey P. Dale, Oct 03 2024 *)
  • PARI
    s=""; for(n=1, 200, s=concat(s, prime(n)); if(ispseudoprime( eval(s)), print1(s", "))) \\ Jens Kruse Andersen, Jun 26 2014
    
  • Python
    from sympy import isprime, nextprime
    def afind(terms, verbose=False):
      n, p, pstr = 0, 2, "2"
      while n < terms:
        if isprime(int(pstr)): n += 1; print(n, int(pstr))
        p = nextprime(p); pstr += str(p)
    afind(5) # Michael S. Branicky, Feb 23 2021

Extensions

Edited by Robert G. Wilson v, Apr 11 2002
Entry revised Jan 18 2004

A100003 Prime numbers p such that the concatenation of all odd primes up through p in decreasing order is prime.

Original entry on oeis.org

3, 5, 17, 89, 383, 8831
Offset: 1

Views

Author

Farideh Firoozbakht, Nov 06 2004

Keywords

Comments

Next term is greater than 4400th prime and the prime corresponding to the next term has more than 20000 digits. Number of digits of primes corresponding to the six known terms of the sequence are respectively 1, 2, 9, 43, 198, 4202.
We can see the prime corresponding to 383 (the 5th term of the sequence) in the page related to puzzle 8 of the website of Carlos Rivera.
a(7) > prime(28800) = 335033. - Giovanni Resta, Apr 01 2013

Examples

			17 is in the sequence because 17.13.11.7.5.3 is prime (dot between numbers means concatenation).
		

Crossrefs

The actual prime concatenations in A092448 and the original concatenations in A092447. - Dmitry Kamenetsky, Mar 02 2009

Programs

  • Mathematica
    Do[If[PrimeQ[(v={};Do[v=Join[v, IntegerDigits[Prime[n-j+1]]], {j, n-1}];FromDigits[v])], Print[Prime[n]]], {n, 2, 4413}]
    Prime[#]&/@Select[Range[100],PrimeQ[FromDigits[Flatten[IntegerDigits/@ Prime[Range[#,2,-1]]]]]&] (* To generate a(6) increase the Range by 1000, but the program will run a long time. *) (* Harvey P. Dale, Nov 27 2015 *)

A099070 Numbers k such that the concatenation of all nonprime natural numbers up to k with decreasing order is prime.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 26, 1752, 1753
Offset: 1

Views

Author

Farideh Firoozbakht, Nov 04 2004

Keywords

Comments

If k is in the sequence and k+1 is prime then k+1 is also in the sequence. Next term is greater than 5450 and the prime corresponding to the next term has more than 18000 digits. Number of digits of primes corresponding to the nine known terms of the sequence are respectively 2,2,3,3,4,5,29,5010 & 5010.
a(10) > 20000. - Michael S. Branicky, Nov 25 2024

Examples

			9 is in the sequence because all nonprime natural numbers up to 9 are 1,4,6,8 & 9 and 98641 is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[If[PrimeQ[(v={};Do[If[ !PrimeQ[n+1-j], v=Join[v, IntegerDigits [n+1-j]]], {j, n}];FromDigits[v])], Print[n]], {n, 5450}]

A099071 Composite numbers k such that the concatenation of all nonprime positive integers up to k in decreasing order is prime.

Original entry on oeis.org

4, 6, 8, 9, 26, 1752
Offset: 1

Views

Author

Farideh Firoozbakht, Nov 06 2004

Keywords

Comments

The terms of this sequence are composite terms of the sequence A099070 with the same order. Next term is greater than 6000 and the prime corresponding to the next term has more than 20000 digits. Number of digits of primes corresponding to the six known terms of the sequence are respectively 2, 3, 4, 5, 29, and 5010.

Examples

			26 is a term: 26 is composite; nonprimes up to 26 are 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26; and 26252422212018161514121098641 is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[If[ !PrimeQ[n]&&PrimeQ[(v={};Do[If[ !PrimeQ[n+1-j], v=Join[v, IntegerDigits[n+1-j]]], {j, n}];FromDigits[v])], Print[n]], {n, 6013}]
    cnpQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits/@Select[Range[n,1,-1],!PrimeQ[#]&]]]]; Select[Range[1800],!PrimeQ[#]&&cnpQ[#]&] (* Harvey P. Dale, Jul 19 2020 *)
Showing 1-6 of 6 results.