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

A046703 Multiplicative primes: product of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 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

Keywords

Comments

Primes with one prime digit and all other digits are 1. The linked table includes probable primes. - Jens Kruse Andersen, Jul 21 2014

Crossrefs

Cf. A117835 ("noncomposite" variant), A007954 (product of digits), A028842 (product of digits is prime).

Programs

  • Mathematica
    Select[Prime[Range[740000]],PrimeQ[Times@@IntegerDigits[#]]&] (* Harvey P. Dale, Oct 02 2011 *)
    Select[FromDigits/@Flatten[Table[Permutations[PadRight[{p},n,1]],{n,8},{p,{2,3,5,7}}],2],PrimeQ]//Union (* Harvey P. Dale, Nov 21 2019 *)
  • PARI
    f(n,b,d) = if(d, f(10*n+1, b, d-1); if(!b, forprime(q=2, 9, f(10*n+q, 1, d-1))), if(b && 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
    
  • PARI
    \\ From M. F. Hasler, Apr 23 2019: (Start)
    select( is_A046703(n)=isprime(vecprod(digits(n)))&&ispseudoprime(n), [0..9999]) \\ This defines is_A046703(). In older PARI versions, vecprod=factorback.
    next_A046703(n)={if( n>1, until( ispseudoprime(n), my(d=digits(n)); n=fromdigits( apply( t->if(t>1, nextprime(t+1), 1), d))+(d[1]>5)); n, 2)}
    A046703_vec(N=99)=vector(N, i, t=next_A046703(if(i>1, t))) \\ (End)

Extensions

Corrected by Harvey P. Dale, Oct 02 2011

A307714 Product of digits is noncomposite.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Apr 23 2019

Keywords

Comments

Either all digits are '1', or one of the digits can be a prime (2, 3, 5, 7).
The initial 0 is included by convention. (Some authors consider that the decimal expansion of 0 is the empty sum (0 has no digits) whence the product of digits is 1.)
This is the union of repunits A002275 and numbers whose product of digit is prime, A028842.

Crossrefs

Cf. A008578 (noncomposite numbers), A002275 (repunits), A117835 (primes in this sequence).

Programs

  • PARI
    select( is(n)={isprime(n=vecprod(digits(n)))||n==1}, [0..1999]) \\ In older PARI versions, vecprod=factorback.
    next_A307714(n,d)={if(n<3||Set(d=digits(n))==[1], n+1, fromdigits(apply(t->if(t<2, 1, t<7, nextprime(t+1),11), d)))}
    A307714_vec(N=99)=vector(N,i,t=if(i>1,next_A307714(t),0))
Showing 1-2 of 2 results.