login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A010887
Simple periodic sequence: repeat 1,2,3,4,5,6,7,8.
5
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, 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, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1
OFFSET
0,2
COMMENTS
Partial sums are given by A130486(n)+n+1. - Hieronymus Fischer, Jun 08 2007
1371742/11111111 = 0.123456781234567812345678... - Eric Desbiaux, Nov 03 2008
FORMULA
a(n) = 1 + (n mod 8) - Paolo P. Lava, Nov 21 2006
From Hieronymus Fischer, Jun 08 2007: (Start)
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.
Also a(n) = A010877(n) + 1.
G.f.: g(x) = (1/(1-x^8))*Sum_{k=0..7} (k+1)*x^k.
Also: g(x) = (8x^9 - 9x^8 + 1)/((1-x^8)*(1-x)^2). (End)
MATHEMATICA
PadRight[{}, 90, Range[8]] (* Harvey P. Dale, May 10 2022 *)
PROG
(Haskell)
a010887 = (+ 1) . flip mod 8
a010887_list = cycle [1..8]
-- Reinhard Zumkeller, Nov 09 2014, Mar 04 2014
(Python)
def A010887(n): return 1 + (n & 7) # Chai Wah Wu, May 25 2022
CROSSREFS
Cf. A177034 (decimal expansion of (9280+3*sqrt(13493990))/14165). - Klaus Brockhaus, May 01 2010
Sequence in context: A190598 A338882 A053844 * A101412 A338496 A053830
KEYWORD
nonn,easy
STATUS
approved