login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A030091 Primes such that p and p^2 have same set of digits. 2

%I #19 Nov 21 2013 12:46:28

%S 94583,100469,102953,107251,110923,184903,279863,285101,406951,459521,

%T 493621,499423,504821,684581,752681,758141,758941,786431,836291,

%U 843701,928637,976513,980261,1008947,1009859,1024399,1029647

%N Primes such that p and p^2 have same set of digits.

%H Reinhard Zumkeller, <a href="/A030091/b030091.txt">Table of n, a(n) for n = 1..1000</a>

%F Equals A000040 INTERSECTION A029793. - _Jonathan Vos Post_, Jul 06 2008

%t Select[Prime[Range[82000]],Union[IntegerDigits[#]]== Union[ IntegerDigits [#^2]]&] (* _Harvey P. Dale_, Aug 12 2011 *)

%o (PARI) isA030091(n)=isprime(n)&&Set(Vec(Str(n)))==Set(Vec(Str(n^2))) \\ _Charles R Greathouse IV_, Jun 28 2011

%o (Haskell)

%o import Data.List (nub, sort)

%o import Data.Function (on)

%o a030091 n = a030091_list !! (n-1)

%o a030091_list =

%o filter (\x -> ((==) `on` (nub . sort . show)) x (x^2)) a000040_list

%o -- _Reinhard Zumkeller_, Aug 11 2011

%Y Cf. A000040, A029793.

%K nonn,base,nice

%O 1,1

%A _Patrick De Geest_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:35 EDT 2024. Contains 371967 sequences. (Running on oeis4.)