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-5 of 5 results.

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

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

Original entry on oeis.org

0, 6, 240, 1020, 78120, 279930, 40353600, 134217720, 31381059600, 99999999990, 34522712143920, 106993205379060, 51185893014090744, 155568095557812210, 98526125335693359360, 295147905179352825840, 239072435685151324847136
Offset: 2

Views

Author

Keywords

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

Crossrefs

Programs

  • 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 *)

Extensions

Formula and more terms from James Sellers, Feb 10 2000
Detail added to the name by Peter Munn, Jun 16 2023

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

A276135 Ben Ames Williams's Monkey and Coconuts Problem.

Original entry on oeis.org

0, 0, 1, 20, 51, 2604, 6665, 720600, 1864135, 348678440, 909090909, 261535698060, 685853880635, 281241170407092, 740800455037201, 410525522232055664, 1085102592571150095, 781282469559318055056, 2070863582910344082917, 1879498672877297909667780, 4993219047619047619047619, 5577014881186619679500164220
Offset: 1

Views

Author

Mark Richardson, Aug 21 2016

Keywords

Comments

In Ben Ames Williams's coconuts problem, a pile of coconuts remains the next day that is divisible by n sailors. Integers in the sequence multiplied by (n^2)-n determine the size of the divisible pile.

Crossrefs

Programs

  • Magma
    [((n-1)^(n-1 div 2 +(-1)^n div 2)-1) div n: n in [1..25]]; // Vincenzo Librandi, May 15 2019
  • Maple
    seq(((n-1)^(n-1/2+(-1)^n/2)-1)/n,n=1..30); # Robert Israel, Aug 26 2016
  • Mathematica
    Join[{0}, Table[((n - 1)^(n - 1/2 + (-1)^n/2) - 1)/n, {n, 2, 30}]] (* Bruno Berselli, Aug 26 2016 *)
  • PARI
    a(n) = ((n-1)^(n-1/2+(-1)^n/2)-1)/n \\ Felix Fröhlich, Aug 26 2016
    

Formula

a(n) = ((n-1)^(n-1) - 1)/n, if n is odd.
a(n) = ((n-1)^n - 1)/n, if n is even.
a(n) = ((n-1)^(n - 1/2 + (-1)^n/2) - 1)/n = (n^A052928(n) - 1)/n. - Omar E. Pol, Aug 24 2016

A351331 a(n) = (n+1)*(n^n) - n + 1.

Original entry on oeis.org

2, 11, 106, 1277, 18746, 326587, 6588338, 150994937, 3874204882, 109999999991, 3423740047322, 115909305827317, 4240251492291530, 166680102383370227, 7006302246093749986, 313594649253062377457, 14890324713954061755170, 747581753430634213933039, 39568393113206271782479562
Offset: 1

Views

Author

Adam Thornton, Feb 07 2022

Keywords

Comments

Arises in studying the "Pile of pairs of coconuts (and pals)" problem.
Motivated by a question passed along by Timothy Hunt from Kara Goeke; it is a generalization of the exercise in the first reference, which asks for a solution for n=3. For odd-indexed terms, the index may be taken as the number of participants in the circle. (The game doesn't work for even numbers of participants.)
In the case in the exercise: there are three participants splitting a box of chocolates whose number is even. The first person takes one, notes that the remainder is divisible by three, takes 1/3 of the remaining chocolates, passes the remainder to the second person, who takes one, notes that the remainder is divisible by three, takes 1/3 of the remaining chocolates, and passes the remainder to the last person, who takes one, notes that the remainder is divisible by three, and takes 1/3 of the remainder. The number of chocolates remaining after this last division are once again divisible by three.
The generalization that this sequence solves is that there are any odd number of people n in the circle, and that they each take 1/n of the remainder after taking their initial single item; the final number left is divisible by n as well.
The "Pals" part is that although this only represents solutions to the problem for an odd number of participants, the formula that generates those solutions is perfectly well-behaved for even n as well, and those may as well be terms in the sequence.
This is the same basic problem as A002021, with the further constraint that the initial number of coconuts be even.

References

  • Mark Dugopolski, College Algebra, Addison-Wesley, 1995, page 16, exercise 123.

Crossrefs

Cf. A002021.

Programs

  • Maple
    seq((n+1)*(n^n)-n+1, n=1..19); # Georg Fischer, Apr 10 2024

Extensions

Definition corrected by Georg Fischer, Apr 10 2024
Showing 1-5 of 5 results.