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 A109813 #15 Aug 27 2022 04:52:33 %S A109813 1,1,2,2,12,2,72,24,144,12,22032,24,476928,480,1728,9600,805146624, %T A109813 720,36481536000,30240,1728000,312000,192859121664000,40320, %U A109813 2159795404800,46293120,249684249600,58423680 %N A109813 Number of permutations of (the positive integers <= n and coprime to n), where each element of the permutations is coprime to its adjacent elements. %C A109813 Sequence continues: a(29) = ?, 40320, ?, 1893397524480, 32006016000000, 478511953920, ?, 209018880, ?, 122634632171520, ?, 665481277440, ?, 399168000. - _Franklin T. Adams-Watters_, Sep 25 2006 %e A109813 The integers coprime to 10 and <= 10 are (1,3,7,9). %e A109813 Of the permutations of these integers, there are 12 permutations where all adjacent terms are coprime, i.e., where 3 and 9 are not adjacent. So the 10th term of the sequence is 12. %o A109813 (PARI) {A109813(x)=local(v, A, d, r, M, i, j); n=eulerphi(x); v=vector(n,i,0); j=0; for(i=1,x,if(gcd(i,x)==1,j++;v[j]=i)); A=matrix(n, n, i, j, gcd(v[i], v[j])==1); r=0; for(s=1, 2^n-1, M=vecextract(A, s, s)^(n-1); d=matsize(M)[1]; r+=(-1)^(n-d)*sum(i=1, d, sum(j=1, d, M[i, j]))); r} \\ _Franklin T. Adams-Watters_, Sep 25 2006 %Y A109813 Cf. A076220. %K A109813 more,nonn %O A109813 1,3 %A A109813 _Leroy Quet_, Aug 16 2005 %E A109813 More terms from _Franklin T. Adams-Watters_, Sep 25 2006