cp's OEIS Frontend

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.

Showing 1-10 of 24 results. Next

A000035 Period 2: repeat [0, 1]; a(n) = n mod 2; parity of n.

Original entry on oeis.org

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

Views

Author

Keywords

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

Examples

			G.f. = x + x^3 + x^5 + x^7 + x^9 + x^11 + x^13 + x^15 + ... - _Michael Somos_, Feb 20 2024
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

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).
Parity of A005811.

Programs

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

A092184 Sequence S_6 of the S_r family.

Original entry on oeis.org

0, 1, 6, 25, 96, 361, 1350, 5041, 18816, 70225, 262086, 978121, 3650400, 13623481, 50843526, 189750625, 708158976, 2642885281, 9863382150, 36810643321, 137379191136, 512706121225, 1913445293766, 7141075053841, 26650854921600, 99462344632561, 371198523608646
Offset: 0

Views

Author

Rainer Rosenthal, Apr 03 2004

Keywords

Comments

The r-family of sequences is S_r(n) = 2*(T(n,(r-2)/2) - 1)/(r-4) provided r is not equal to 4 and S_4(n) = n^2 = A000290(n). Here T(n,x) are Chebyshev's polynomials of the first kind. See their coefficient triangle A053120. See also the R. Stephan link for the explicit formula for s_k(n) for k not equal to 4 (Stephan's s_k(n) is identical with S_r(n)).
An integer n is in this sequence iff mutually externally tangent circles with radii n, n+1, n+2 have Soddy circles (i.e., circles tangent to all three) of rational radius. - James R. Buddenhagen, Nov 16 2005
This sequence is a divisibility sequence, i.e., a(n) divides a(m) whenever n divides m. It is the case P1 = 6, P2 = 8, Q = 1 of the 3-parameter family of 4th-order linear divisibility sequences found by Williams and Guy. - Peter Bala, Mar 25 2014
a(n) is the block size of the (n-1)-th design in a sequence of multi-set designs with 2 blocks, see A335649. - John P. McSorley, Jun 22 2020

Examples

			a(3)=25 because a(1)=1 and a(2)=6 and a(1)*a(3) = 1*25 = (6-1)^2 = (a(2)-1)^2.
		

Crossrefs

See A001110=S_36 for further references to S_r sequences.
Other members of this r-family are: A007877 (r=2), |A078070| (r=3), A004146 (r=5), A054493 (r=7). A098306, A100047. A001353, A001834. A001350, A052530.

