Results 1 to 6 of 6

Thread: What equation (sequence) would resolve any number into either odd or even?

  1. #1
    Join Date
    Jun 2007
    Posts
    1

    Default What equation (sequence) would resolve any number into either odd or even?

    Hello all,I'm having trouble trying to figure out an equation that will categorize any number to either zero (for even numbers) and one (for odd numbers). For example:0 = 0 (even)1 = 1 (odd)2 = 0 (even)3 = 1 (odd)4 = 0 (even)5 = 1 (odd)6 = 0 (even)7 = 1 (odd)Any help would be much appreciated. Thanks!

  2. #2
    Join Date
    Jun 2007
    Posts
    1

    Default

    Well the typical way is to define a function that has two possible values. i.e.f(x) = 0 (for all x even)f(x) = 1 (for all x odd)This is a perfectly valid function.

  3. #3
    Join Date
    Jun 2007
    Posts
    1

    Default

    well if you take the square root of the even or odd number than the even number will be a whole number or irrational number if you know what i am saying you would know.

  4. #4
    Join Date
    Jun 2007
    Posts
    1

    Default

    The sequence a_n = (1 - (-1)^n)/2 does the job. Just check

  5. #5
    Join Date
    Jun 2007
    Posts
    3

    Default

    With the exception of zero, X-(X+1) would work. Zero would end up being odd even though it is neither odd nor even.

  6. #6
    Join Date
    Jun 2007
    Posts
    1

    Default

    n is even if and only if (-1)^n = 1 help, or no?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •