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

A046704 Additive primes: sum of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 223, 227, 229, 241, 263, 269, 281, 283, 311, 313, 317, 331, 337, 353, 359, 373, 379, 397, 401, 409, 421, 443, 449, 461, 463, 467, 487, 557, 571, 577, 593
Offset: 1

Views

Author

Keywords

Comments

Sum_{a(n) < x} 1/a(n) is asymptotic to (3/2)*log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. - Jonathan Sondow, Jun 07 2012
Harman 2012 also shows, under a conjecture about primes in short intervals, that there are 3/2 * x/(log x log log x) terms up to x. - Charles R Greathouse IV, Nov 17 2014

Examples

			The digit sums of 11 and 13 are 1+1=2 and 1+3=4. Since 2 is prime and 4 is not, 11 is a member and 13 is not. - _Jonathan Sondow_, Jun 07 2012
		

Crossrefs

Indices of additive primes are in A075177.
Cf. A046703, A119450 = Primes with odd digit sum, A081092 = Primes with prime binary digit sum, A104213 = Primes with nonprime digit sum.
Cf. A007953, A010051; intersection of A028834 and A000040.

Programs

  • Haskell
    a046704 n = a046704_list !! (n-1)
    a046704_list = filter ((== 1) . a010051 . a007953) a000040_list
    -- Reinhard Zumkeller, Nov 13 2011
  • Magma
    [ p: p in PrimesUpTo(600) | IsPrime(&+Intseq(p)) ];  // Bruno Berselli, Jul 08 2011
    
  • Maple
    select(n -> isprime(n) and isprime(convert(convert(n,base,10),`+`)), [2,seq(2*i+1,i=1..1000)]); # Robert Israel, Nov 17 2014
  • Mathematica
    Select[Prime[Range[100000]], PrimeQ[Apply[Plus, IntegerDigits[ # ]]]&]
  • PARI
    isA046704(n)={local(s,m);s=0;m=n;while(m>0,s=s+m%10;m=floor(m/10));isprime(n) & isprime(s)} \\ Michael B. Porter, Oct 18 2009
    
  • PARI
    is(n)=isprime(n) && isprime(sumdigits(n)) \\ Charles R Greathouse IV, Dec 26 2013
    

A028842 Numbers whose product of digits is prime.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 21, 31, 51, 71, 112, 113, 115, 117, 121, 131, 151, 171, 211, 311, 511, 711, 1112, 1113, 1115, 1117, 1121, 1131, 1151, 1171, 1211, 1311, 1511, 1711, 2111, 3111, 5111, 7111, 11112, 11113, 11115, 11117, 11121, 11131, 11151
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007954, A028843, A028834, A046703 (subsequence of primes).

Programs

  • Mathematica
    Select[Range[11160], PrimeQ[Times@@IntegerDigits[#]] &] (* Jayanta Basu, Jun 02 2013 *)
  • PARI
    isok(n) = isprime(vecprod(digits(n))); \\ Michel Marcus, Apr 17 2020
    
  • PARI
    is(n)=my(d=digits(n),p); for(i=1,#d,if(d[i]==1,next); if(isprime(d[i]) && !p, p=1, return(0))); p \\ Charles R Greathouse IV, Apr 18 2020
  • Sage
    [x for x in range(10^5) if (prod(Integer(x).digits(base=10))) in Primes()] # Bruno Berselli, May 05 2014
    
  • Scala
    (1 to 10000).filter(n => List(2, 3, 5, 7).contains(n.toString.toCharArray.map( - 48).scanRight(1)( * ).head)) // _Alonso del Arte, Apr 14 2020
    

Extensions

More terms from Erich Friedman.
Name edited by Jianing Song, Jul 07 2025

A046713 Multiplicative and additive primes: primes where the product and sum of digits are also prime.

Original entry on oeis.org

2, 3, 5, 7, 113, 131, 151, 311, 2111, 11113, 11117, 11131, 11171, 11311, 111121, 111211, 112111, 1111151, 1111711, 1117111, 1171111, 111111113, 111111131, 111113111, 115111111, 131111111, 1111111121, 1111211111, 1121111111, 11111111113, 11111111131, 11113111111
Offset: 1

Views

Author

Keywords

Comments

Any term of this sequence has one prime digit and all other digits are 1. - Sean A. Irvine, Apr 17 2021

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.

Crossrefs

Intersection of A028834, A028842, and A000040.
Intersection of A046703 and A046704.

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; t={}; Do[p=Prime[n]; If[PrimeQ[Plus@@(x=d[p])]&&PrimeQ[Times@@x],AppendTo[t,p]],{n,2*10^5}]; t (* Jayanta Basu, May 18 2013 *)
    Select[Prime[Range[5033*10^5]],AllTrue[{Total[IntegerDigits[ #]],Times@@ IntegerDigits[ #]},PrimeQ]&] (* or -- much faster *) Select[Union[ Flatten[ Table[FromDigits/@Permutations[PadRight[{p},n,1]],{p,{2,3,5,7}},{n,11}]]],AllTrue[{#,Total[ IntegerDigits[#]],Times@@ IntegerDigits[ #]},PrimeQ]&] (* Harvey P. Dale, Feb 28 2022 *)

Extensions

More terms from Harvey P. Dale, Aug 23 2000
Corrected by Jud McCranie, Jan 03 2001
Edited by Charles R Greathouse IV, Aug 02 2010

A117835 Prime numbers for which the product of the digits is a noncomposite number.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 71, 113, 131, 151, 211, 311, 1117, 1151, 1171, 1511, 2111, 11113, 11117, 11131, 11171, 11311, 111121, 111211, 112111, 113111, 131111, 311111, 511111, 1111151, 1111211, 1111711, 1117111, 1171111, 11111117, 11111131, 11111171, 11111311, 11113111, 11131111
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), Apr 30 2006

Keywords

Comments

None of the numbers in the sequence can have a digit 0, 4, 6, 8 or 9. The digits are all 1's, or there is one digit 2, 3, 5 or 7 and all the others are 1's.
A variant of A046703 where the "all '1's" (repunit primes R(k) with k in A004023: R(2) = 11, R(19), ...) are excluded. - M. F. Hasler, Apr 22 2019
Contains primes in A028842 as a subset. - M. F. Hasler, Apr 23 2019

Crossrefs

Cf. A046703 ("prime" variant), A007954 (product of digits), A008578 (noncomposite numbers), A028842 (product of digits is prime).

Programs

  • Mathematica
    Select[Prime[Range[10^6]],PrimeQ[Times@@IntegerDigits[#]]||Times@@IntegerDigits[#]==1&] (* James C. McMahon, Sep 24 2024 *)
  • PARI
    select( is_A117835(n)=isprime(n)&&(isprime(n=vecprod(digits(n)))||n==1), [0..999]) \\ In older PARI versions, vecprod=factorback. \\ M. F. Hasler, Apr 23 2019
    
  • PARI
    next_A117835(n)={until( isprime(n), my(d=digits(n)); n=if(n<3||Set(d)==[1], n+1, fromdigits(apply(t->if(t<2, 1, t<7, nextprime(t+1), 11), d))));n}
    A117835_vec(N=99)=vector(N,i,t=next_A117835(if(i>1,t))) \\ M. F. Hasler, Apr 23 2019

Formula

A117835 = { n in A008578 | A007954(n) is again in A008578 }. - M. F. Hasler, Apr 23 2019

Extensions

Name changed, following a remark from Zak Seidov, and edited by M. F. Hasler, Apr 22 2019

A210546 Emirps whose products of digits are prime.

Original entry on oeis.org

13, 17, 31, 71, 113, 311, 1151, 1511, 111211, 112111, 1111711, 1171111, 11111117, 11113111, 11131111, 71111111, 111111131, 131111111, 1111115111, 1115111111, 11111111113, 31111111111, 111111111111111131, 131111111111111111, 1111111111111111111111111511
Offset: 1

Views

Author

Lekraj Beedassy, Mar 22 2012

Keywords

Crossrefs

Programs

  • Python
    from _future_ import division
    from sympy import isprime
    A210546_list = []
    for l in range(1,20):
        q = (10**l-1)//9
        for i in range(l):
            for p in [2,3,5,7]:
                r = q+(p-1)*10**i
                s, t = str(r), str(r)[::-1]
                if s != t and isprime(r) and isprime(int(t)):
                    A210546_list.append(r) # Chai Wah Wu, Aug 15 2017

Extensions

5 more terms from Alois P. Heinz, Mar 29 2012

A210547 Lesser of emirp pairs whose members have prime digital products.

Original entry on oeis.org

13, 17, 113, 1151, 111211, 1111711, 11111117, 11113111, 111111131, 1111115111, 11111111113, 111111111111111131, 1111111111111111111111111511, 11111111111111111711111111111, 111111111111111111111111111111111111131
Offset: 1

Views

Author

Lekraj Beedassy, Mar 22 2012

Keywords

Comments

Beyond the first two terms, a(n) is the intersection of A173595 and A046703.

Crossrefs

Extensions

More terms from Alois P. Heinz, Mar 22 2012

A210548 Larger of emirp pairs whose members have prime digital products.

Original entry on oeis.org

31, 71, 311, 1511, 112111, 1171111, 11131111, 71111111, 131111111, 1115111111, 31111111111, 131111111111111111, 1151111111111111111111111111, 11111111111711111111111111111, 131111111111111111111111111111111111111
Offset: 1

Views

Author

Lekraj Beedassy, Mar 22 2012

Keywords

Comments

Beyond the first two terms, a(n) is the intersection of A173596 and A046703.

Crossrefs

Extensions

More terms from Alois P. Heinz, Mar 22 2012

A046705 Palindromic primes whose product of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 131, 151, 11311, 1117111, 111111151111111, 111111111111111111131111111111111111111, 1111111111111111111111111111111117111111111111111111111111111111111, 1111111111111111111111111111111111111111111115111111111111111111111111111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

Except for the first 4 terms, a subsequence of A088281. - Chai Wah Wu, Dec 17 2015
Subsequence of A028842, of A046703, and also of A117058. - Michel Marcus, Dec 18 2015

Crossrefs

Programs

  • Mathematica
    t = Prime[Range[4]]; Union[Select[Flatten[Table[NestList[FromDigits[Flatten[{1, IntegerDigits[#], 1}]] &, n, 45], {n, t}]], PrimeQ]] (* Jayanta Basu, Jun 27 2013 *)
  • Python
    from _future_ import division
    from sympy import isprime
    A046705_list = [n for n in ((10**(2*l+1)-1)//9+d*10**l for l in range(100) for d in [1,2,4,6]) if isprime(n)] # Chai Wah Wu, Dec 17 2015

A245382 Primes whose product of digits is a semiprime.

Original entry on oeis.org

19, 23, 37, 41, 53, 61, 73, 127, 137, 157, 173, 191, 251, 271, 313, 317, 331, 521, 571, 751, 911, 1123, 1153, 1213, 1217, 1231, 1321, 1531, 1571, 1721, 2113, 2131, 2311, 2711, 3121, 3511, 4111, 5113, 5171, 5711, 7121, 7151, 7211, 11119, 11161, 11173, 11177, 11213
Offset: 1

Views

Author

K. D. Bajpai, Jul 20 2014

Keywords

Comments

The linked table includes probable primes. - Jens Kruse Andersen, Jul 21 2014

Examples

			137 is prime. 1 * 3 * 7 = 21 = 3 * 7, which is semiprime.
251 is prime. 2 * 5 * 1 = 10 = 2 * 5, which is semiprime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[1000]], PrimeOmega[(Times @@ IntegerDigits[#])] == 2 &]
  • PARI
    f(n,b,d) = if(d, for(i=1, 9, if(b+bigomega(i)<=2, f(10*n+i, b+bigomega(i), d-1))), if(b==2 && isprime(n), print1(n", ")))
    for(d=1, 8, f(0,0,d)) \\ f(0,0,d) prints d-digit terms. Jens Kruse Andersen, Jul 21 2014

A245383 Numbers n whose product of decimal digits is a semiprime.

Original entry on oeis.org

4, 6, 9, 14, 16, 19, 22, 23, 25, 27, 32, 33, 35, 37, 41, 52, 53, 55, 57, 61, 72, 73, 75, 77, 91, 114, 116, 119, 122, 123, 125, 127, 132, 133, 135, 137, 141, 152, 153, 155, 157, 161, 172, 173, 175, 177, 191, 212, 213, 215, 217, 221, 231, 251, 271, 312, 313, 315
Offset: 1

Views

Author

K. D. Bajpai, Jul 20 2014

Keywords

Comments

n either has one digit 4, 6 or 9 or two digits in {2,3,5,7}, all other digits being 1. - Robert Israel, Jul 20 2014

Examples

			217 is in the sequence because 2 * 1 * 7 = 14 = 2 * 7 which is a semiprime.
312 is in the sequence because 3 * 1 * 2 = 6 = 2 * 3 which is a semiprime.
		

Crossrefs

Programs

  • Maple
    dmax:= 4: # to get all terms with up to d digits
    A:= NULL:
    for d from 1 to dmax do
      for j from 1 to d do
         for xj in [4,6,9] do
            A:= A,(10^d-1)/9 + (xj-1)*10^(j-1);
      od od:
      for ij in combinat[choose](d,2) do
        for xi in [2,3,5,7] do
          for xj in [2,3,5,7] do
            A:= A,(10^d-1)/9 + (xi-1)*10^(ij[1]-1) + (xj-1)*10^(ij[2]-1);
      od od od:
    od:
    {A}; # Robert Israel, Jul 20 2014
  • Mathematica
    Select[Range[500], PrimeOmega[(Times @@ IntegerDigits[#])] == 2 &]
  • PARI
    f(n,b,d) = if(d, for(i=1, 9, if(b+bigomega(i)<=2, f(10*n+i, b+bigomega(i), d-1))), if(b==2, print1(n", ")))
    for(d=1, 4, f(0,0,d)) \\ f(0,0,d) prints d-digit terms. Jens Kruse Andersen, Jul 21 2014
Showing 1-10 of 10 results.