OFFSET
1,2
COMMENTS
This sequence is infinite. With any number a(n), you can add infinitely many 1's to its decimal representation. E.g., 82 is in this sequence, so 821, 812, 1182, 18112, 81211, etc. are also terms of this sequence.
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..10000
EXAMPLE
(9*4) + 1 = 37 is prime and (9*4)^2 + 1 = 1297 is prime. Thus 94 is a term of this sequence.
MATHEMATICA
bpQ[n_]:=Module[{c=Times@@IntegerDigits[n]}, AllTrue[{c+1, c^2+1}, PrimeQ]]; Select[Range[300], bpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 09 2019 *)
PROG
(PARI) for(n=1, 10^3, d=digits(n); p=prod(i=1, #d, d[i]); if(ispseudoprime(p+1) && ispseudoprime(p^2 + 1), print1(n, ", ")))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Jul 12 2014
STATUS
approved