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 A122158 #7 Nov 13 2017 03:03:09 %S A122158 1,2,4,20,18,12,126,33,204,1638,1968,2010,504,17043,240,222870, %T A122158 4084080,12462,81396,4200,41790,24254,56560,1377090,30669496,57420, %U A122158 249480,93840,696010,40680,4627497204,2122260,4774320,347190,83800,103458,5017446420,1686300 %N A122158 Smallest positive number of "triangular" shuffles of n(n+1)/2 cards needed to restore them to their original order. %C A122158 Lay out cards in a triangular array from left to right in rows, with 1 card in row 1 (the top row), 2 cards in row 2, etc., then pick up by columns, in order from the bottom of the column to the top, first from column 1, then column 2, etc. See A048782 for analogous results for a different triangular shuffle. %H A122158 Andrew Howroyd, <a href="/A122158/b122158.txt">Table of n, a(n) for n = 1..500</a> %e A122158 For n=3, successive shuffles give: %e A122158 1.......4.......5.......3.......1 %e A122158 2.3.....2.1.....2.4.....2.5.....2.3 %e A122158 4.5.6...5.3.6...3.1.6...1.4.6...4.5.6 %e A122158 returning the deck of 6 cards to its original order in 4 shuffles. Thus a(3)=4. %o A122158 (PARI) %o A122158 Perm(n)={concat(Vecrev(vector(n,i,vector(i,j,n+1-i+(n-j+1)*(n-j)/2))))} %o A122158 Follow(s, f)={my(t=f(s), k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)} %o A122158 CyclePoly(n, x)={my(v=Perm(n), q=0); for(i=1, #v, my(l=Follow(i, j->v[j])); if(l, q+=x^l)); q} %o A122158 a(n)={my(q=CyclePoly(n, x), m=1); for(i=1, poldegree(q), if(polcoeff(q, i), m=lcm(m, i))); m} \\ _Andrew Howroyd_, Nov 12 2017 %Y A122158 Cf. A121052, A048782. %K A122158 nonn %O A122158 1,2 %A A122158 _John W. Layman_, Aug 22 2006 %E A122158 Terms a(17) and beyond from _Andrew Howroyd_, Nov 12 2017