Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Principia Mathematica

 
 
Thread Tools Display Modes

 
Weird prime tests
Reply
Posted 2024-12-24, 08:39 PM
What's your strangest way to check if a number is prime? Here's a Python one using regex:

Code:
import re
def is_prime(n):
    return not re.match(r"^.?$|^(..+?)\1+$","\0"*n)
"Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram
Old
Profile PM WWW Search
Chruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed it
 
 
Chruser
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
This forum is so fucking weird now. D3V The Lounge 124 2009-08-05 11:04 AM
[GameCube] Metroid Prime 2 - Echoes Raziel General Gaming 0 2005-02-10 03:00 AM
Games: Metroid Prime Raziel Science and Art 2 2004-11-12 05:16 PM
All Test's = Passed carbon Forum News, Suggestions and Discussion 1 2002-02-04 02:23 PM


All times are GMT -6. The time now is 07:34 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.