Problem functions

Apr 29, 2013 at 4:24pm
bn =
1 if n = 1
b(f) + b(c) + n if n ≥ 2,
where
• f means the floor of n
• c means the ceiling of n

it's quite simple to write a function that given n returns bn using recursion, or without recursion but using arrays, can it be done without using any array nor recursion? I'm really curious to know because I couldn't really think of any practical idea.
Thank you.
Apr 29, 2013 at 8:00pm
Could you show the recursive version?
Topic archived. No new replies allowed.