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.

This page as a plain text file.
%I A128717 #10 Jul 12 2017 03:22:07
%S A128717 101,103,163,233,293,307,431,499,509,563,617,701,743,1009,1049,1061,
%T A128717 1087,1409,1423,1483,1489,1601,1607,1801,1867,2017,2039,2053,2273,
%U A128717 2543,2633,2903,3041,3067,3089,3449,3607,4013,4057,4079,4211,4217,4273,4507
%N A128717 Primes that yield another prime if one adds either the sum of its digits or the product of its digits.
%H A128717 Robert Israel, <a href="/A128717/b128717.txt">Table of n, a(n) for n = 1..10000</a>
%e A128717 163 + (1+6+3) = 173, 163 + 1*6*3 = 181; 173 and 181 are prime numbers.
%p A128717 filter:= proc(n) local S;
%p A128717   S:= convert(n,base,10);
%p A128717   isprime(n+convert(S,`+`)) and isprime(n+convert(S,`*`))
%p A128717 end proc:
%p A128717 A:= NULL:
%p A128717 p:= 2:
%p A128717 while p < 10000 do
%p A128717   if filter(p) then A:= A, p fi;
%p A128717   p:= nextprime(p)
%p A128717 od:
%p A128717 A; # _Robert Israel_, Jul 12 2017
%t A128717 Select[Prime[Range[500]], PrimeQ[ # + Plus @@ IntegerDigits[ # ]] && PrimeQ[ # + Times @@ IntegerDigits[ # ]] &]
%o A128717 (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
%Y A128717 Cf. A048519.
%K A128717 base,easy,nonn
%O A128717 1,1
%A A128717 _J. M. Bergot_, Jun 27 2007
%E A128717 Edited, corrected and extended by _Stefan Steinerberger_, Jul 14 2007