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.

A300289 a(n) is the smallest prime p such that the product of p and prime(n) contains only prime digits, or -1 if no such prime p exists.

Original entry on oeis.org

11, 11, 5, 5, 2, 29, 19, 3, 11, 13, 17, 61, 13, 59, 5, 61, 43, 37, 5, 5, 101, 3, 31, 307, 59, 23, 541, 5, 3, 29, 179, 17, 1721, 257, 17, 5, 239, 229, 199, 149, 3, 13, 3, 1439, 281, 127, 107, 101, 9791, 163, 31, 107, 3, 3, 139, 199, 83, 13, 929, 83, 19, 11, 11, 107, 71, 181, 167, 661, 1031
Offset: 1

Views

Author

Ivan N. Ianakiev, Mar 02 2018

Keywords

Comments

If a(i) = prime(j), then a(j) <= prime(i). - Rémy Sigrist, Mar 03 2018. [Note that this does not imply that a prime p always exists! In fact if r and s are large primes, r*s will surely contain a nonprime digit, although this kind of question is beyond the reach of present-day mathematics. - N. J. A. Sloane, Mar 03 2018]

Examples

			11 is the smallest prime such that 11*prime(1)=22 consists of only prime digits. Therefore a(1) = 11.
		

Crossrefs

Cf. A046034.

Programs

  • Mathematica
    p[n_] := Module[{k = 1},  While[Union[PrimeQ /@ IntegerDigits[n*Prime[k]]] != {True}, k++]; Prime[k]]; p /@ Prime[Range[100]]
    spp[p_]:=Module[{k=2},While[AnyTrue[IntegerDigits[p*k],!PrimeQ[#]&],k=NextPrime[k]];k]; Table[spp[p],{p,Prime[Range[70]]}] (* Harvey P. Dale, Jun 20 2023 *)
  • PARI
    a(n) = {forprime(p=2, , if (#select(x->(! isprime(x)), digits(p*prime(n))) == 0, return (p)););} \\ Michel Marcus, Mar 02 2018

Extensions

Escape clause added to definition by N. J. A. Sloane, Mar 03 2018