OFFSET
1,1
LINKS
Alois P. Heinz, Chai Wah Wu and Christian Perfect Table of n, a(n) for n = 1..5000 (Terms 1..100 by Alois P. Heinz; terms 101..137 by Chai Wah Wu; terms 138..5000 by Christian Perfect)
Popular Computing (Calabasas, CA), Contest 15: Coding Fun and Profit: Rearranging All The Numbers, Vol. 5 (#57, Dec 1977), page PC57-2.
Popular Computing (Calabasas, CA), Contest 15: Coding Fun and Profit: Rearranging All The Numbers, Vol. 5 (#57, Dec 1977), page PC57-1 (front cover).
PROG
(Python)
def flip(i, n):
..m = i%n
..m2 = n-m-1
..return i-m+m2
.
def revert(i, moves):
..for move, leader in reversed(moves):
....if i==leader-1:
......i=0
....else:
......i+=1
....
....i = flip(i, move)
..return i+3
.
def a256961():
..moves = []
..while True:
....move = revert(0, moves)
....leader = revert(move-1, moves)
....out = revert(flip(leader, move), moves)
....yield out
....moves.append((move, leader))
# Christian Perfect, Apr 20 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 15 2015
EXTENSIONS
More terms from Alois P. Heinz, Apr 16 2015
More terms from Christian Perfect, Apr 20 2015
STATUS
approved