The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Message from discussion today's puzzle

From:
To:
Cc:
Followup To:
Subject:
 Validation: For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon.

More options Oct 23 2012, 10:44 pm
Newsgroups: rec.puzzles
From: Ilan Mayer <ilan_no_s...@hotmail.com>
Date: Tue, 23 Oct 2012 19:44:03 -0700 (PDT)
Local: Tues, Oct 23 2012 10:44 pm
Subject: Re: today's puzzle

On Tuesday, October 23, 2012 5:02:47 PM UTC-4, PT wrote:
> g(n) is a function of any integer n, positive or negative, which

> produces an integer value, with conditions:

> a) g(g(n)) = n

> b) g(g(n + 2) + 2) = n

> c) g(0) = 1

> 1. Determine g(n)

> 2. Prove your solution is unique.

> ---

> Paul T.

SPOILER

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

The function is g(n) = 1 - n

It satisfy all three requirements by inspection.

Proof of uniqueness by induction:

Since g(0) = 1, g(g(0)) = g(1) = 0 (from a and c).

Assuming that g(n) = 1 - n for n = 1, 0, ..., m where m is a negative integer:

g(g(m + 1) + 2) = m - 1 (from b)
Since g(m + 1) = 1 - ( m + 1 ) = -m, g(2 - m) = m - 1
g(m - 1) = g(g(2 - m)) = 2 - m = 1 - (m - 1) (from a)

This proves that g(n) = 1 - n for any negative n.

For positive n >= 2 g(1 - n) = 1 - ( 1 - n ) = n since 1 - n is negative.
Now g(n) = g(g(1 - n) = 1 - n (from a).

__/\__
\    /
__/\\  //\__  Ilan Mayer
\          /