|
|
A076039
|
|
Start with 1. Multiply or divide by n accordingly as a(n-1) is smaller or greater than n and then take the integer value (this is to ensure that a(n) > 0 for all n).
|
|
5
|
|
|
1, 2, 6, 1, 5, 30, 4, 32, 3, 30, 2, 24, 1, 14, 210, 13, 221, 12, 228, 11, 231, 10, 230, 9, 225, 8, 216, 7, 203, 6, 186, 5, 165, 4, 140, 3, 111, 2, 78, 1, 41, 1722, 40, 1760, 39, 1794, 38, 1824, 37, 1850, 36, 1872, 35, 1890, 34, 1904, 33, 1914, 32, 1920, 31, 1922, 30, 1920
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n*a(n-1) if a(n-1) < n, floor(a(n-1)/n) otherwise.
|
|
EXAMPLE
|
a(13) = 1 so a(14) = 14*1 = 14;
14 < 15 so a(15) = 14*15 = 210;
210 > 16 so a(16) = floor(210/16) = 13.
|
|
MATHEMATICA
|
next[{a_, b_}]:=Module[{c=a+1}, {c, If[b<c, b*c, Floor[b/c]]}]; Transpose[ NestList[next, {1, 1}, 65]][[2]] (* Harvey P. Dale, Oct 06 2011 *)
|
|
PROG
|
(Haskell)
a076039 n = a076039_list !! (n-1)
a076039_list = f 1 1 where
f n x = x' : f (n+1) x' where
x' = (if x < n then (*) else div) x n
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|