This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A054430 #20 Oct 19 2022 08:59:48 %S A054430 1,3,2,5,4,9,8,7,6,11,10,17,16,15,14,13,12,21,20,19,18,27,26,25,24,23, %T A054430 22,31,30,29,28,41,40,39,38,37,36,35,34,33,32,45,44,43,42,57,56,55,54, %U A054430 53,52,51,50,49,48,47,46,63,62,61,60,59,58,71,70,69,68,67,66,65,64,79 %N A054430 Simple self-inverse permutation of natural numbers: List each clump of phi(n) numbers (starting from phi(2) = 1) in reverse order. %H A054430 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %p A054430 ReverseNextPhi_n_elements_permutation(30); with(numtheory,phi); ReverseNextPhi_n_elements_permutation := proc(u) local m,a,n,k,i; a := []; k := 0; for n from 2 to u do m := k + phi(n); for i from 1 to phi(n) do a := [op(a),m]; m := m-1; k := k+1; od; od; RETURN(a); end; %t A054430 A[u_]:=Block[{m, a={}, n, k=0, i}, For[n=2, n<=u, n++, m=k + EulerPhi[n]; For[i=1, i<=EulerPhi[n], i++, AppendTo[a, m]; m=m - 1; k = k + 1]]; Return [a]]; A[30] (* _Indranil Ghosh_, May 23 2017, translated from MAPLE code *) %t A054430 Reverse/@TakeList[Range[200],EulerPhi[Range[2,20]]]//Flatten (* _Harvey P. Dale_, Oct 19 2022 *) %o A054430 (Python) %o A054430 from sympy import totient %o A054430 def A(u): %o A054430 a=[] %o A054430 k=0 %o A054430 for n in range(2, u + 1): %o A054430 m=k + totient(n) %o A054430 for i in range(1, totient(n) + 1): %o A054430 a+=[m,] %o A054430 m-=1 %o A054430 k+=1 %o A054430 return a %o A054430 print(A(30)) # _Indranil Ghosh_, May 23 2017, translated from MAPLE code %Y A054430 Maps fractions between A020652/A020653 and A020653/A020652. %Y A054430 See also A054429. %K A054430 nonn,easy %O A054430 1,2 %A A054430 _Antti Karttunen_