Programs

  • Magma
    [Floor(1/2*(-2+(2+Sqrt(3))^n+(2-Sqrt(3))^n)): n in [0..30]]; // Vincenzo Librandi, Oct 14 2015
  • Maple
    A092184 := proc(n)
        option remember;
        if n <= 1 then
            n;
        else
            4*procname(n-1)-procname(n-2)+2 ;
        end if ;
    end proc:
    seq(A092184(n),n=0..10) ;# Zerinvary Lajos, Mar 09 2008
  • Mathematica
    Table[Simplify[ -((2 + Sqrt[3])^n - 1)*((2 - Sqrt[3])^n - 1)]/2, {n, 0, 26}] (* Stefan Steinerberger, May 15 2007 *)
    LinearRecurrence[{5,-5,1},{0,1,6},27] (* Ray Chandler, Jan 27 2014 *)
    CoefficientList[Series[x (1 + x)/(1 - 5 x + 5 x^2 - x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Oct 14 2015 *)
  • PARI
    Vec(x*(1+x)/(1 - 5*x + 5*x^2 - x^3) + O(x^50)) \\ Michel Marcus, Oct 14 2015
    

Formula

S_r type sequences are defined by a(0)=0, a(1)=1, a(2)=r and a(n-1)*a(n+1) = (a(n)-1)^2. This sequence emanates from r=6.
a(n) = 1/2*(-2 + (2+sqrt(3))^n + (2-sqrt(3))^n). - Ralf Stephan, Apr 14 2004
G.f.: x*(1+x)/(1 - 5*x + 5*x^2 - x^3) = x*(1+x)/((1-x)*(1 - 4*x + x^2)). [from the Ralf Stephan link]
a(n) = T(n, 2)-1 = A001075(n)-1, with Chebyshev's polynomials T(n, 2) of the first kind.
a(n) = b(n) + b(n-1), n >= 1, with b(n):=A061278(n) the partial sums of S(n, 4) = U(n, 2) = A001353(n+1) Chebyshev's polynomials of the second kind.
An integer k is in this sequence iff k is nonnegative and (k^2 + 2*k)/3 is a square. - James R. Buddenhagen, Nov 16 2005
a(0)=0, a(1)=1, a(n+1) = 3 + floor(a(n)*(2+sqrt(3))). - Anton Vrba (antonvrba(AT)yahoo.com), Jan 16 2007
a(n) = 4*a(n-1) - a(n-2) + 2. - Zerinvary Lajos, Mar 09 2008
From Peter Bala, Mar 25 2014: (Start)
a(2*n) = 6*A001353(n)^2; a(2*n+1) = A001834(n)^2.
a(n) = u(n)^2, where {u(n)} is the Lucas sequence in the quadratic integer ring Z[sqrt(6)] defined by the recurrence u(0) = 0, u(1) = 1, u(n) = sqrt(6)*u(n-1) - u(n-2) for n >= 2.
Equivalently, a(n) = U(n-1,sqrt(6)/2)^2, where U(n,x) denotes the Chebyshev polynomial of the second kind.
a(n) = (1/2)*( ((sqrt(6) + sqrt(2))/2)^n - ((sqrt(6) - sqrt(2))/2)^n )^2.
a(n) = bottom left entry of the 2 X 2 matrix T(n, M), where M is the 2 X 2 matrix [0, -2; 1, 3] and T(n,x) denotes the Chebyshev polynomial of the first kind. Cf. A098306.
See the remarks in A100047 for the general connection between Chebyshev polynomials of the first kind and 4th-order linear divisibility sequences. (End)
exp( Sum_{n >= 1} 2*a(n)*x^n/n ) = 1 + Sum_{n >= 1} A052530(n)*x^n. Cf. A001350. - Peter Bala, Mar 19 2015
E.g.f.: exp(2*x)*cosh(sqrt(3)*x) - cosh(x) - sinh(x). - Stefano Spezia, Oct 13 2019

Extensions

Extension and Chebyshev comments from Wolfdieter Lang, Sep 10 2004

A000749 a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3), n > 3, with a(0)=a(1)=a(2)=0, a(3)=1.

Original entry on oeis.org

0, 0, 0, 1, 4, 10, 20, 36, 64, 120, 240, 496, 1024, 2080, 4160, 8256, 16384, 32640, 65280, 130816, 262144, 524800, 1049600, 2098176, 4194304, 8386560, 16773120, 33550336, 67108864, 134225920, 268451840, 536887296, 1073741824, 2147450880
Offset: 0

Views

Author

Keywords

Comments

Number of strings over Z_2 of length n with trace 1 and subtrace 1.
Same as number of strings over GF(2) of length n with trace 1 and subtrace 1.
Also expansion of bracket function.
a(n) is also the number of induced subgraphs with odd number of edges in the complete graph K(n-1). - Alessandro Cosentino (cosenal(AT)gmail.com), Feb 02 2009
From Gary W. Adamson, Mar 13 2009: (Start)
M^n * [1,0,0,0] = [A038503(n), a(n), A038505(n), A038504(n)];
where M = the 4 X 4 matrix [1,1,0,0; 0,1,1,0; 0,0,1,1; 1,0,0,1].
Sum of the 4 terms = 2^n.
Example; M^6 * [1,0,0,0] = [16, 20, 16, 12] sum = 64 = 2^6. (End)
Binomial transform of the period 4 repeat: [0,0,0,1], which is the same as A011765 with offset 0. - Wesley Ivan Hurt, Dec 30 2015
{A038503, A038504, A038505, A000749} is the difference analog of the hyperbolic functions of order 4, {h_1(x), h_2(x), h_3(x), h_4(x)}. For a definition see the reference "Higher Transcendental Functions" and the Shevelev link. - Vladimir Shevelev, Jun 14 2017
This is the p-INVERT of (1,1,1,1,1,...) for p(S) = 1 - S^4; see A291000. - Clark Kimberling, Aug 24 2017

Examples

			a(4;1,1)=4 since the four binary strings of trace 1, subtrace 1 and length 4 are { 0111, 1011, 1101, 1110 }.
		

References

  • Higher Transcendental Functions, Bateman Manuscript Project, Vol. 3, ed. A. Erdelyi, 1983 (chapter XVIII).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Sequences of the form 1/((1-x)^m - x^m): A000079 (m=1,2), A024495 (m=3), this sequence (m=4), A049016 (m=5), A192080 (m=6), A049017 (m=7), A290995 (m=8), A306939 (m=9).

Programs

  • Haskell
    a000749 n = a000749_list !! n
    a000749_list = 0 : 0 : 0 : 1 : zipWith3 (\u v w -> 4 * u - 6 * v + 4 * w)
       (drop 3 a000749_list) (drop 2 a000749_list) (drop 1 a000749_list)
    -- Reinhard Zumkeller, Jul 15 2013
    
  • Magma
    I:=[0,0,0,1]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Dec 31 2015
    
  • Maple
    A000749 := proc(n) local k; add(binomial(n,4*k+3),k=0..floor(n/4)); end;
    A000749:=-1/((2*z-1)*(2*z**2-2*z+1)); # Simon Plouffe in his 1992 dissertation
    a:= n-> if n=0 then 0 else (Matrix(3, (i,j)-> if (i=j-1) then 1 elif j=1 then [4,-6,4][i] else 0 fi)^(n-1))[1,3] fi: seq(a(n), n=0..33); # Alois P. Heinz, Aug 26 2008
    # Alternatively:
    s := sqrt(2): h := n -> [0,-s,-2,-s,0,s,2,s][1+(n mod 8)]:
    a := n -> `if`(n=0,0,(2^n+2^(n/2)*h(n))/4):
    seq(a(n),n=0..33); # Peter Luschny, Jun 14 2017
  • Mathematica
    Join[{0},LinearRecurrence[{4,-6,4},{0,0,1},40]] (* Harvey P. Dale, Mar 31 2012 *)
    CoefficientList[Series[x^3/(1 -4x +6x^2 -4x^3), {x,0,80}], x] (* Vincenzo Librandi, Dec 31 2015 *)
  • PARI
    a(n)=sum(k=0,n\4,binomial(n,4*k+3))
    
  • SageMath
    @CachedFunction
    def a(n): # a = A000749
        if (n<4): return (n//3)
        else: return 4*a(n-1) -6*a(n-2) +4*a(n-3)
    [a(n) for n in range(41)] # G. C. Greubel, Apr 11 2023

Formula

G.f.: x^3/((1-x)^4 - x^4).
a(n) = Sum_{k=0..n} binomial(n, 4*k+3).
a(n) = a(n-1) + A038505(n-2) = 2*a(n-1) + A009545(n-2) for n>=2.
Without the two initial zeros, binomial transform of A007877. - Henry Bottomley, Jun 04 2001
From Paul Barry, Aug 30 2004: (Start)
a(n) = (2^n - 2^(n/2+1)*sin(Pi*n/4) - 0^n)/4.
a(n+1) is the binomial transform of A021913. (End)
a(n; t, s) = a(n-1; t, s) + a(n-1; t+1, s+t+1) where t is the trace and s is the subtrace.
Without the initial three zeros, = binomial transform of [1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 3, ...]. - Gary W. Adamson, Jun 19 2008
From Vladimir Shevelev, Jun 14 2017: (Start)
1) For n>=1, a(n) = (1/4)*(2^n + i*(1+i)^n - i*(1-i)^n), where i=sqrt(-1);
2) a(n+m) = a(n)*H_1(m) + H_3(n)*H_2(m) + H_2(n)*H_3(m) + H_1(n)*a(m),
where H_1 = A038503, H_2 = A038504, H_3 = A038505. (End)
a(n) = (2^n - 2*A009545(n) - [n=0])/4. - G. C. Greubel, Apr 11 2023

