[math-fun] What is the period of this integer sequence?
0, 1, 7, -2, -8, 3, 14, -4, -16, 5, 21, -6, -24, 7, 28, -7, -25, 7, 27, -7, -26, 7, 26, -6, -19, 5, 18, -4, -12, 3, 10, -2, -5, 1, 2, 0, 2, -1, -6, 3, 16, -5, -22, 7, 30, -8, -30, 8, 30, -7, -23, 6, 22, -5, -16, 4, 14, -3, -9, 2, 6, -1, -2, 1, 5, -1, -3, 1, 4, -1, ... a[0] = 0; a[1] = 1; a[k_?OddQ] := a[k] = a[k - 2] - Floor[9*a[k - 1]/17]; a[k_?EvenQ] := a[k] = a[k - 2] + Floor[15*a[k - 1]/2] This is the "Minsky Stock Index" that Corey and Julian ran fruitlessly from a[-10^14] to a[10^14] a few years ago. "If you haven't looked at a problem in the last few years, you haven't looked at it." --Ed Pegg, Jr. There is a slight chance that the period is infinite. (When it reached 18 trillion, we exclaimed AT&T!) The above recursive definition crashes Mathematica in under a million, even with memoizing. Instead use the iteration In[115]:= NestList[Function[xy, {#, xy[[2]] + Floor[15*#/2]} & [xy[[1]] - Floor[9*xy[[2]]/17]]], {1, 0}, 35] e.g., for {a[-1],a[0}, {a[1],a[2]},...{a[69],a[70]} Out[115]= {{1, 0}, {1, 7}, ..., {-1, -4}} Background: http://www.blurb.com/books/2172660-minskys-trinskys-3rd-edition Unlike Collatz or twin prime searching, this is a very specific question about very specific quantities, rather than a question about the infinitude of integers. --rwg
Very nice pics in the book! (Neckties? T-shirts? Bedspreads? Wallpaper? Um, maybe not wallpaper ...) WFL On 5/4/14, Bill Gosper <billgosper@gmail.com> wrote:
0, 1, 7, -2, -8, 3, 14, -4, -16, 5, 21, -6, -24, 7, 28, -7, -25, 7, 27, -7, -26, 7, 26, -6, -19, 5, 18, -4, -12, 3, 10, -2, -5, 1, 2, 0, 2, -1, -6, 3, 16, -5, -22, 7, 30, -8, -30, 8, 30, -7, -23, 6, 22, -5, -16, 4, 14, -3, -9, 2, 6, -1, -2, 1, 5, -1, -3, 1, 4, -1, ...
a[0] = 0; a[1] = 1; a[k_?OddQ] := a[k] = a[k - 2] - Floor[9*a[k - 1]/17]; a[k_?EvenQ] := a[k] = a[k - 2] + Floor[15*a[k - 1]/2]
This is the "Minsky Stock Index" that Corey and Julian ran fruitlessly from a[-10^14] to a[10^14] a few years ago. "If you haven't looked at a problem in the last few years, you haven't looked at it." --Ed Pegg, Jr. There is a slight chance that the period is infinite. (When it reached 18 trillion, we exclaimed AT&T!)
The above recursive definition crashes Mathematica in under a million, even with memoizing. Instead use the iteration In[115]:= NestList[Function[xy, {#, xy[[2]] + Floor[15*#/2]} & [xy[[1]] - Floor[9*xy[[2]]/17]]], {1, 0}, 35] e.g., for {a[-1],a[0}, {a[1],a[2]},...{a[69],a[70]} Out[115]= {{1, 0}, {1, 7}, ..., {-1, -4}}
Background: http://www.blurb.com/books/2172660-minskys-trinskys-3rd-edition Unlike Collatz or twin prime searching, this is a very specific question about very specific quantities, rather than a question about the infinitude of integers. --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (2)
-
Bill Gosper -
Fred Lunnon