%I #14 Jun 20 2017 22:36:41
%S 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,
%T 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,
%U 5,6,7,2,3,4,5,6,7,1,2,3,4,5,6,7,8
%N Sequence derived from a memorization technique.
%C To memorize a poem composed of several verses, the following technique can be used. -Memorize verse 1. -Memorize verse 2. -Memorize (revise) verse 1, and then verse 2. -Memorize verse 3. -Memorize (revise) verse 2, and then verse 3. -Memorize (revise) verse 1, then verse 2, and then verse 3. -Memorize verse 4. -Memorize (revise) verse 3, and then verse 4. -Memorize (revise) verse 2, then verse 3, and then verse 4. -Memorize (revise) verse 1, then verse 2, then verse 3, and then verse 4. Etc. Listing down the verses in the order they are memorized or revised gives the sequence.
%C The sequence is self-similar: striking out the n first occurrences of each integer n gives the initial sequence.
%C The sequence can be created by writing down the strings 12, 123, 1234, 12345, etc, on separate rows, and then following each string with its last substring of length 2, then last substring of length 3, last substring of length 4, etc, stopping before the whole string is repeated. - _Andrew Woods_, Aug 03 2011
%C The first appearance of n >= 1 is at a(1+(n-1)*n*(n+1)/6). - _Andrew Woods_, Aug 03 2011
%C For n > 1: a(A000292(n)+1) = n.
%H Andrew Woods, <a href="/A173964/b173964.txt">Table of n, a(n) for n = 1..10000</a>
%p 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):
%p A := n -> (1/2)*n*(n+1): invA := n -> floor(-1/2+(1/2)*sqrt(1+8*n)):
%p 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)));
%o (Haskell)
%o a173964 n = a173964_list !! (n-1)
%o a173964_list = concat $ [1] : f [[1]] where
%o f xss = yss ++ f yss where
%o yss = [y] : map (++ [y]) xss
%o y = head (head xss) + 1
%o -- _Reinhard Zumkeller_, Nov 16 2013
%K nonn
%O 1,2
%A Ibrahima Faye (ifaye2001(AT)yahoo.fr), Feb 22 2010