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.

Showing 1-3 of 3 results.

A002021 Pile of coconuts problem: (n-1)*(n^n - 1), n even; n^n - n + 1, n odd.

Original entry on oeis.org

1, 3, 25, 765, 3121, 233275, 823537, 117440505, 387420481, 89999999991, 285311670601, 98077104930805, 302875106592241, 144456088732254195, 437893890380859361, 276701161105643274225, 827240261886336764161, 668888937280041138782191, 1978419655660313589123961
Offset: 1

Views

Author

Keywords

Comments

This is a generalization (from n = 5) of Ben Ames Williams's published problem. For a given n, the problem is effectively as follows. A successful monkey-share process removes 1 coconut for a monkey followed by an exact share of 1/n from the coconut pile. Determine the least initial number of coconuts for a monkey-share to succeed n times, leaving a multiple of n to be shared equally at the end. The problem in the D'Agostino link is slightly different, requiring a coconut for the monkey in the final division. - Peter Munn, Jun 14 2023

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).

Crossrefs

Programs

  • Maple
    seq(`if`(n::even, (n-1)*(n^n - 1),n^n-n+1),n=1..30); # Robert Israel, Aug 26 2016
  • Mathematica
    Table[If[EvenQ[n],(n-1)(n^n-1),n^n-n+1],{n,30}] (* Harvey P. Dale, Apr 21 2012 *)
  • Python
    def a(n): return (n-1)*(n**n - 1) if n%2 == 0 else n**n - n + 1
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Feb 07 2022

Formula

E.g.f.: (1-x)*exp(x)-(W(x)+2)*(2*W(x)+1)/(2*(1+W(x))^3)-W(-x)/(2*(1+W(-x))^3) where W is the Lambert W function. - Robert Israel, Aug 26 2016
a(n) = 1-n-(-n)^n+(1+(-1)^n)*n^(n+1)/2. - Wesley Ivan Hurt, Nov 09 2023

Extensions

More terms from Harvey P. Dale, Apr 21 2012

A006091 a(n) = n^n - n + 1.

Original entry on oeis.org

1, 3, 25, 253, 3121, 46651, 823537, 16777209, 387420481, 9999999991, 285311670601, 8916100448245, 302875106592241, 11112006825558003, 437893890380859361, 18446744073709551601, 827240261886336764161, 39346408075296537575407, 1978419655660313589123961
Offset: 1

Views

Author

Keywords

Comments

Related to famous "coconuts" problem - cf. A002021, A002022.

References

  • Archimedeans Problems Drive, Eureka, 41 (1981), 7.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A014293.

Programs

Formula

E.g.f.: 1/(1 + LambertW(-x)) + exp(x)*(1 - x) - 2. - Ilya Gutkovskiy, Oct 30 2017

A254029 Positive solutions of Monkey and Coconuts Problem for the classic case (5 sailors, 1 coconut to the monkey): a(n) = 15625*n - 4 for n >= 1.

Original entry on oeis.org

15621, 31246, 46871, 62496, 78121, 93746, 109371, 124996, 140621, 156246, 171871, 187496, 203121, 218746, 234371, 249996, 265621, 281246, 296871, 312496, 328121, 343746, 359371, 374996, 390621, 406246, 421871, 437496, 453121, 468746
Offset: 1

Views

Author

Luciano Ancora, Mar 14 2015

Keywords

Comments

References

  • Charles S. Ogilvy and John T. Anderson, Excursions in Number Theory, Oxford University Press, 1966, pages 52-54.
  • Miodrag S. Petković, "The sailors, the coconuts, and the monkey", Famous Puzzles of Great Mathematicians, Amer. Math. Soc.(AMS), 2009, pages 52-56.

Crossrefs

Programs

  • Mathematica
    s = 5; c = 1; Table[n s^(s + 1) - c (s - 1), {n, 1, 30}] (* or *)
    CoefficientList[Series[(15621 + 4 x)/(-1 + x)^2, {x, 0, 29}], x]

Formula

G.f.: x*(15621 + 4*x)/(1 - x)^2.
a(n) = 2*a(n-1) - a(n-2) = a(n-1) + 15625, with a(0) = -4 and a(-1) = -(4 + 5^6). a(n) = 5^6*n - 4.
a(n) = (15*c(n) + 11) + 265*(c(n) + 1)/2^10, with c(n) = A158421(n) = 2^10*n - 1, for n >= 1. - Richard S. Fischer and Wolfdieter Lang, Jun 01 2023
Showing 1-3 of 3 results.