Post Reply 
challenge - prime numbers where sum of squared digits of prime number is also prime
01-05-2018, 08:37 PM (This post was last modified: 01-05-2018 09:33 PM by Gilles59.)
Post: #10
RE: challenge - prime numbers where sum of squared digits of prime number is also prime
User RPL with ListExt Library (https://www.hpcalc.org/details/7971) :

Code:
 {} 1
 WHILE DUP 1000 < REPEAT
  NEXTPRIME DUP I->NL SQ LSUM ISPRIME? {SWAP OVER + SWAP} IFT
 END
 DROP

same results as Didier

"What is the largest prime less than 100,000 where this is true?"

Code:
 100000
 DO 
  PREVPRIME 
 UNTIL DUP I->NL SQ LSUM ISPRIME? END
-> 99971

For 1'000'000'000 -> 999'999'667
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: challenge - prime numbers where sum of squared digits of prime number is also prime - Gilles59 - 01-05-2018 08:37 PM



User(s) browsing this thread: 3 Guest(s)