Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Calculate prime factors for a given numer in a perl one-liner

by kennethk (Abbot)
on Dec 15, 2010 at 18:03 UTC ( [id://877332]=note: print w/replies, xml ) Need Help??


in reply to Calculate prime factors for a given numer in a perl one-liner

I wouldn't say so. I just wrote one up that consisted of a single if-else in a while loop - no fancy special variables or built-ins. It seems to me that your current approach is overthinking the problem a bit. For example, there is no need to store the factors if the whole goal is outputting them, and my solution does not involve precomputing prime numbers.

Giving hints without giving solutions is hard.

  • Comment on Re: Calculate prime factors for a given numer in a perl one-liner

Replies are listed 'Best First'.
Re^2: Calculate prime factors for a given numer in a perl one-liner
by andmott (Acolyte) on Dec 15, 2010 at 18:07 UTC
    Thanks for the feedback and hint I appreciate it!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://877332]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-25 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found