Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Prime Time for an Obfuscation

by liverpole (Monsignor)
on Apr 16, 2007 at 03:07 UTC ( #610251=obfuscated: print w/replies, xml ) Need Help??

With all the prime number fun going on over here, now seems a good chance to dust off and present an obfuscation that just needed a little polishing up.

Given a positive integer argument, this program will display all of its prime factors.

$;=pop;{$.= 0;map{$;%$_ or$.||=$_}2 ..sqrt$;;;+ $.||die$;-j .$/;warn$.. $/;$;/=$.;n until+redo}


Replies are listed 'Best First'.
Re: Prime Time for an Obfuscation
by wulvrine (Friar) on Apr 16, 2007 at 12:24 UTC
    Great job!! ++
    Fun to play with putting in numbers like birthdays etc lol :)
    As always, you are the master of obfu's

    s&&VALKYRIE &&& print $_^q|!4 =+;' *|
Re: Prime Time for an Obfuscation
by Ray Smith (Beadle) on Apr 16, 2007 at 12:22 UTC
    Nice job - as usual!
Re: Prime Time for an Obfuscation
by Anonymous Monk on Jul 29, 2007 at 23:49 UTC
    Did someone have trouble running it against this number: 1234567890123111? 5.8.8 on MSWin32

      It tries to create a list containing 2..sqrt(1234567890123111). So it starts to allocate 33.5M entries, taking a long time to spin as much RAM into place as it can, before it (I presume) dies (having caused way too much other stuff to swap out). Is that what you mean by "problem"? :)

      - tye        

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://610251]
Approved by bobf
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-10-18 22:57 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (251 votes). Check out past polls.