Results 1 to 4 of 4
Thread: Java EKG program
- 07-12-2012, 03:40 AM #1
Member
- Join Date
- Jul 2012
- Posts
- 2
- Rep Power
- 0
Java EKG program
I am having trouble starting a program to compute the ekg. can anyone help
• Every number after that is the smallest number that is not in the sequence, and shares a factor larger than 1 with the last number
The first 10 numbers in the EKG sequence are
1,2,4,6,3,9,12,8,10,5
The program you turn in is to read in an integer n and compute and print the first n terms in the EKG sequence.
Your program should also include a function (or method) to compute GCD using Euclid’s algorithm (which is found on page 4 of your book). You are to use this function to determine if a candidate shares a factor larger than 1 with the last number in the sequence.
- 07-12-2012, 10:21 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
Re: Java EKG program
Are the numbers 1 and 2 supposed to be the first two numbers in that sequence by definition?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-12-2012, 02:34 PM #3
Member
- Join Date
- Jul 2012
- Posts
- 2
- Rep Power
- 0
- 07-12-2012, 04:28 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Call one Java Program from another Java Program
By rajpalparyani in forum New To JavaReplies: 3Last Post: 02-14-2011, 04:13 AM -
Is There A Way To Call Another Java Program Within A Java Program
By SwissR in forum New To JavaReplies: 4Last Post: 07-30-2010, 12:25 PM -
execute java program within java program
By popey in forum New To JavaReplies: 2Last Post: 10-22-2009, 05:32 PM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks