OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
MATHEMATICA
ok[p_] := (idp = Union[ IntegerDigits[p]]; Intersection[idp, Union[ IntegerDigits[p^2]]] == idp); Select[ Prime[Range[400]], ok] (* Jean-François Alcover, Nov 30 2011 *)
Select[Prime[Range[400]], SubsetQ[IntegerDigits[#^2], IntegerDigits[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 23 2017 *)
PROG
(Haskell)
import Data.List (intersect, nub)
a030079 n = a030079_list !! (n-1)
a030079_list = filter f a000040_list where
f p = pd == pd `intersect` (nub $ show (p^2)) where
pd = nub $ show p
-- Reinhard Zumkeller, Nov 03 2011
CROSSREFS
KEYWORD
nonn,base,nice
AUTHOR
STATUS
approved