Problem functions

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.
Could you show the recursive version?
Topic archived. No new replies allowed.