OFFSET
2,2
COMMENTS
See A002021 for further description of the problem.
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
T. D. Noe, Table of n, a(n) for n = 2..100
Anonymous, The Monkey and the Coconuts (with FormulaOne program)
Santo D'Agostino, “The Coconut Problem”; Updated With Solution, May 2011.
R. S. Underwood and Robert E. Moritz, Problem 3242, Amer. Math. Monthly, 35 (1928), 47-48.
MAPLE
f := proc(n) if n mod 2 = 1 then RETURN((n-1)^n-(n-1)) else RETURN((n-1)^(n+1)-(n-1)) fi; end:
MATHEMATICA
Rest[Table[If[OddQ[n], (n-1)^n-(n-1), (n-1)^(n+1)-(n-1)], {n, 30}]] (* Harvey P. Dale, Oct 21 2011 *)
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Formula and more terms from James A. Sellers, Feb 10 2000
Detail added to the name by Peter Munn, Jun 16 2023
STATUS
approved