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-10 of 14 results. Next

A046034 Numbers whose digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532
Offset: 1

Views

Author

Keywords

Comments

If n is represented as a zerofree base-4 number (see A084544) according to n=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=2,3,5,7 for k=1..4. - Hieronymus Fischer, May 30 2012
According to A153025, it seems that 5, 235 and 72335 are the only terms whose square is also a term, i.e., which are also in the sequence A275971 of square roots of the terms which are squares, listed in A191486. - M. F. Hasler, Sep 16 2016

Examples

			a(100)   = 2277,
a(10^3)  = 55327,
a(9881)  = 3233232,
a(10^4)  = 3235757,
a(10922) = 3333333,
a(10^5)  = 227233257.
		

Crossrefs

Programs

  • Haskell
    a046034 n = a046034_list !! (n-1)
    a046034_list = filter (all (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [n: n in [2..532] | Set(Intseq(n)) subset [2, 3, 5, 7]];  // Bruno Berselli, Jul 19 2011
    
  • Mathematica
    Table[FromDigits /@ Tuples[{2, 3, 5, 7}, n], {n, 3}] // Flatten (* Michael De Vlieger, Sep 19 2016 *)
  • PARI
    is_A046034(n)=Set(isprime(digits(n)))==[1] \\ M. F. Hasler, Oct 12 2013
    
  • Python
    def A046034(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join(('2357'[(3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3] for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

A055642(a(n)) = A193238(a(n)). - Reinhard Zumkeller, Jul 19 2011
From Hieronymus Fischer, Apr 20, May 30 and Jun 25 2012: (Start)
a(n) = Sum_{j=0..m-1} ((2*b(j)+1) mod 8 + floor(b(j)/4) - floor((b(j)-1)/4))*10^j, where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
a(n) = Sum_{j=0..m-1} A010877(A005408(b(j)) + A002265(b(j)) - A002265(b(j)-1))*10^j.
Special values:
a(1*(4^n-1)/3) = 2*(10^n-1)/9.
a(2*(4^n-1)/3) = 1*(10^n-1)/3.
a(3*(4^n-1)/3) = 5*(10^n-1)/9.
a(4*(4^n-1)/3) = 7*(10^n-1)/9.
Inequalities:
a(n) <= 2*(10^log_4(3*n+1)-1)/9, equality holds for n = (4^k-1)/3, k>0.
a(n) <= 2*A084544(n), equality holds iff all digits of A084544(n) are 1.
a(n) > A084544(n).
Lower and upper limits:
lim inf a(n)/10^log_4(n) = (7/90)*10^log_4(3) = 0.48232167706987..., for n -> oo.
lim sup a(n)/10^log_4(n) = (2/9)*10^log_4(3) = 1.378061934485343..., for n -> oo.
where 10^log_4(n) = n^1.66096404744...
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(2 + z(j) + 2*z(j)^2 + 2*z(j)^3 - 7*z(j)^4)/(1-z(j)^4), where z(j) = x^4^j.
Also g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1-z(j))*(2 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3)/(1-z(j)^4), where z(j)=x^4^j.
Also: g(x) = (1/(1-x))*(2*h_(4,0)(x) + h_(4,1)(x) + 2*h_(4,2)(x) + 2*h_(4,3)(x) - 7*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3)*x^(k*4^j)/(1-x^4^(j+1)). (End)
Sum_{n>=1} 1/a(n) = 1.857333779940977502574887651449435985318556794733869779170825138954093657197... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

More terms from Cino Hilliard, Aug 06 2006
Typo in second formula corrected by Hieronymus Fischer, May 12 2012
Two typos in example section corrected by Hieronymus Fischer, May 30 2012

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

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

A046284 Primes p such that concatenation of primes from 2 through p is a prime.

Original entry on oeis.org

2, 3, 7, 719, 1033, 2297, 3037, 11927
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

"w_n = (P_1)(P_2) ... (P_n) [A019518], by which notation we mean that w_n is constructed in decimal by simple concatenation of digits [much like the Almost Natural numbers (A007376)]. For example, the first few w_n are 2, 23, 235, 2357, 235711, ... ." - Crandall and Pomerance

Examples

			7 is a member, since 2357 is a prime.
		

References

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

Crossrefs

Cf. A019518, A033308, A069151. a(n) = prime(A046035(n)).

Programs

  • Mathematica
    a = ""; Do[a = StringJoin[a, ToString[ Prime[n]]]; If[ PrimeQ[ ToExpression[a]], Print[n]], {n, 1, 1429}]

Extensions

Additional comments from Robert G. Wilson v, Sep 10 2001

A085557 Numbers that have more prime digits than nonprime digits.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232
Offset: 1

Views

Author

Jason Earls, Jul 04 2003

Keywords

Comments

Begins to differ from A046034 at the 21st term (which is the first 3-digit term).

Examples

			133 is in the sequence as the prime digits are 3 and 3 (those are two digits; counted with multiplicity) and one nonprime digit 1 and so there are more prime digits than nonprime digits. - _David A. Corneth_, Sep 06 2020
		

Crossrefs

Programs

  • PARI
    is(n) = my(d = digits(n), c = 0); for(i = 1, #d, if(isprime(d[i]), c++)); c<<1 > #d \\ David A. Corneth, Sep 06 2020
    
  • Python
    from itertools import count, islice
    def A085557_gen(startvalue=1): # generator of terms
        return filter(lambda n:len(s:=str(n))<(sum(1 for d in s if d in {'2','3','5','7'})<<1),count(max(startvalue,1)))
    A085557_list = list(islice(A085557_gen(),20)) # Chai Wah Wu, Feb 08 2023

A099077 Numbers k such that pi(1).pi(2) ... pi(k-1).pi(k) is prime (dot between numbers means concatenation).

Original entry on oeis.org

5, 25, 2232, 4560
Offset: 1

Views

Author

Farideh Firoozbakht, Oct 23 2004

Keywords

Comments

Number of digits of primes corresponding to the four known terms of this sequence are respectively 4,24,6127,13111. Next term is greater than 10250 and the prime corresponding to the next term has more than 32500 digits.
a(5) > 35000. - Michael S. Branicky, Nov 25 2024

Examples

			5 is in the sequence because pi(1).pi(2).pi(3).pi(4).pi(5)=1223 is prime.
		

Crossrefs

A099078 Numbers k such that pi(k).pi(k-1) ... pi(3).pi(2) is prime (dot between numbers means concatenation).

Original entry on oeis.org

5, 22, 48, 317, 734, 5235, 12377
Offset: 1

Views

Author

Farideh Firoozbakht, Oct 23 2004

Keywords

Comments

Number of digits of primes corresponding to the five known terms of this sequence are respectively 4, 21, 67, 605, 1633.

Examples

			5 is in the sequence because pi(5).pi(4).pi(3).pi(2) = 3221 is prime.
		

Crossrefs

Programs

  • Maple
    r:= 1: v:= 1: Res:= NULL:
    for k from 3 to 6000 do
       if isprime(k) then r:= r+1 fi;
       v:= v + r*10^(1+ilog10(v));
       if isprime(v) then Res:= Res, k fi
    od:
    Res; # Robert Israel, Nov 20 2018
  • Mathematica
    s = ""; Do[s = ToString[PrimePi[n]] <> s; k = ToExpression[s]; If[PrimeQ[k], Print[n]], {n, 2, 5235}] (* Ryan Propper, Aug 30 2005 *)

Extensions

a(6) from Ryan Propper, Aug 30 2005
a(7) from Michael S. Branicky, Apr 29 2023

A099079 Numbers n such that phi(n).phi(n-1). ... .phi(2).phi(1) is prime (dots between numbers mean concatenation).

Original entry on oeis.org

2, 3, 9, 28, 30, 31, 51, 127, 208
Offset: 1

Views

Author

Farideh Firoozbakht, Oct 23 2004

Keywords

Comments

Number of digits of primes corresponding to the nine known terms of this sequence are respectively 2,3,9,39,42,44,84,244,441.
If it exists, a(10) > 10362. - J.W.L. (Jan) Eerland, Aug 14 2022
If it exists, a(10) > 25000. - Michael S. Branicky, Aug 23 2024

Examples

			9 is in the sequence because phi(9).phi(8).phi(7).phi(6).phi(5).phi(4).phi(3).phi(2).phi(1) = 646242211 is prime.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=210,eph},eph=EulerPhi[Range[nn]];Position[Table[FromDigits[ Flatten[ IntegerDigits[Reverse[Take[eph,n]]]]],{n,nn}],?PrimeQ]]// Flatten (* _Harvey P. Dale, Apr 21 2020 *)
    ParallelTable[If[PrimeQ[ToExpression[StringJoin[ToString[#]&/@Reverse[Table[EulerPhi[k],{k,1,n}]]]]],n,Nothing],{n,1,10^4}]//.{}->Nothing (* J.W.L. (Jan) Eerland, Aug 15 2022 *)

A099080 Numbers k such that sigma(k).sigma(k-1) ... sigma(2).sigma(1) is prime (dot between numbers means concatenation).

Original entry on oeis.org

2, 3, 66, 102
Offset: 1

Views

Author

Farideh Firoozbakht, Oct 23 2004

Keywords

Comments

Numbers of digits of primes corresponding to the four known terms of this sequence are respectively 2, 3, 133, and 232.
A naive heuristic suggests that this sequence is infinite but extremely sparse. - Charles R Greathouse IV, Nov 05 2013
There are no more terms below 10000. - Charles R Greathouse IV, Nov 09 2013
There are no more terms below 20000. - Michael S. Branicky, Nov 25 2024

Examples

			3 is in the sequence because sigma(3).sigma(2).sigma(1) = 431 is prime.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=110,d},d=DivisorSigma[1,Range[nn]];Select[Range[nn], PrimeQ[ FromDigits[ Flatten[IntegerDigits/@Reverse[Take[d,#]]]]]&]] (* Harvey P. Dale, Jul 25 2016 *)
  • PARI
    s="1";for(n=2,1e3,s=Str(sigma(n),s);if(ispseudoprime(eval(s)), print1(n", "))) \\ Charles R Greathouse IV, Nov 05 2013

A283802 Numbers k such that the concatenation of the first k odd composite numbers is a prime.

Original entry on oeis.org

21, 73, 132
Offset: 1

Views

Author

XU Pingya, Mar 17 2017

Keywords

Comments

Indices k for which A283801(k) is prime.
A283801(21) = 91521252733353945495155576365697577818587 is a 41-digit prime;
A283801(73) = 91521...247249253 is a 193-digit prime;
A283801(132) = 91521...423425427 is a 370-digit prime.
Next term, if it exists, will be more than 5028.
a(4) > 25000, if it exists. - Michael S. Branicky, Apr 30 2025

Crossrefs

Programs

  • Mathematica
    k = 2; cc = oc = 0; lst = {}; While[k < 428, If[OddQ@k && !PrimeQ@k, cc = cc*10^IntegerLength@k + k; oc++; If[PrimeQ[cc], AppendTo[lst, oc]]]; k++]; lst  (* Robert G. Wilson v, Mar 18 2017 *)
    Module[{nn=501,ocm},ocm=Select[Range[9,nn,2],CompositeQ];Select[ Range[ Length[ ocm]],PrimeQ[FromDigits[Flatten[IntegerDigits/@Take[ocm,#]]]]&]] (* Harvey P. Dale, Sep 02 2022 *)
Showing 1-10 of 14 results. Next