A104706 First terms in the rearrangements of integer numbers (see comments).
1, 2, 3, 1, 4, 5, 1, 2, 6, 1, 7, 3, 1, 2, 8, 1, 9, 4, 1, 2, 10, 1, 3, 11, 1, 2, 5, 1, 12, 13, 1, 2, 3, 1, 4, 6, 1, 2, 14, 1, 15, 3, 1, 2, 7, 1, 5, 4, 1, 2, 16, 1, 3, 17, 1, 2, 8, 1, 18, 6, 1, 2, 3, 1, 4, 19, 1, 2, 5, 1, 9, 3, 1, 2, 20, 1, 21, 4, 1, 2, 7, 1, 3, 10, 1, 2, 22, 1, 5, 6, 1, 2, 3, 1, 4, 23, 1
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A104706:= proc(N) # to produce a(1) .. a(N) local A, R, n,M; M:= N; R:= $1..M; A[1]:= 1; for n from 2 to N do if 2*R[1]+1 > M then R:= R, [$M+1..M+N] fi; R:= R[2..2*R[1]+1],R[1],R[2*R[1]+2..N]; A[n]:= R[1]; od: seq(A[n], n=1..N); end proc: A104706(100); # Robert Israel, Dec 04 2015
-
Mathematica
s=Range[100];bb={1};Do[s=Drop[Insert[s, s[[1]], 2+2s[[1]]], 1];bb=Append[bb, s[[1]]], {i, 100}];bb NestList[Rest[Insert[#, #[[1]], 2 + 2 #[[1]]]] &, Range[30], 30][[All, 1]] (* Birkas Gyorgy, Mar 03 2011 *)
-
Sage
def A104706(n): m, N = 2, 2*n-1 while true: if m.divides(N): return m-2 N = N*(m-1)//m m += 1 print([A104706(n) for n in (1..97)]) # Peter Luschny, Dec 04 2015
Formula
a(n) = A028920(2n-1)-1. - Benoit Cloitre, Mar 09 2007
Comments