A173964 Sequence derived from a memorization technique.
1, 2, 1, 2, 3, 2, 3, 1, 2, 3, 4, 3, 4, 2, 3, 4, 1, 2, 3, 4, 5, 4, 5, 3, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 5, 6, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 6, 7, 5, 6, 7, 4, 5, 6, 7, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8
Offset: 1
Keywords
Links
- Andrew Woods, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a173964 n = a173964_list !! (n-1) a173964_list = concat $ [1] : f [[1]] where f xss = yss ++ f yss where yss = [y] : map (++ [y]) xss y = head (head xss) + 1 -- Reinhard Zumkeller, Nov 16 2013
-
Maple
S := n -> (1/6)*n*(n+1)*(n+2): invS := n -> ceil((1/3)*(81*n+3*sqrt(-3+729*n^2))^(1/3)+1/(81*n+3*sqrt(-3+729*n^2))^(1/3)-1): A := n -> (1/2)*n*(n+1): invA := n -> floor(-1/2+(1/2)*sqrt(1+8*n)): A173964 := n -> invS(n)-invA(n-1-S(invS(n)-1))+n-1-S(invS(n)-1)-A(invA(n-1-S(invS(n)-1)));
Comments