Extensions

Additional comments from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 22 2002
New definition from Paul Curtz, Oct 29 2007
Edited by N. J. A. Sloane, Jun 13 2008

A063886 Number of n-step walks on a line starting from the origin but not returning to it.

Original entry on oeis.org

1, 2, 2, 4, 6, 12, 20, 40, 70, 140, 252, 504, 924, 1848, 3432, 6864, 12870, 25740, 48620, 97240, 184756, 369512, 705432, 1410864, 2704156, 5408312, 10400600, 20801200, 40116600, 80233200, 155117520, 310235040, 601080390, 1202160780, 2333606220, 4667212440
Offset: 0

Views

Author

Henry Bottomley, Aug 28 2001

Keywords

Comments

A Chebyshev transform of A007877(n+1). The g.f. is transformed to (1+x)/((1-x)(1+x^2)) under the mapping G(x)->(1/(1+x^2))G(1/(1+x^2)). - Paul Barry, Oct 12 2004
a(n-1) = 2*C(n-2, floor((n-2)/2)) is also the number of bit strings of length n in which the number of 00 substrings is equal to the number of 11 substrings. For example, when n = 4 we have 4 such bit strings: 0011, 0101, 1010, and 1100. - Angel Plaza, Apr 23 2009
Hankel transform is A120617. - Paul Barry, Aug 10 2009
The Hankel transform of a(n) is (-2)^C(n+1,2). The Hankel transform of (-1)^C(n+1,2)*a(n) is (-1)^C(n+1,2)*A164584(n). - Paul Barry, Aug 17 2009
For n > 1, a(n) is also the number of n-step walks starting from the origin and returning to it exactly once. - Geoffrey Critzer, Jan 24 2010
-a(n) is the Z-sequence for the Riordan array A130777. (See the W. Lang link under A006232 for A- and Z-sequences for Riordan matrices). - Wolfdieter Lang, Jul 12 2011
Number of subsets of {1,...,n} in which the even elements appear as often at even positions as at odd positions. - Gus Wiseman, Mar 17 2018

