An identity for the finite sum ∑N 1 z qn−r is given. Related sums (or series) were studied by Scherk, Clausen, Ramanujan, Shanks, Andrews, and others. We use such identity to give new formulas for ∑∞ 1 z qn−r , the Riemann zeta function and the Euler–Mascheroni constant. An irrationality result is also proved.