The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A068492 Primes that remain prime after each digit is replaced by its square. 6
11, 13, 17, 19, 71, 73, 89, 101, 103, 107, 131, 137, 149, 167, 173, 191, 197, 199, 223, 229, 233, 283, 307, 311, 313, 331, 337, 359, 383, 401, 433, 439, 461, 463, 491, 523, 569, 593, 631, 641, 647, 659, 709, 733, 743, 773, 809, 823, 859, 907, 911, 919, 947 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (n = 1..785 from Zak Seidov)
EXAMPLE
When each digit of the prime 89 is replaced by its square, 6481, a prime, results. Hence 89 is a term of the sequence.
MATHEMATICA
f[n_] := Block[{a = IntegerDigits[n], b = "", k = 1, l}, l = Length[a]; While[k < l + 1, b = StringJoin[b, ToString[a[[k]]^2]]; k++ ]; ToExpression[b]]; Do[ If[ PrimeQ[ f[ Prime[n]]], Print[ Prime[n]]], {n, 1, 150} ]
Select[Prime[Range[200]], PrimeQ[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[#]^2)]]]&] (* Harvey P. Dale, Dec 31 2023 *)
PROG
(Magma) DigitsSquared:=func< n | StringToInteger(&cat[ IntegerToString(a): a in Reverse([ d^2: d in Intseq(n) ]) ]) >; IsA068492:=func< p | IsPrime(DigitsSquared(p)) >; [ p: p in PrimesUpTo(1000) | IsA068492(p) ]; // Klaus Brockhaus, Mar 05 2011
(PARI)
digsquare(n)={fromdigits(concat(apply(d->if(d, digits(d^2), [0]), digits(n))))}
ok(n)={isprime(n)&&isprime(digsquare(n))} \\ Andrew Howroyd, Feb 27 2018
(Python)
from sympy import isprime, nextprime
n = 2
while n < 8000:
t = int(''.join(str(int(i)**2) for i in list(str(n))))
if isprime(t):
print(n)
n = nextprime(n)
# Abhiram R Devesh, Feb 09 2015
CROSSREFS
Sequence in context: A132244 A262731 A087201 * A206287 A306661 A045707
KEYWORD
base,nonn
AUTHOR
Joseph L. Pe, Mar 11 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Mar 19 2002
Duplicate a(1)-a(215) removed from b-file by Andrew Howroyd, Feb 27 2018
STATUS
approved

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 June 10 01:53 EDT 2024. Contains 373251 sequences. (Running on oeis4.)