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 A325589 #7 Aug 23 2019 13:36:01 %S A325589 0,0,2,0,2,2,2,4,4,2,8,6,8,10,12,16,18,20,28,34,42,48,62,78,92,112, %T A325589 146,174,216,264,326,412,500,614,770,944,1166,1444,1784,2214,2730, %U A325589 3366,4182,5164,6386,7898,9770,12098,14950,18488,22894,28312,35020,43330,53606 %N A325589 Number of compositions of n whose circular differences are all 1 or -1. %C A325589 A composition of n is a finite sequence of positive integers summing to n. %C A325589 The circular differences of a composition c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2). %H A325589 Andrew Howroyd, <a href="/A325589/b325589.txt">Table of n, a(n) for n = 1..200</a> %e A325589 The a(3) = 2 through a(11) = 8 compositions (empty columns not shown): %e A325589 (12) (23) (1212) (34) (1232) (45) (2323) (56) %e A325589 (21) (32) (2121) (43) (2123) (54) (3232) (65) %e A325589 (2321) (121212) (121232) %e A325589 (3212) (212121) (123212) %e A325589 (212123) %e A325589 (212321) %e A325589 (232121) %e A325589 (321212) %t A325589 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ[1,##]&@@Abs[Differences[Append[#,First[#]]]]&]],{n,15}] %o A325589 (PARI) %o A325589 step(R,n,s)={matrix(n, n, i, j, if(i>j, if(j>s, R[i-j, j-s]) + if(j+s<=n, R[i-j, j+s])) )} %o A325589 a(n)={sum(k=1, n, my(R=matrix(n,n,i,j,i==j&&abs(i-k)==1), t=0); while(R, R=step(R,n,1); t+=R[n,k]); t)} \\ _Andrew Howroyd_, Aug 23 2019 %Y A325589 Cf. A000079, A008965, A034297, A173258, A325553, A325558, A325590, A325591. %K A325589 nonn %O A325589 1,3 %A A325589 _Gus Wiseman_, May 11 2019 %E A325589 Terms a(26) and beyond from _Andrew Howroyd_, Aug 23 2019