Results 1 to 3 of 3

Thread: Looking for a function

  1. #1

    Looking for a function

    I want a mathematical function (floor/ceiling etc. are fine but not piecewise) which does the following:
    If the input is odd, just return that number i.e f(2n+1) = 2n+1
    If the input is even return the odd number one less than it i.e f(2n) = 2n-1

    So for example f(4)=3, f(3)=3

  2. #2
    Elite Member
    Join Date
    Sep 2012
    Posts
    3,129
    Quote Originally Posted by Mr_Random_Guy View Post
    I want a mathematical function (floor/ceiling etc. are fine but not piecewise) which does the following:
    If the input is odd, just return that number i.e f(2n+1) = 2n+1
    If the input is even return the odd number one less than it i.e f(2n) = 2n-1

    So for example f(4)=3, f(3)=3
    Did you read our guidelines at

    https://www.freemathhelp.com/forum/t...l=1#post433156

    If not, please do so and give us some clues about your course and your mathematical background.

    Hint: [tex]n \in \mathbb Z \implies n - 2 * \left \lfloor \dfrac{n}{2} \right \rfloor = \text {WHAT?}.[/tex]

    EDIT: This question came up in pre-algebra? That is where it is posted!
    Last edited by JeffM; 01-05-2019 at 09:35 AM.

  3. #3
    No I hadn't, thank you. Am in college, although this question is entirely unrelated to anything I'm currently doing. Thanks for the hint, got it.

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
  •