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 A186187 #39 May 17 2025 22:42:47 %S A186187 1,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2, %T A186187 1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2, %U A186187 4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2,2,1,2,4,2,1,2,2 %N A186187 Period 8 sequence [ 2, 2, 1, 2, 4, 2, 1, 2, ...] except a(0) = 1. %C A186187 Also continued fraction expansion of sqrt(2717)/38. - _Bruno Berselli_, Mar 07 2011 %H A186187 Michael Somos, <a href="http://cis.csuohio.edu/~somos/rfmc.txt">Rational Function Multiplicative Coefficients</a> %H A186187 <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1,1,-1,1). %F A186187 Euler transform of length 8 sequence [ 2, -2, 2, 0, 0, -2, 0, 1]. %F A186187 Moebius transform is length 8 sequence [ 2, -1, 0, 3, 0, 0, 0, -2]. %F A186187 a(n) = 2 * b(n) where b() is multiplicative with b(2) = 1/2, b(4) = 2, b(2^e) = 1 if e>2, b(p^e) = 1 if p>2. %F A186187 G.f.: (1 + x)^4 * (1 - x + x^2)^2 / (1 - x^8) = (1-x+x^2)^2*(1+x)^3 / ((1-x) *(1+x^2) *(1+x^4)). a(-n) = a(n). a(2*n + 1) = 2, a(4*n + 2) = 1, a(8*n + 4) = 4, a(8*n) = 2 except a(0) = 1. %F A186187 a(n) = A056594(n)-A014017(n)+2 for n>0. - _Bruno Berselli_, Feb 15 2011 %e A186187 1 + 2*x + x^2 + 2*x^3 + 4*x^4 + 2*x^5 + x^6 + 2*x^7 + 2*x^8 + 2*x^9 + ... %t A186187 PadRight[{1},108,{2,2,1,2,4,2,1,2}] (* _Harvey P. Dale_, Mar 22 2012 *) %o A186187 (PARI) {a(n) = - (n==0) + [ 2, 2, 1, 2, 4, 2, 1, 2] [n%8 + 1]} %o A186187 (PARI) {a(n) = polcoeff( (1 + x)^4 * (1 - x + x^2)^2 / (1 - x^8) + x * O(x^abs(n)), abs(n))} %o A186187 (Magma) [1] cat &cat[ [2, 1, 2, 4, 2, 1, 2, 2]: n in [1..13]]; // _Bruno Berselli_, Mar 07 2011 %K A186187 nonn,easy %O A186187 0,2 %A A186187 _Michael Somos_, Feb 14 2011