Problem
of the
Week

PROBLEM 170

A positive integer is called a digital prime, a dip for short, if each of its digits is prime, each pair of consecutive digits is prime, each triple of consecutive digits is prime, and so on.  For instance, the number 137 is almost a dip --- 137 is prime, 13 and 37 are prime, 3 and 7 are prime, but, sadly, the number 1 isn't prime.  (Remember that a positive integer is prime if it's greater than 1 and divisible by no positive integer other than 1 and itself.)   

(a)  Find all the dips.  
(b)  Find all the dips, allowing 1 to be used as a digit.

You are visitor number 5971 to this page.
ã2003 Alberto L. Delgado