login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A256961 Generated by a rearranging problem (see links for precise definition). 1

%I #35 Apr 20 2015 21:01:21

%S 6,5,26,14,16,9,11,30,4,92,31,64,28,44,46,22,52,126,256,197,230,110,

%T 125,13,21,196,336,684,462,632,852,1208,780,1278,544,796,520,8,3864,

%U 98,1782,5316,6372,7714,7274,3818,4254,9046,6412,2168,2856,2148,1206,3246

%N Generated by a rearranging problem (see links for precise definition).

%H Alois P. Heinz, Chai Wah Wu and Christian Perfect <a href="/A256961/b256961.txt">Table of n, a(n) for n = 1..5000</a> (Terms 1..100 by Alois P. Heinz; terms 101..137 by Chai Wah Wu; terms 138..5000 by Christian Perfect)

%H Popular Computing (Calabasas, CA), <a href="/A256961/a256961.png">Contest 15: Coding Fun and Profit: Rearranging All The Numbers</a>, Vol. 5 (#57, Dec 1977), page PC57-2.

%H Popular Computing (Calabasas, CA), <a href="/A256961/a256961_2.png">Contest 15: Coding Fun and Profit: Rearranging All The Numbers</a>, Vol. 5 (#57, Dec 1977), page PC57-1 (front cover).

%o (Python)

%o def flip(i,n):

%o ..m = i%n

%o ..m2 = n-m-1

%o ..return i-m+m2

%o .

%o def revert(i,moves):

%o ..for move,leader in reversed(moves):

%o ....if i==leader-1:

%o ......i=0

%o ....else:

%o ......i+=1

%o ....

%o ....i = flip(i,move)

%o ..return i+3

%o .

%o def a256961():

%o ..moves = []

%o ..while True:

%o ....move = revert(0,moves)

%o ....leader = revert(move-1,moves)

%o ....out = revert(flip(leader,move),moves)

%o ....yield out

%o ....moves.append((move,leader))

%o # _Christian Perfect_, Apr 20 2015

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Apr 15 2015

%E More terms from _Alois P. Heinz_, Apr 16 2015

%E More terms from _Christian Perfect_, Apr 20 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 17 05:28 EDT 2024. Contains 375985 sequences. (Running on oeis4.)