[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A030079
Primes p such that digits of p appear in p^2.
2
5, 11, 101, 139, 199, 211, 277, 421, 463, 499, 503, 509, 523, 593, 601, 631, 661, 733, 757, 887, 911, 991, 1021, 1091, 1117, 1163, 1171, 1193, 1201, 1277, 1319, 1451, 1523, 1601, 1621, 1627, 1777, 1783, 1999, 2011, 2027, 2111, 2161, 2203
OFFSET
1,1
LINKS
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
Sequence in context: A224270 A123025 A053778 * A066596 A199325 A199305
KEYWORD
nonn,base,nice
STATUS
approved