|
|
A057033
|
|
Let P(n) of a sequence s(1),s(2),s(3),... be obtained by leaving s(1),...s(n-1) fixed and reverse-cyclically permuting every n consecutive terms thereafter; apply P(2) to 1,2,3,... to get PS(2), then apply P(3) to PS(2) to get PS(3), then apply P(4) to PS(3), etc. The limit of PS(n) is A057033.
|
|
7
|
|
|
1, 3, 5, 2, 9, 11, 6, 15, 17, 10, 21, 12, 4, 27, 29, 18, 19, 35, 22, 39, 41, 8, 45, 28, 30, 51, 36, 34, 57, 59, 14, 43, 65, 42, 69, 71, 24, 53, 77, 7, 81, 60, 54, 87, 64, 58, 67, 95, 26, 99, 101, 37, 105, 107, 70, 111, 84, 32, 88, 93, 78, 47
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
PS(2) begins with 1,3,2,5,4,7,6; PS(3) with 1,3,5,4,2,6,9; PS(4) with 1,3,5,2,6,9,4.
|
|
MATHEMATICA
|
terms = 62; maxTerms = terms^2; Clear[PS]; PS[n_] := PS[n] = If[n == 1, Range[maxTerms], Join[PS[n-1][[1 ;; n-1]], RotateLeft /@ Partition[ PS[n-1][[n ;; All]], n]] // Flatten]; PS[1]; PS[n = 2]; While[PS[n][[1 ;; terms]] != PS[n-1][[1 ;; terms]], n++]; A057033 = PS[n][[1 ;; terms]] (* Jean-François Alcover, Apr 24 2017 *)
|
|
PROG
|
(PARI) f(n, m)=my(s=Set(divisors(n))); s=setunion(s, Set(m)); s[setsearch(s, m)-1] \\ function for greatest divisor of n that is smaller than m
b(n) = my(n=n+1, A=n, B=n, C); until(B==1, C=A; A=A-f(A, B); B=f(C, B)); A-1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|