Examples

			a(4) = 6 because there are six length four walks that do not return to the origin: {-1, -2, -3, -4}, {-1, -2, -3, -2}, {-1, -2, -1, -2}, {1, 2, 1, 2}, {1, 2, 3, 2}, {1, 2, 3, 4}. There are also six such walks that return exactly one time: {-1, -2, -1, 0}, {-1, 0, -1, -2}, {-1, 0, 1, 2}, {1, 0, -1, -2}, {1, 0, 1, 2}, {1, 2, 1, 0}. - _Geoffrey Critzer_, Jan 24 2010
The a(5) = 12 subsets in which the even elements appear as often at even positions as at odd positions: {}, {1}, {3}, {5}, {1,3}, {1,5}, {2,4}, {3,5}, {1,2,4}, {1,3,5}, {2,4,5}, {1,2,4,5}. - _Gus Wiseman_, Mar 17 2018
		

Crossrefs

Programs

  • Magma
    [1] cat [2*Binomial(n-1, Floor((n-1)/2)): n in [1..40]]; // G. C. Greubel, Jun 07 2023
    
  • Maple
    seq(seq(binomial(2*j,j)*i, i=1..2),j=0..16); # Zerinvary Lajos, Apr 28 2007
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n+1,
           4*a(n-2) +2*(a(n-1) -4*a(n-2))/n)
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 10 2014
    # third program:
    A063886 := series(BesselI(0, 2*x)*(1 + x*2 + x*Pi*StruveL(1, 2*x)) - Pi*x*BesselI(1, 2*x)*StruveL(0, 2*x), x = 0, 34): seq(n!*coeff(A063886, x, n), n = 0 .. 33); # Mélika Tebni, Jun 17 2024
  • Mathematica
    Table[Length[Select[Map[Accumulate, Strings[{-1, 1}, n]], Count[ #, 0] == 0 &]], {n, 0, 20}] (* Geoffrey Critzer, Jan 24 2010 *)
    CoefficientList[Series[Sqrt[(1+2x)/(1-2x)],{x,0,40}],x] (* Harvey P. Dale, Apr 28 2016 *)
  • PARI
    a(n)=(n==0)+2*binomial(n-1,(n-1)\2)
    
  • PARI
    a(n) = 2^n*prod(k=0,n-1,(k/n+1/n)^((-1)^k)); \\ Michel Marcus, Dec 03 2013
    
  • Python
    from math import ceil
    from sympy import binomial
    def a(n):
        if n==0: return 1
        return 2*binomial(n-1,(n-1)//2)
    print([a(n) for n in range(18)])
    # David Nacin, Feb 29 2012
    
  • SageMath
    [2*binomial(n-1, (n-1)//2) + int(n==0) for n in range(41)] # G. C. Greubel, Jun 07 2023

Formula

G.f.: sqrt((1+2*x)/(1-2*x)).
a(n+1) = 2*C(n, floor(n/2)) = 2*A001405(n); a(2n) = C(2n, n) = A000984(n) = 4*a(2n-2)-|A002420(n)| = 4*a(2n-2)-2*A000108(n-1) = 2*A001700(n-1); a(2n+1) = 2*a(2n) = A028329(n).
2*a(n) = A047073(n+1).
a(n) = Sum_{k=0..n} abs(A106180(n,k)). - Philippe Deléham, Oct 06 2006
a(n) = Sum_{k=0..n} (k+1)binomial(n, (n-k)/2) ( 1-cos((k+1)*Pi/2) (1+(-1)^(n-k))/(n+k+2) ). - Paul Barry, Oct 12 2004
G.f.: 1/(1-2*x/(1+x/(1+x/(1-x/(1-x/(1+x/(1+x/(1-x/(1-x/(1+ ... (continued fraction). - Paul Barry, Aug 10 2009
G.f.: 1 + 2*x/(G(0)-x+x^2) where G(k)= 1 - 2*x^2 - x^4/G(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Aug 10 2012
D-finite with recurrence: n*a(n) = 2*a(n-1) + 4*(n-2)*a(n-2). - R. J. Mathar, Dec 03 2012
From Sergei N. Gladkovskii, Jul 26 2013: (Start)
G.f.: 1/G(0), where G(k) = 1 - 2*x/(1 + 2*x/(1 + 1/G(k+1) )); (continued fraction).
G.f.: G(0), where G(k) = 1 + 2*x/(1 - 2*x/(1 + 1/G(k+1) )); (continued fraction).
G.f.: W(0)/2*(1+2*x), where W(k) = 1 + 1/(1 - 2*x/(2*x + (k+1)/(x*(2*k+1))/W(k+1) )), abs(x) < 1/2; (continued fraction). (End)
a(n) = 2^n*Product_{k=0..n-1} (k/n + 1/n)^((-1)^k). - Peter Luschny, Dec 02 2013
G.f.: G(0), where G(k) = 1 + 2*x*(4*k+1)/((2*k+1)*(1+2*x) - (2*k+1)*(4*k+3)*x*(1+2*x)/((4*k+3)*x + (k+1)*(1+2*x)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 19 2014
From Peter Bala, Mar 29 2024: (Start)
a(n) = 2^n * Sum_{k = 0..n} (-1)^(n+k)*binomial(1/2, k)*binomial(- 1/2, n-k) = 2^n * A000246(n)/n!.
a(n) = (1/2^n) * binomial(2*n, n) * hypergeom([-1/2, -n], [1/2 - n], -1). (End)
E.g.f.: BesselI(0, 2*x)*(1 + x*(2 + Pi)*StruveL(1, 2*x)) - Pi*x*BesselI(1, 2*x)*StruveL(0, 2*x). - Stefano Spezia, May 11 2024
a(n) = A089849(n) + A138364(n). - Mélika Tebni, Jun 17 2024
From Amiram Eldar, Aug 15 2025: (Start)
Sum_{n>=0} 1/a(n) = Pi/(3*sqrt(3)) + 2.
Sum_{n>=0} (-1)^n/a(n) = 2/3 + Pi/(9*sqrt(3)). (End)

A021913 Period 4: repeat [0, 0, 1, 1].

Original entry on oeis.org

0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1
Offset: 0

Views

Author

Keywords

Comments

Decimal expansion of 1/909.
Lexicographically earliest de Bruijn sequence for n = 2 and k = 2.
Except for first term, binary expansion of the decimal number 1/10 = 0.000110011001100110011... in base 2. - Benoit Cloitre, May 18 2002
Content of #2 binary placeholder when n is converted from decimal to binary. a(n) = n*(n-1)/2 mod 2. Example: a(7) = 1 since 7 in binary is 1 -1- 1 and (7*6/2) mod 2 = 1. - Anne M. Donovan (anned3005(AT)aol.com), Sep 15 2003
Expansion in any base b of 1/((b-1)*(b^2+1)) = 1/(b^3-b^2+b-1). E.g., 1/5 in base 2, 1/20 in base 3, 1/51 in base 4, etc. - Franklin T. Adams-Watters, Nov 07 2006
Except for first term, parity of the triangular numbers A000217. - Omar E. Pol, Jan 17 2012
Except for first term, more generally: 1) Parity of the k-polygonal numbers, if k is odd (Cf. A139600, A139601). 2) Parity of the generalized k-gonal numbers, for even k >= 6. - Omar E. Pol, Feb 05 2012
Except for first term, parity of Recamán's sequence A005132. - Omar E. Pol, Apr 13 2012
Inverse binomial transform of A000749(n+1). - Wesley Ivan Hurt, Dec 30 2015
Least significant bit of tribonacci numbers (A000073). - Andres Cicuttin, Apr 04 2016

Examples

			G.f. = x^2 + x^3 + x^6 + x^7 + x^10 + x^11 + x^14 + x^15 + x^18 + x^19 + ...;
1/909 = 0.001100110011001 ...
		

Crossrefs

Programs

Formula

From Paul Barry, Aug 30 2004: (Start)
G.f.: x^2*(1 + x)/(1 - x^4).
a(n) = 1/2 - cos(Pi*n/2)/2 - sin(Pi*n/2)/2.
a(n) = a(n-1) - a(n-2) + a(n-3) for n > 2. (End)
a(n+2) = Sum_{k=0..n} b(k), with b(k) = A056594(k) (partial sums of S(n,x) Chebyshev polynomials at x=0).
a(n) = -a(n-2) + 1, for n >= 2 with a(0) = a(1) = 0.
G.f.: x^2/((1 - x)*(1 + x^2)) = x^2/(1 - x + x^2 - x^3).
From Jaume Oliver Lafont, Dec 05 2008: (Start)
a(n) = 1/2 - sin((2n+1)*Pi/4)/sqrt(2).
a(n) = 1/2 - cos((2n-1)*Pi/4)/sqrt(2). (End)
a(n) = floor((n mod 4)/2). - Reinhard Zumkeller, Apr 15 2011
Euler transform of length 4 sequence [1, -1, 0, 1]. - Michael Somos, Feb 28 2014
a(1-n) = a(n) for all n in Z. - Michael Somos, Feb 28 2014
From Wesley Ivan Hurt, Jul 22 2016: (Start)
a(n) = a(n-4) for n > 3.
a(n) = A133872(n+2).
a(n) + a(n+1) = A007877(n). (End)
E.g.f.: (exp(x) - sin(x) - cos(x))/2. - Ilya Gutkovskiy, Jul 11 2016
a(n) = (1 - (-1)^(n*(n-1)/2))/2. - Guenther Schrack, Feb 28 2019

Extensions

Chebyshev comment from Wolfdieter Lang, Sep 10 2004

A158289 Period 18 zigzag sequence: repeat [0,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1].

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Mar 15 2009

Keywords

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

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).

Programs

  • 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
    
  • 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 *)
  • PARI
    a(n)=abs(n-round(n/18)*18) \\ M. F. Hasler, Jul 27 2015

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

Extensions

Edited and extended by Klaus Brockhaus, Sep 07 2009

A279313 Period 14 zigzag sequence: repeat [0,1,2,3,4,5,6,7,6,5,4,3,2,1].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Dec 09 2016

Keywords

Comments

Decimal expansion of 1111111/90000009. - Elmo R. Oliveira, Feb 21 2024

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).

Programs

  • Magma
    &cat[[0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1]: n in [0..10]];
    
  • 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]
  • 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

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

A260686 Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Nov 15 2015

Keywords

Comments

Decimal expansion of 37/3003. - Elmo R. Oliveira, Mar 06 2024

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).

Programs

  • 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
  • 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 *)
  • PARI
    concat(0, Vec((x+x^2+x^3)/(1-x+x^3-x^4) + O(x^100))) \\ Altug Alkan, Nov 15 2015
    

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

A053616 Pyramidal sequence: distance to nearest triangular number.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1
Offset: 0

Views

Author

Henry Bottomley, Mar 20 2000

Keywords

Comments

From Wolfdieter Lang, Oct 24 2020: (Start)
If this sequence is written with offset 1 as a number triangle T(n, k), with n the length of row n, for n >= 1, then row n gives the primitive period of the periodic sequence {k (mod* n)}_{k>=0}, where k (mod* n) = k (mod n) if k <= floor(n/2) and otherwise it is -k (mod n). Such a modified modular relation mod* n has been used by Brändli and Beyne, but for integers relative prime to n.
These periodic sequences are given in A000007, A000035, A011655, A007877, |A117444|, A260686, A279316, for n = 1, 2, ..., 7. For n = 10 A271751, n = 12 A271832, n = 14 A279313. (End)

Examples

			a(12) = |12 - 10| = 2 since 10 is the nearest triangular number to 12.
From _M. F. Hasler_, Dec 06 2019: (Start)
Ignoring a(0) = 0, the sequence can be written as triangle indexed by m >= k >= 1, in which case the terms are (m - |k - |m-k||)/2, as follows:
   0,      (Row 0: ignore)
   0,      (Row m=1, k=1: For k=m, m - |k - |m-k|| = m - |m - 0| = 0.)
   1, 0,        (Row m=2: for k=1, |m-k| = 1, k-|m-k| = 0, m-0 = 2, (...)/2 = 1.)
   1, 1, 0,
   1, 2, 1, 0,    (Row m=4: for k=2, we have twice the value of (m=2, k=1) => 2.)
   1, 2, 2, 1, 0,
   (...)
This is related to the non-associative operation A049581(x,y) = |x - y| =: x @ y. Specifically, @ is commutative and any x is its own inverse, so non-associativity of @ can be measured through the commutator ((x @ y) @ y) @ x which equals twice the element indexed {m,k} = {x,y} in the above triangle.
(End)
		

Crossrefs

a(n) = abs(A305258(n)).

Programs

  • Mathematica
    a[n_] := (k =.; k = Reduce[k > 0 && k*(k+1)/2 == n, Reals][[2]] // Floor; Min[(k+1)*(k+2)/2 - n, n - k*(k+1)/2]); Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Jan 08 2013 *)
    Module[{trms=120,t},t=Accumulate[Range[Ceiling[(Sqrt[8*trms+1]-1)/2]]]; Join[{0},Flatten[Table[Abs[Nearest[t,n][[1]]-n],{n,trms}]]]] (* Harvey P. Dale, Nov 08 2013 *)
  • PARI
    print1(x=0, ", ");for(stride=1,13,x+=stride;y=x+stride+1;for(k=x,y-1,print1(min(k-x,y-k), ", "))) \\ Hugo Pfoertner, Jun 02 2018
    
  • PARI
    apply( {a(n)=if(n,-abs(n*2-(n=sqrtint(8*n-7)\/2)^2)+n)\2}, [0..40]) \\ same as (i - |j - |i-j||)/2 with i=sqrtint(8*n-7)\/2, j=n-i(i-1)/2. - M. F. Hasler, Dec 06 2019
    
  • Python
    from math import isqrt
    def A053616(n): return abs((m:=isqrt(k:=n<<1))*(m+1)-k)>>1 # Chai Wah Wu, Jul 15 2022

Formula

a(n) = (x - |y - |x-y||)/2, when (x,y) is the n-th element in the triangle x >= y >= 1. - M. F. Hasler, Dec 06 2019
a(n) = (1/2)*abs(t^2 + t - 2*n), where t = floor(sqrt(2*n)) = A172471. - Ridouane Oudra, Dec 15 2021
From Ctibor O. Zizka, Nov 12 2024: (Start)
For s >= 1, t from [0, s] :
a(2*s^2 + t) = s - t.
a(2*s^2 - t) = s - t.
a(2*s^2 + 2*s - t) = s - t.
a(2*s^2 + 2*s + 1 + t) = s - t. (End)

A271751 Period 10 zigzag sequence; repeat: [0, 1, 2, 3, 4, 5, 4, 3, 2, 1].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Apr 13 2016

Keywords

Comments

Decimal expansion of 11111/900009. - Elmo R. Oliveira, Mar 03 2024

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).

Programs

  • Magma
    &cat[[0, 1, 2, 3, 4, 5, 4, 3, 2, 1]: n in [0..10]];
    
  • 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]
  • PARI
    a(n) = abs(n-10*round(n/10)); \\ Altug Alkan, Apr 13 2016

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
Showing 1-10 of 24 results. Next