473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

prime numbers

1 New Member
I need a program which can say the number (input)is prime and then write other prime numbers with that digits.
eg.for 13 print the number is prime and print 113( another prime num with that digits)
tanx a lot
Jun 7 '07 #1
11 2018
JosAH
11,448 Recognized Expert MVP
I need a program which can say the number (input)is prime and then write other prime numbers with that digits.
eg.for 13 print the number is prime and print 113( another prime num with that digits)
tanx a lot
Ok, start at the beginning: what makes a number a prime number?

kind regards,

Jos
Jun 7 '07 #2
r035198x
13,262 MVP
I need a program which can say the number (input)is prime and then write other prime numbers with that digits.
eg.for 13 print the number is prime and print 113( another prime num with that digits)
tanx a lot
You are going to have to write it yourself. We are here only to give you hints and point you in the right direction not help you cheat on your assignment.

Design your program first. You need a method, isPrime, which takes a number and returns true iff that number is prime ....
Jun 7 '07 #3
blazedaces
284 Contributor
I need a program which can say the number (input)is prime and then write other prime numbers with that digits.
eg.for 13 print the number is prime and print 113( another prime num with that digits)
tanx a lot
Shouldn't it be all numbers less then that one with those digits? I mean, theoretically there are infinitely many prime numbers, so when are you going to stop checking for them? The largest possible double?

-blazed
Jun 7 '07 #4
JosAH
11,448 Recognized Expert MVP
Shouldn't it be all numbers less then that one with those digits? I mean, theoretically there are infinitely many prime numbers, so when are you going to stop checking for them? The largest possible double?

-blazed
That's an interesting question: given the digits of a prime number, is the set
of all possible prime numbers given a rearrangement of those digits where the
digits can be used multiple times, finite or not? I don't know the answer to that.
I suspect infinity ...

kind regards,

Jos
Jun 7 '07 #5
r035198x
13,262 MVP
That's an interesting question: given the digits of a prime number, is the set
of all possible prime numbers given a rearrangement of those digits where the
digits can be used multiple times, finite or not? I don't know the answer to that.
I suspect infinity ...

kind regards,

Jos
I'd say it's an infinite set.

The fact that primes are infinite is disproved by assuming the maximum prime P and finding a prime greater than P. If that set were finite, then there would be a prime P that is the largest prime in that set (pigeon hole) and it would be possible to find an infinite amount of primes greater than that prime. My bet is that in those infinite primes, the'd be at least one that contains the digits in some order.
Jun 7 '07 #6
JosAH
11,448 Recognized Expert MVP
I'd say it's an infinite set.

The fact that primes are infinite is disproved by assuming the maximum prime P and finding a prime greater than P. If that set were finite, then there would be a prime P that is the largest prime in that set (pigeon hole) and it would be possible to find an infinite amount of primes greater than that prime. My bet is that in those infinite primes, the'd be at least one that contains the digits in some order.
That's my suspicion too bit it still isn't a proof; are there infinitely many primes
having just the single digit 2, 3, 5 or 7 in it? For the single digit primes there
aren't and that's a (lame) counter example. But how about more than one
unique digit primes? (like 17, 23 or whatever)

kind regards,

Jos
Jun 7 '07 #7
eutynem
3 New Member
how are you doing......Name is Jane

what is the easiest code that would give the following output....

Please enter two integers: 9 13

9: 3

10: 2 5

11: Prime

12: 2 3 4 6

13: Prime

There are 2 prime numbers.

The average value of the prime numbers is 12.00

Please enter two integers.

<email :removed>
Jun 20 '07 #8
r035198x
13,262 MVP
how are you doing......Name is Jane

what is the easiest code that would give the following output....

Please enter two integers: 9 13

9: 3

10: 2 5

11: Prime

12: 2 3 4 6

13: Prime

There are 2 prime numbers.

The average value of the prime numbers is 12.00

Please enter two integers.

<email :removed>
Please start your own thread for this and when you do so follow the guidelines.
Jun 20 '07 #9
JosAH
11,448 Recognized Expert MVP
how are you doing......Name is Jane

what is the easiest code that would give the following output....

Please enter two integers: 9 13

9: 3

10: 2 5

11: Prime

12: 2 3 4 6

13: Prime

There are 2 prime numbers.

The average value of the prime numbers is 12.00

Please enter two integers.

<email :removed>
I already answered your question here.

kind regards,

Jos
Jun 20 '07 #10
prometheuzz
197 Recognized Expert New Member
That's an interesting question: given the digits of a prime number, is the set
of all possible prime numbers given a rearrangement of those digits where the
digits can be used multiple times, finite or not? I don't know the answer to that.
I suspect infinity ...

kind regards,

Jos

From the number 2, no other prime can be constructed. Which of course goes for all single digit primes... Which I now read, is a lame counter example!
; )
Jun 20 '07 #11
JosAH
11,448 Recognized Expert MVP
From the number 2, no other prime can be constructed. Which of course goes for all single digit primes... Which I now read, is a lame counter example!
; )
Yep, totally lame; but what about two or more distinct digits that make up a
prime number? I haven't the faintest idea and I don't have enough spare time
on my hands to dig into it either. It'll always be a mystery as far as I am
concerned.

kind regards,

Jos ;-)
Jun 20 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

36
by: Dag | last post by:
Is there a python module that includes functions for working with prime numbers? I mainly need A function that returns the Nth prime number and that returns how many prime numbers are less than N,...
9
by: Greg Brunet | last post by:
In doing some testing of different but simple algorithms for getting a list of prime numbers, I ended up getting some results that seem a bit contradictory. Given the following test program...
11
by: don | last post by:
Ok, this is a homework assignment, but can you help me out anyway...... I need a routine for figuring out if a number inputted by the user is a prime number or not...... all I'm asking for is Not...
0
by: AshifToday | last post by:
this was my and my frineds little project in earlier classes, the program seperates the composite and prime numbers in two sections of the screen ===================== /* This program has...
0
by: ETM11871 | last post by:
i need to develop a code that finds a prime right number between 2 and 100000. and print one line of text that indicates if the int. is right prime. i am in beginning programing so complex is...
25
by: johnmsimon | last post by:
i need to develop a code that finds a prime right number between 2 and 100000. and print one line of text that indicates if the int. is right prime. i am in beginning programing so complex is...
60
by: rhle.freak | last post by:
Here is my code to generate prime numbers.It works absolutely fine when the range is *not very large*. However on initializing i with a large integer it produces erroneous results (some numbers...
7
by: newstips6706 | last post by:
1, 2, 3, 5, 7... PRIME Numbers ________________________________ Definitions What is a PRIME Number ?
7
by: Caffiend | last post by:
Well, I've been picking at learning python, got tired of reading, and figured I'd try to replicate my prime number generator I wrote (with much TSDN forum help) in C++. I've hit a stumbling block......
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.