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.

A128717 Primes that yield another prime if one adds either the sum of its digits or the product of its digits.

Original entry on oeis.org

101, 103, 163, 233, 293, 307, 431, 499, 509, 563, 617, 701, 743, 1009, 1049, 1061, 1087, 1409, 1423, 1483, 1489, 1601, 1607, 1801, 1867, 2017, 2039, 2053, 2273, 2543, 2633, 2903, 3041, 3067, 3089, 3449, 3607, 4013, 4057, 4079, 4211, 4217, 4273, 4507
Offset: 1

Views

Author

J. M. Bergot, Jun 27 2007

Keywords

Examples

			163 + (1+6+3) = 173, 163 + 1*6*3 = 181; 173 and 181 are prime numbers.
		

Crossrefs

Cf. A048519.

Programs

  • Maple
    filter:= proc(n) local S;
      S:= convert(n,base,10);
      isprime(n+convert(S,`+`)) and isprime(n+convert(S,`*`))
    end proc:
    A:= NULL:
    p:= 2:
    while p < 10000 do
      if filter(p) then A:= A, p fi;
      p:= nextprime(p)
    od:
    A; # Robert Israel, Jul 12 2017
  • Mathematica
    Select[Prime[Range[500]], PrimeQ[ # + Plus @@ IntegerDigits[ # ]] && PrimeQ[ # + Times @@ IntegerDigits[ # ]] &]
  • PARI
    isok(n) = isprime(n) && (isprime(n+sumdigits(n)) && ((d=digits(n)) && isprime(n+prod(k=1, #d, d[k])))); \\ Michel Marcus, Jul 12 2017

Extensions

Edited, corrected and extended by Stefan Steinerberger, Jul 14 2007