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 A146994 #30 Sep 08 2022 08:45:38 %S A146994 1,3,4,7,9,13,16,22,25,32,36,44,49,59,64,75,81,93,100,114,121,136,144, %T A146994 160,169,187,196,215,225,245,256,278,289,312,324,348,361,387,400,427, %U A146994 441,469,484,514,529,560,576,608,625,659,676,711,729,765,784,822,841 %N A146994 a(n) = (n+1)^2/4 + (floor((n+5)/6) - 1/4) * ((n+1) mod 2). %C A146994 This sum appears when calculating the number of elements of S_3 wreath C_k which avoid 12. We use a nonstandard ordering, where we consider an element of S_3 wreath C_k to be a permutation sigma of S_3 with each sigma_i colored one of k colors. We then create a string au with au_i being defined as sigma_i times its color (where, e.g., the 3rd color has value 3). We then consider the reduced string of au identically to reducing permutations as done in standard pattern avoidance. When calculating the number of these reduced strings which avoid 12, we encounter this sequence as one of our subcases. %H A146994 G. C. Greubel, <a href="/A146994/b146994.txt">Table of n, a(n) for n = 1..1000</a> %H A146994 T. Mansour, <a href="https://www.emis.de/journals/SLC/wpapers/s46mansour.html">Pattern Avoidance in Coloured Permutations</a>, Séminaire Lotharingien de Combinatoire, 46, 2001. %H A146994 <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1,0,0,1,-1,-1,1). %F A146994 a(2*n-1) = n^2 for n >= 1. %F A146994 a(2*n) = n*(n+1) + floor((2*n+5)/6) for n >= 0. %F A146994 From _R. J. Mathar_, Nov 21 2008: (Start) %F A146994 a(n) = (-4*A057078(n) - 4*A010892(n+1) + 6*n^2 + 14*n + 7 + (-1)^n*(2n+1))/24. %F A146994 a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-6) - a(n-7) - a(n-8) + a(n-9). %F A146994 G.f.: x*(1 + 2*x + x^3 + x^4 + x^5)/((1 + x + x^2)*(1 - x + x^2)*(1+x)^2*(1-x)^3). (End) %p A146994 a := n -> `if`(irem(n,2)=1,(n+1)^2/4, ((n+1)^2-1)/4 + floor((n+5)/6)): seq(a(n), n=1..57); # _Peter Luschny_, Feb 01 2015 %t A146994 LinearRecurrence[{1,1,-1,0,0,1,-1,-1,1},{1,3,4,7,9,13,16,22,25},60] (* _Harvey P. Dale_, Dec 17 2012 *) %t A146994 Table[If[EvenQ[n], n*(n+2)/4 + Floor[(n+5)/6], (n+1)^2/4], {n, 60}] (* _G. C. Greubel_, Jan 09 2020 *) %o A146994 (PARI) a(n) = if(n%2==0, n*(n+2)/4 + (n+5)\6, (n+1)^2/4); %o A146994 vector(60, n, a(n)) \\ _G. C. Greubel_, Jan 09 2020 %o A146994 (Magma) [(n mod 2) eq 0 select n*(n+2)/4 + Floor((n+5)/6) else (n+1)^2/4: n in [1..60]]; // _G. C. Greubel_, Jan 09 2020 %o A146994 (Sage) %o A146994 def a(n): %o A146994 if (mod(n,2)==0): return n*(n+2)/4 + floor((n+5)/6) %o A146994 else: return (n+1)^2/4 %o A146994 [a(n) for n in (1..60)] # _G. C. Greubel_, Jan 09 2020 %Y A146994 Cf. A000290, A010892, A057078. %K A146994 easy,nonn %O A146994 1,2 %A A146994 Mitch Phillipson, _Manda Riehl_, and Tristan Williams, Nov 04 2008 %E A146994 More terms from _R. J. Mathar_, Nov 21 2008 %E A146994 Name corrected and partial edit by _Peter Luschny_, Feb 01 2015