login
A061597
Numbers whose sum of digits s equals its product of digits and s + 1 and s - 1 are both prime.
1
4, 6, 22, 123, 132, 213, 231, 312, 321, 111126, 111162, 111216, 111261, 111612, 111621, 112116, 112161, 112611, 116112, 116121, 116211, 121116, 121161, 121611, 126111, 161112, 161121, 161211, 162111, 211116, 211161, 211611, 216111, 261111, 611112
OFFSET
1,1
LINKS
EXAMPLE
22 belong to the sequence because (2*2)+1=5, (2*2)-1=3, (2+2)+1=5, (2+2)-1=3 and 2+2=2*2.
PROG
(PARI) isok(k) = my(d=digits(k), s=vecsum(d)); s == vecprod(d) && isprime(s+1) && isprime(s-1) \\ Harry J. Smith, Jul 25 2009
CROSSREFS
Intersection of A034710 and A061596.
Sequence in context: A061595 A062940 A061596 * A075813 A107952 A004032
KEYWORD
nonn,base
AUTHOR
Felice Russo, May 22 2001
EXTENSIONS
4 and 6 added by Abdul Gaffar Khan, Nov 29 2015
STATUS
approved