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 A010877 #52 Aug 04 2024 02:56:26 %S A010877 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1, %T A010877 2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3, %U A010877 4,5,6,7,0,1,2,3,4,5,6,7,0 %N A010877 a(n) = n mod 8. %C A010877 The rightmost digit in the base-8 representation of n. Also, the equivalent value of the three rightmost digits in the base-2 representation of n. - _Hieronymus Fischer_, Jun 12 2007 %H A010877 Antti Karttunen, <a href="/A010877/b010877.txt">Table of n, a(n) for n = 0..65536</a> %H A010877 <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 A010877 Complex representation: a(n) = (1/8)*(1-r^n)*Sum_{k=1..7} k*Product_{m=1..7, m<>k} (1 - r^(n-m)) where r = exp(Pi/4*i) = (1+i)*sqrt(2)/2 and i=sqrt(-1). %F A010877 Trigonometric representation: a(n) = 256*(sin(n*Pi/8))^2*Sum_{k=1..7} k*Product_{m=1..7, m<>k} (sin((n-m)*Pi/8))^2. %F A010877 G.f.: g(x) = (Sum_{k=1..7}, k*x^k)/(1-x^8). %F A010877 Also: g(x) = x(7x^8-8x^7+1)/((1-x^8)(1-x)^2). - _Hieronymus Fischer_, May 31 2007 %F A010877 a(n) = n mod 2 + 2*(floor(n/2) mod 4) = A000035(n) + 2*A010873(A004526(n)). %F A010877 a(n) = n mod 4 + 4*(floor(n/4) mod 2) = A010873(n) + 4*A000035(A002265(n)). %F A010877 a(n) = n mod 2 + 2*(floor(n/2) mod 2) + 4*(floor(n/4) mod 2) = A000035(n) + 2*A000035(A004526(n)) + 4*A000035(A002265(n)). - _Hieronymus Fischer_, Jun 12 2007 %F A010877 a(n) = (1/2)*(7 - (-1)^n - 2*(-1)^(b/4) - 4*(-1)^((b - 2 + 2*(-1)^(b/4))/8)) where b = 2n - 1 + (-1)^n. - _Hieronymus Fischer_, Jun 12 2007 %F A010877 General formula for period 2^k: a(n) = (1/2)*(2^k - 1 - Sum_{j=0..k-1} 2^j*(-1)^p(j,n)) where p(j,n) is defined recursively by p(0,n)=n, p(j,n) = (1/4)*(2*p(j-1,n) - 1 + (-1)^p(j-1,n)). - _Hieronymus Fischer_, Jun 14 2007 %F A010877 a(n) = floor(1234567/99999999*10^(n+1)) mod 10. - _Hieronymus Fischer_, Jan 03 2013 %F A010877 a(n) = floor(48913/2396745*8^(n+1)) mod 8. - _Hieronymus Fischer_, Jan 04 2013 %t A010877 Table[Mod[n,8],{n,0,120}] (* _Harvey P. Dale_, Apr 21 2011 *) %o A010877 (PARI) vector(100,i,i)%8 \\ _Charles R Greathouse IV_, Jul 16 2011 %o A010877 (Python) %o A010877 def A010877(n): return n&7 # _Chai Wah Wu_, Jul 09 2022 %Y A010877 Partial sums: A130486. Other related sequences A130481, A130482, A130483, A130484, A130485. %Y A010877 Cf. A000035, A010887, A010873, A130909, A168181, A244413, A253513. %K A010877 nonn,easy %O A010877 0,3 %A A010877 _N. J. A. Sloane_ %E A010877 Formula section re-edited for better readability by _Hieronymus Fischer_