cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A002022 In the pile of coconuts problem, the number of coconuts that remain to be shared equally at the end of the process.

This page as a plain text file.
%I A002022 M4305 N1800 #36 Jul 02 2025 16:01:54
%S A002022 0,6,240,1020,78120,279930,40353600,134217720,31381059600,99999999990,
%T A002022 34522712143920,106993205379060,51185893014090744,155568095557812210,
%U A002022 98526125335693359360,295147905179352825840,239072435685151324847136
%N A002022 In the pile of coconuts problem, the number of coconuts that remain to be shared equally at the end of the process.
%C A002022 See A002021 for further description of the problem.
%D A002022 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A002022 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A002022 T. D. Noe, <a href="/A002022/b002022.txt">Table of n, a(n) for n = 2..100</a>
%H A002022 Anonymous, <a href="http://www.f1compiler.com/samples/Sailors%20Monkey%20Coconuts.f1.html">The Monkey and the Coconuts</a> (with FormulaOne program)
%H A002022 Santo D'Agostino, <a href="https://fomap.org/2011/05/13/the-coconut-problem/">"The Coconut Problem"; Updated With Solution</a>, May 2011.
%H A002022 R. S. Underwood and Robert E. Moritz, <a href="http://www.jstor.org/stable/2298601">Problem 3242</a>, Amer. Math. Monthly, 35 (1928), 47-48.
%p A002022 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:
%t A002022 Rest[Table[If[OddQ[n],(n-1)^n-(n-1),(n-1)^(n+1)-(n-1)],{n,30}]] (* _Harvey P. Dale_, Oct 21 2011 *)
%Y A002022 Cf. A002021, A006091.
%K A002022 nonn,easy,nice
%O A002022 2,2
%A A002022 _N. J. A. Sloane_
%E A002022 Formula and more terms from _James Sellers_, Feb 10 2000
%E A002022 Detail added to the name by _Peter Munn_, Jun 16 2023