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 A010887 #37 Feb 19 2024 01:51:44 %S A010887 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2, %T A010887 3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4, %U A010887 5,6,7,8,1,2,3,4,5,6,7,8,1 %N A010887 Simple periodic sequence: repeat 1,2,3,4,5,6,7,8. %C A010887 Partial sums are given by A130486(n)+n+1. - _Hieronymus Fischer_, Jun 08 2007 %C A010887 1371742/11111111 = 0.123456781234567812345678... - _Eric Desbiaux_, Nov 03 2008 %H A010887 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1). %F A010887 a(n) = 1 + (n mod 8) - _Paolo P. Lava_, Nov 21 2006 %F A010887 From _Hieronymus Fischer_, Jun 08 2007: (Start) %F A010887 a(n) = (1/2)*(9 - (-1)^n - 2*(-1)^(b/4) - 4*(-1)^((b - 2 + 2*(-1)^(b/4))/8)) where b = 2n - 1 + (-1)^n. %F A010887 Also a(n) = A010877(n) + 1. %F A010887 G.f.: g(x) = (1/(1-x^8))*Sum_{k=0..7} (k+1)*x^k. %F A010887 Also: g(x) = (8x^9 - 9x^8 + 1)/((1-x^8)*(1-x)^2). (End) %t A010887 PadRight[{},90,Range[8]] (* _Harvey P. Dale_, May 10 2022 *) %o A010887 (Haskell) %o A010887 a010887 = (+ 1) . flip mod 8 %o A010887 a010887_list = cycle [1..8] %o A010887 -- _Reinhard Zumkeller_, Nov 09 2014, Mar 04 2014 %o A010887 (Python) %o A010887 def A010887(n): return 1 + (n & 7) # _Chai Wah Wu_, May 25 2022 %Y A010887 Cf. A010872, A010873, A010874, A010875, A010876, A010878, A004526, A002264, A002265, A002266. %Y A010887 Cf. A177034 (decimal expansion of (9280+3*sqrt(13493990))/14165). - _Klaus Brockhaus_, May 01 2010 %K A010887 nonn,easy %O A010887 0,2 %A A010887 _N. J. A. Sloane_