cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A068492 Primes that remain prime after each digit is replaced by its square.

This page as a plain text file.
%I A068492 #37 Sep 07 2025 00:42:52
%S A068492 11,13,17,19,71,73,89,101,103,107,131,137,149,167,173,191,197,199,223,
%T A068492 229,233,283,307,311,313,331,337,359,383,401,433,439,461,463,491,523,
%U A068492 569,593,631,641,647,659,709,733,743,773,809,823,859,907,911,919,947
%N A068492 Primes that remain prime after each digit is replaced by its square.
%H A068492 Chai Wah Wu, <a href="/A068492/b068492.txt">Table of n, a(n) for n = 1..10000</a> (n = 1..785 from Zak Seidov)
%e A068492 When each digit of the prime 89 is replaced by its square, 6481, a prime, results. Hence 89 is a term of the sequence.
%t A068492 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} ]
%t A068492 Select[Prime[Range[200]],PrimeQ[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[#]^2)]]]&] (* _Harvey P. Dale_, Dec 31 2023 *)
%o A068492 (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
%o A068492 (PARI)
%o A068492 digsquare(n)={fromdigits(concat(apply(d->if(d,digits(d^2),[0]),digits(n))))}
%o A068492 ok(n)={isprime(n)&&isprime(digsquare(n))} \\ _Andrew Howroyd_, Feb 27 2018
%o A068492 (Python)
%o A068492 from sympy import isprime, nextprime
%o A068492 n = 2
%o A068492 while n < 8000:
%o A068492     t = int(''.join(str(int(i)**2) for i in list(str(n))))
%o A068492     if isprime(t):
%o A068492         print(n)
%o A068492     n = nextprime(n)
%o A068492 # _Abhiram R Devesh_, Feb 09 2015
%K A068492 base,nonn,changed
%O A068492 1,1
%A A068492 _Joseph L. Pe_, Mar 11 2002
%E A068492 Edited and extended by _Robert G. Wilson v_, Mar 19 2002
%E A068492 Duplicate a(1)-a(215) removed from b-file by _Andrew Howroyd_, Feb 27 2018