Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a279319 -id:a279319
     Sort: relevance | references | number | modified | created      Format: long | short | data
Period 2: repeat [0, 1]; a(n) = n mod 2; parity of n.
(Formerly M0001)
+10
696
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
OFFSET
0,1
COMMENTS
Least significant bit of n, lsb(n).
Also decimal expansion of 1/99.
Also the binary expansion of 1/3. - Robert G. Wilson v, Sep 01 2015
a(n) = A134451(n) mod 2. - Reinhard Zumkeller, Oct 27 2007 [Corrected by Jianing Song, Nov 22 2019]
Characteristic function of odd numbers: a(A005408(n)) = 1, a(A005843(n)) = 0. - Reinhard Zumkeller, Sep 29 2008
A102370(n) modulo 2. - Philippe Deléham, Apr 04 2009
Base b expansion of 1/(b^2-1) for any b >= 2 is 0.0101... (A005563 has b^2-1). - Rick L. Shepherd, Sep 27 2009
Let A be the Hessenberg n X n matrix defined by: A[1,j] = j mod 2, A[i,i] := 1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n) = (-1)^n*charpoly(A,1). - Milan Janjic, Jan 24 2010
From R. J. Mathar, Jul 15 2010: (Start)
The sequence is the principal Dirichlet character of the reduced residue system mod 2 or mod 4 or mod 8 or mod 16 ...
Associated Dirichlet L-functions are for example L(2,chi) = Sum_{n>=1} a(n)/n^2 == A111003,
or L(3,chi) = Sum_{n>=1} a(n)/n^3 = 1.05179979... = 7*A002117/8,
or L(4,chi) = Sum_{n>=1} a(n)/n^4 = 1.014678... = A092425/96. (End)
Also parity of the nonnegative integers A001477. - Omar E. Pol, Jan 17 2012
a(n) = (4/n), where (k/n) is the Kronecker symbol. See the Eric Weisstein link. - Wolfdieter Lang, May 28 2013
Also the inverse binomial transform of A131577. - Paul Curtz, Nov 16 2016 [an observation forwarded by Jean-François Alcover]
The emanation sequence for the globe category. That is take the globe category, take the corresponding polynomial comonad, consider its carrier polynomial as a generating function, and take the corresponding sequence. - David Spivak, Sep 25 2020
For n > 0, a(n) is the alternating sum of the product of n increasing and n decreasing odd factors. For example, a(4) = 1*7 - 3*5 + 5*3 - 7*1 and a(5) = 1*9 - 3*7 + 5*5 - 7*3 + 9*1. - Charlie Marion, Mar 24 2022
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Paul Barry, A Catalan Transform and Related Transformations on Integer Sequences, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.
F. Javier de Vega, An extension of Furstenberg's theorem of the infinitude of primes, arXiv:2003.13378 [math.NT], 2020.
Clark Kimberling, A Combinatorial Classification of Triangle Centers on the Line at Infinity, J. Int. Seq., Vol. 22 (2019), Article 19.5.4.
Y. Puri and T. Ward, Arithmetic and growth of periodic orbits, J. Integer Seqs., Vol. 4 (2001), #01.2.1.
Eric Weisstein's World of Mathematics, Dirichlet Series Generating Function
Eric Weisstein's World of Mathematics, Kronecker Symbol
A. K. Whitford, Binet's Formula Generalized, Fibonacci Quarterly, Vol. 15, No. 1, 1979, pp. 21, 24, 29
FORMULA
a(n) = (1 - (-1)^n)/2.
a(n) = n mod 2.
a(n) = 1 - a(n-1).
Multiplicative with a(p^e) = p mod 2. - David W. Wilson, Aug 01 2001
G.f.: x/(1-x^2). E.g.f.: sinh(x). - Paul Barry, Mar 11 2003
a(n) = (A000051(n) - A014551(n))/2. - Mario Catalani (mario.catalani(AT)unito.it), Aug 30 2003
a(n) = ceiling((-2)^(-n-1)). - Reinhard Zumkeller, Apr 19 2005
Dirichlet g.f.: (1-1/2^s)*zeta(s). - R. J. Mathar, Mar 04 2011
a(n) = ceiling(n/2) - floor(n/2). - Arkadiusz Wesolowski, Sep 16 2012
a(n) = ceiling( cos(Pi*(n-1))/2 ). - Wesley Ivan Hurt, Jun 16 2013
a(n) = floor((n-1)/2) - floor((n-2)/2). - Mikael Aaltonen, Feb 26 2015
Dirichlet g.f.: L(chi(2),s) with chi(2) the principal Dirichlet character modulo 2. - Ralf Stephan, Mar 27 2015
a(n) = 0^^n = 0^(0^(0...)) (n times), where we take 0^0 to be 1. - Natan Arie Consigli, May 02 2015
Euler transform and inverse Moebius transform of length 2 sequence [0, 1]. - Michael Somos, Feb 20 2024
EXAMPLE
G.f. = x + x^3 + x^5 + x^7 + x^9 + x^11 + x^13 + x^15 + ... - Michael Somos, Feb 20 2024
MAPLE
A000035 := n->n mod 2;
[ seq(i mod 2, i=0..100) ];
MATHEMATICA
PadLeft[{}, 110, {0, 1}] (* Harvey P. Dale, Sep 25 2011 *)
PROG
(PARI) a(n)=n%2;
(PARI) a(n)=direuler(p=1, 100, if(p==2, 1, 1/(1-X)))[n] /* Ralf Stephan, Mar 27 2015 */
(Haskell)
a000035 n = n `mod` 2 -- James Spahlinger, Oct 08 2012
(Haskell)
a000035_list = cycle [0, 1] -- Reinhard Zumkeller, Jan 06 2012
(Maxima) A000035(n):=mod(n, 2)$
makelist(A000035(n), n, 0, 30); /* Martin Ettl, Nov 12 2012 */
(Scheme) (define (A000035 n) (mod n 2)) ;; For R6RS. Use modulo in older Schemes like MIT/GNU Scheme. - Antti Karttunen, Mar 21 2017
(Python)
def A000035(n): return n & 1 # Chai Wah Wu, May 25 2022
CROSSREFS
Ones complement of A059841.
Cf. A053644 for most significant bit.
This is Guy Steele's sequence GS(1, 2) (see A135416).
Period k zigzag sequences: this sequence (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).
Cf. A154955 (Mobius transform), A131577 (binomial transform).
Cf. A111003 (Dgf at s=2), A233091 (Dgf at s=3), A300707 (Dgf at s=4).
KEYWORD
cons,core,easy,nonn,nice,mult
STATUS
approved
Period 4 zigzag sequence: repeat [0,1,2,1].
+10
25
0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0
OFFSET
0,3
COMMENTS
Euler transform of finite sequence [2,-2,0,1]. - Michael Somos, Sep 17 2004
This is the r = 2 member in the r-family of sequences S_r(n) defined in A092184 where more information can be found.
a(n+1) is the transform of sqrt(1+2x)/sqrt(1-2x) (A063886) under the Chebyshev transformation A(x) -> (1/(1 + x^2))A(x/(1 + x^2)). See also A084099. - Paul Barry, Oct 12 2004
Multiplicative with a(2) = 2, a(2^e) = 0 if e >= 2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005
The e.g.f. of 1, 2, 1, 0, 1, 2, 1, 0, ... (shifted left, offset zero) is exp(x) + sin(x).
Binomial transform is A000749(n+2). - Wesley Ivan Hurt, Dec 30 2015
Decimal expansion of 11/909. - David A. Corneth, Dec 12 2016
Ternary expansion of 1/5. - J. Conrad, Aug 14 2017
FORMULA
Multiplicative with a(p^e) = 2 if p = 2 and e = 0; 0 if p = 2 and e > 0; 1 if p > 2. - David W. Wilson, Aug 01 2001
a(n) = -Sum_{k=0..n} (-1)^C(k+2, 2) (Offset -1). - Paul Barry, Jul 07 2003
a(n) = 1 - cos(n*Pi/2); a(n) = a(n-1) - a(n-2) + a(n-3) for n>2. - Lee Reeves (leereeves(AT)fastmail.fm), May 10 2004
a(n) = -a(n-2) + 2, n >= 2, a(0) = 0, a(1) = 1.
G.f.: x*(1+x)/((1-x)*(1+x^2)) = x*(1+x)/(1-x+x^2-x^3).
a(n) = 1 - T(n, 0) = 1 - A056594(n) with Chebyshev's polynomials T(n, x) of the first kind. Note that T(n, 0) = S(n, 0).
a(n) = b(n) + b(n-1), n >= 1, with b(n) := A021913(n+1) the partial sums of S(n,0) = U(n,0) = A056594(n) (Chebyshev's polynomials evaluated at x=0).
a(n) = 1 + (1/2){(-1)^[(n-1)/2] - (-1)^[n/2]}. - Ralf Stephan, Jun 09 2005
Non-reduced g.f.: x*(1+x)^2/(1-x^4). - Jaume Oliver Lafont, Mar 27 2009
a(n+1) = (S(n, sqrt(2)))^2, n >= 0, with the Chebyshev S-polynomials A049310. See the W. Lang link under A181878. - Wolfdieter Lang, Dec 15 2010
Dirichlet g.f. (1 + 1/2^s - 2/4^s)*zeta(s). - R. J. Mathar, Feb 24 2011
a(n) = (n mod 4) - (n^3 mod 4) + (n^2 mod 4). - Gary Detlefs, Apr 17 2011
a(n) = (n mod 2) + 2*floor(((n+1) mod 4)/3). - Gary Detlefs, Jul 19 2011
a(n) = sqrt(n^2 mod 8). - Wesley Ivan Hurt, Jan 01 2014
a(n) = (n AND 4*k+2)-(n AND 4*k+1) + 2*floor(((n+2) mod 4)/3), for any k. - Gary Detlefs, Jun 08 2014
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/2). - Wesley Ivan Hurt, Dec 26 2015
a(n) = a(n-4) for n >= 4. - Wesley Ivan Hurt, Sep 07 2022
a(n) = n - 2*floor(n/4) - 2*floor((n+1)/4). - Ridouane Oudra, Jan 22 2024
MAPLE
A007877:=n->sqrt(n^2 mod 8); seq(A007877(n), n=0..100); # Wesley Ivan Hurt, Jan 01 2014
MATHEMATICA
f[n_] := Mod[n, 4] - Mod[n^3, 4] + Mod[n^2, 4] (* Or *)
f[n_] := Mod[n, 2] + 2 Floor[Mod[n + 1, 4]/3] (* Or *)
f[n_] := Switch[Mod[n, 4], 0, 0, 1, 1, 2, 2, 3, 1]; Array[f, 105, 0] (* Robert G. Wilson v, Aug 08 2011 *)
Table[Sqrt[Mod[n^2, 8]], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 01 2014 *)
LinearRecurrence[{1, -1, 1}, {0, 1, 2}, 80] (* Vincenzo Librandi, Dec 27 2015 *)
PadRight[{}, 100, {0, 1, 2, 1}] (* Harvey P. Dale, Oct 24 2023 *)
PROG
(PARI) a(n)=[0, 1, 2, 1][1+n%4] \\ Jaume Oliver Lafont, Mar 27 2009
(PARI) concat(0, Vec(x*(1+x)/(1-x+x^2-x^3) + O(x^100))) \\ Altug Alkan, Dec 29 2015
(Magma) &cat [[0, 1, 2, 1]^^25]; // Vincenzo Librandi, Dec 27 2015
(Python)
def A007877(n): return (0, 1, 2, 1)[n&3] # Chai Wah Wu, Jan 26 2023
CROSSREFS
Period k zigzag sequences: A000035 (k=2), this sequence (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).
KEYWORD
nonn,easy,mult
AUTHOR
Christopher Lam Cham Kee (Topher(AT)CyberDude.Com)
EXTENSIONS
Chebyshev comments from Wolfdieter Lang, Sep 10 2004
STATUS
approved
Period 18 zigzag sequence: repeat [0,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1].
+10
14
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5
OFFSET
0,3
COMMENTS
A toothed or zigzag sequence.
Sequence contains only numbers 0..9; abs(a(n+1)-a(n)) = 1.
Decimal expansion of 12345679/1000000001. - Elmo R. Oliveira, Feb 20 2024
LINKS
FORMULA
a(18*k+j) = a(18*(k+1)-j) = j for k >= 0, j = 0..9.
G.f.: x*(1+x+x^2)*(1+x^3+x^6)/((1-x)*(1+x)*(1-x+x^2)*(1-x^3+x^6)). - Klaus Brockhaus, Sep 07 2009
a(n) = Sum_{i=0..n-1} (-1)^floor(i/9). - Wesley Ivan Hurt, Jul 25 2015
a(n) = abs(n - 18*round(n/18)). - Wesley Ivan Hurt, Dec 10 2016
a(n) = a(n-18) for n >= 18. - Wesley Ivan Hurt, Sep 07 2022
MATHEMATICA
a[n_] := If[m = Mod[n, 18]; m <= 9, m, 18-m]; Table[a[n], {n, 0, 85}] (* Jean-François Alcover, Jul 19 2013 *)
PadRight[{}, 100, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1}] (* Vincenzo Librandi, Jul 26 2015 *)
PROG
(Magma) [ s lt 9 select r else 9-r where r is n mod 9 where s is n mod 18: n in [0..104] ]; // Klaus Brockhaus, Sep 07 2009
(Magma) S:=[]; a:=0; for n in [0..104] do Append(~S, a); if n mod 18 eq 0 then d:=1; else if n mod 9 eq 0 then d:=-1; end if; end if; a+:=d; end for; S; // Klaus Brockhaus, Sep 07 2009
(Magma) &cat[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1]: n in [0..5]]; // Vincenzo Librandi, Jul 26 2015
(PARI) a(n)=abs(n-round(n/18)*18) \\ M. F. Hasler, Jul 27 2015
CROSSREFS
Cf. A068073 (repeat 1,2,3,2), A028356 (repeat 1,2,3,4,3,2), A130784 (repeat 1,3,2).
Period k zigzag sequences: A000035 (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), this sequence (k=18).
KEYWORD
easy,nonn
AUTHOR
Jaroslav Krizek, Mar 15 2009
EXTENSIONS
Edited and extended by Klaus Brockhaus, Sep 07 2009
STATUS
approved
Period 14 zigzag sequence: repeat [0,1,2,3,4,5,6,7,6,5,4,3,2,1].
+10
12
0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1
OFFSET
0,3
COMMENTS
Decimal expansion of 1111111/90000009. - Elmo R. Oliveira, Feb 21 2024
FORMULA
G.f.: x*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)/(1 - x + x^7 - x^8).
a(n) = a(n-1) - a(n-7) + a(n-8) for n > 7.
a(n) = abs(n - 14*round(n/14)).
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/7).
a(2n) = 2*A279316(n), a(2n+1) = A279321(n).
a(n) = a(n-14) for n >= 14. - Wesley Ivan Hurt, Sep 07 2022
MAPLE
A279313:=n->[0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1][(n mod 14)+1]: seq(A279313(n), n=0..200);
MATHEMATICA
CoefficientList[Series[x*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)/(1 - x + x^7 - x^8), {x, 0, 100}], x]
PROG
(Magma) &cat[[0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1]: n in [0..10]];
(PARI) a(n)=([0, 1, 0, 0, 0, 0, 0, 0; 0, 0, 1, 0, 0, 0, 0, 0; 0, 0, 0, 1, 0, 0, 0, 0; 0, 0, 0, 0, 1, 0, 0, 0; 0, 0, 0, 0, 0, 1, 0, 0; 0, 0, 0, 0, 0, 0, 1, 0; 0, 0, 0, 0, 0, 0, 0, 1; 1, -1, 0, 0, 0, 0, 0, 1]^n*[0; 1; 2; 3; 4; 5; 6; 7])[1, 1] \\ Charles R Greathouse IV, Dec 12 2016
CROSSREFS
Period k zigzag sequences: A000035 (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), this sequence (k=14), A279319 (k=16), A158289 (k=18).
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 09 2016
STATUS
approved
Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1].
+10
11
0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1
OFFSET
0,3
COMMENTS
Decimal expansion of 37/3003. - Elmo R. Oliveira, Mar 06 2024
FORMULA
G.f.: x*(1 + x + x^2) / (1 - x + x^3 - x^4).
a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3.
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/3) for n > 0.
a(n+1) = a(n) + A130151(n).
a(2n) = 2*A011655(n), a(2n+1) = A109007(n+2).
a(n) = 1 + (1 - (-1)^n)/2 - (-1)^floor((n+1)/3). - Bruno Berselli, Nov 16 2015
a(n) = sin(n*Pi/6)^2*(11+4*cos(n*Pi/3)+2*cos(2*n*Pi/3))/3. - Wesley Ivan Hurt, Jun 17 2016
a(n) = a(n-6) for n >= 6. - Wesley Ivan Hurt, Sep 07 2022
a(n) = sqrt(n^2 mod 12) = sqrt(A070435(n)). - Nicolas Bělohoubek, May 24 2024
MAPLE
A260686:=n->[0, 1, 2, 3, 2, 1][(n mod 6)+1]: seq(A260686(n), n=0..100);
MATHEMATICA
CoefficientList[Series[(x + x^2 + x^3)/(1 - x + x^3 - x^4), {x, 0, 100}], x]
Table[1 + (1 - (-1)^n)/2 - (-1)^Floor[(n + 1)/3], {n, 0, 100}] (* Bruno Berselli, Nov 16 2015 *)
PadRight[{}, 120, {0, 1, 2, 3, 2, 1}] (* Vincenzo Librandi, Nov 17 2015 *)
PROG
(PARI) concat(0, Vec((x+x^2+x^3)/(1-x+x^3-x^4) + O(x^100))) \\ Altug Alkan, Nov 15 2015
(Magma) [1+(1-(-1)^n)/2-(-1)^Floor((n+1)/3): n in [0..100]]; // Bruno Berselli, Nov 16 2015
(Magma) &cat[[0, 1, 2, 3, 2, 1]: n in [0..15]]; // Vincenzo Librandi, Nov 17 2015
CROSSREFS
Period k zigzag sequences: A000035 (k=2), A007877 (k=4), this sequence (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Nov 15 2015
STATUS
approved
Period 10 zigzag sequence; repeat: [0, 1, 2, 3, 4, 5, 4, 3, 2, 1].
+10
10
0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5
OFFSET
0,3
COMMENTS
Decimal expansion of 11111/900009. - Elmo R. Oliveira, Mar 03 2024
FORMULA
G.f.: x*(1 + x + x^2 + x^3 + x^4)/(1 - x + x^5 - x^6).
a(n) = a(n-1) - a(n-5) + a(n-6) for n>5.
a(n) = abs(n - 10*round(n/10)).
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/5).
a(2n) = 2*abs(A117444(n)).
a(2n+7) = 2*A076839(n)-1 for n>0.
a(n) = a(n-10) for n >= 10. - Wesley Ivan Hurt, Sep 07 2022
MAPLE
a:=n->[0, 1, 2, 3, 4, 5, 4, 3, 2, 1][(n mod 10)+1]: seq(a(n), n=0..100);
MATHEMATICA
CoefficientList[Series[x*(1 + x + x^2 + x^3 + x^4)/(1 - x + x^5 - x^6), {x, 0, 30}], x]
PROG
(Magma) &cat[[0, 1, 2, 3, 4, 5, 4, 3, 2, 1]: n in [0..10]];
(PARI) a(n) = abs(n-10*round(n/10)); \\ Altug Alkan, Apr 13 2016
CROSSREFS
Period k zigzag sequences: A000035 (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), this sequence (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 13 2016
STATUS
approved
Period 12 zigzag sequence: repeat [0,1,2,3,4,5,6,5,4,3,2,1].
+10
10
0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1
OFFSET
0,3
COMMENTS
a(n)/36 is the probability that the sum shown after rolling a pair of standard dice is 1+(n mod 12). - Mathew Englander, Jul 11 2022
Decimal expansion of 37037/3000003. - Elmo R. Oliveira, Mar 03 2024
FORMULA
G.f.: x*(1 + x + x^2 + x^3 + x^4 + x^5)/(1 - x + x^6 - x^7).
a(n) = a(n-1) - a(n-6) + a(n-7) for n>6.
a(n) = abs(n - 12*round(n/12)).
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/6).
a(2n) = a(10n) = 2*A260686(n), a(2n+1) = A110551(n).
a(3n) = 3*A007877(n), a(4n) = a(8n) = 4*A011655(n).
a(6n) = A010677(n) = 6*A000035(n).
a(n) = a(n-12) for n >= 12. - Wesley Ivan Hurt, Sep 07 2022
MAPLE
A271832:=n->[0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1][(n mod 12)+1]: seq(A271832(n), n=0..300);
MATHEMATICA
CoefficientList[Series[x*(1 + x + x^2 + x^3 + x^4 + x^5)/(1 - x + x^6 - x^7), {x, 0, 100}], x]
PROG
(Magma) &cat[[0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1]: n in [0..10]];
(PARI) lista(nn) = for(n=0, nn, print1(abs(n-12*round(n/12)), ", ")); \\ Altug Alkan, Apr 15 2016
CROSSREFS
Period k zigzag sequences: A000035 (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), this sequence (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 15 2016
STATUS
approved
Period 8 zigzag sequence; repeat [0, 1, 2, 3, 4, 3, 2, 1].
+10
9
0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3
OFFSET
0,3
COMMENTS
Decimal expansion of 1111/90009. - Elmo R. Oliveira, Mar 03 2024
FORMULA
G.f.: x*(1+x+x^2+x^3)/(1-x+x^4-x^5).
a(n) = a(n-1) - a(n-4) + a(n-5) for n > 4.
a(n) = Sum_{i = 1..n} (-1)^floor((i-1)/4).
a(2n) = 2*A007877(n); a(2n+1) = A084101(n).
a(n) = abs(n - 8*round(n/8)). - Jon E. Schoenfield, Jan 01 2016
Euler transform of length 8 sequence [2, 0, 0, -2, 0, 0, 0, 1]. - Michael Somos, Feb 27 2020
a(n) = a(n-8) for n >= 8. - Wesley Ivan Hurt, Sep 07 2022
EXAMPLE
G.f. = x + 2*x^2 + 3*x^3 + 4*x^4 + 3*x^5 + 2*x^6 + x^7 + x^9 + ... - Michael Somos, Feb 27 2020
MAPLE
A266313:=n->[0, 1, 2, 3, 4, 3, 2, 1][(n mod 8)+1]: seq(A266313(n), n=0..100);
MATHEMATICA
CoefficientList[Series[x*(1 + x + x^2 + x^3)/(1 - x + x^4 - x^5), {x, 0, 100}], x]
PROG
(Magma) &cat[[0, 1, 2, 3, 4, 3, 2, 1]: n in [0..10]];
(PARI) x='x+O('x^100); concat(0, Vec(x*(1+x+x^2+x^3)/(1-x+x^4-x^5))) \\ Altug Alkan, Dec 29 2015
(PARI) {a(n) = abs((n+4)\8*8-n)}; /* Michael Somos, Feb 27 2020 */
CROSSREFS
Period k zigzag sequences: A000035 (k=2), A007877 (k=4), A260686 (k=6), this sequence (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).
Cf. A084101.
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 26 2015
STATUS
approved

Search completed in 0.016 seconds