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-3 of 3 results.

A164116 Expansion of (1 - x) * (1 - x^4) / (1 - x^5) in powers of x.

Original entry on oeis.org

1, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1, 2, -1, 0, 0, -1
Offset: 0

Views

Author

Michael Somos, Aug 10 2009

Keywords

Comments

This sequence with a(0) replaced by 2 appears, together with three other sequences, in the formula 2*exp(2*Pi*n*I/5) = 2*T(n,x) + S(n-1,x)*sqrt(2+phi)*I, with x = (phi-1)/2 and I = sqrt(-1), where phi = (1+sqrt(5))/2 (golden section) after reduction of powers using phi^2 = phi+1. T and S are Chebyshev polynomials from A053120 and A049310. This results in 2*exp(2*Pi*n*I/5) = (A(n) + B(n)*phi) + (C(n) + D(n)*phi)*sqrt(2+phi)*I, with A(n) = a(n+5), B(n) = A080891(n), C(n) = A156174(n+4) and D(n) = A010891(n+3) for n >= 0. - Wolfdieter Lang, Feb 26 2014

Examples

			G.f. = 1 - x - x^4 + 2*x^5 - x^6 - x^9 + 2*x^10 - x^11 - x^14 + 2*x^15 - x^16 + ...
exp(2*Pi*3*I/5) = (0 - phi) + (1 - phi)*sqrt(2+phi)*I, with phi = (1+sqrt(5))/2. - _Wolfdieter Lang_, Feb 26 2014
		

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x^4)/(1+x+x^2+x^3+x^4))); // G. C. Greubel, Sep 22 2018
  • Mathematica
    CoefficientList[Series[(1-x)(1-x^4)/(1-x^5),{x,0,110}],x] (* Harvey P. Dale, Sep 25 2013 *)
  • PARI
    {a(n) = -(n==0) + [2, -1, 0, 0, -1][n%5 + 1]};
    

Formula

Euler transform of length 5 sequence [-1, 0, 0, -1, 1].
a(n) = a(-n) for all n in Z. a(n+5) = a(n) unless n=0 or n=-5.
G.f.: (1 - x^4)/(1 + x + x^2 + x^3 + x^4).
a(n) = (-1)^n * A164118(n). Convolution inverse of A164115.
a(n) = 2*0^mod(n,5) - 0^n - mod(mod(n+2,5),2). - Wesley Ivan Hurt, Apr 28 2015

A177704 Period 4: repeat [1, 1, 1, 2].

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, May 11 2010

Keywords

Comments

Continued fraction expansion of (3 + 2*sqrt(6))/5.
Decimal expansion of 1112/9999.
a(n) = A164115(n + 1) = (-1)^(n + 1) * A164117(n + 1) = A138191(n + 3) = A107453(n + 5).

Crossrefs

Programs

  • Magma
    &cat[ [1, 1, 1, 2]: k in [1..27] ];
    
  • Maple
    A177704:=n->floor((n+1)*5/4) - floor(n*5/4): seq(A177704(n), n=0..100); # Wesley Ivan Hurt, Jun 15 2016
  • Mathematica
    Table[Floor[(n + 1)*5/4] - Floor[n*5/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jun 15 2016 *)
    LinearRecurrence[{0, 0, 0, 1}, {1, 1, 1, 2}, 100] (* Vincenzo Librandi, Jun 16 2016 *)
  • PARI
    a(n) = if(n%4==3, 2, 1) \\ Felix Fröhlich, Jun 15 2016

Formula

a(n) = (5-(-1)^n + i*i^n-i*(-i)^n)/4 where i = sqrt(-1).
a(n) = a(n-4) for n > 3; a(0) = 1, a(1) = 1, a(2) = 1, a(3) = 2.
G.f.: (1+x+x^2+2*x^3)/(1-x^4).
a(n) = 1 + (1-(-1)^n) * (1+i^(n+1))/4 where i = sqrt(-1). - Bruno Berselli, Apr 05 2011
a(n) = 5/4 - sin(Pi*n/2)/2 - (-1)^n/4. - R. J. Mathar, Oct 08 2011
a(n) = floor((n+1)*5/4) - floor(n*5/4). - Hailey R. Olafson, Jul 23 2014
From Wesley Ivan Hurt, Jun 15 2016: (Start)
a(n+3) - a(n+2) = A219977(n).
Sum_{i=0..n-1} a(i) = A001068(n). (End)
E.g.f.: (-sin(x) + 3*sinh(x) + 2*cosh(x))/2. - Ilya Gutkovskiy, Jun 15 2016

A186646 Every fourth term of the sequence of natural numbers 1,2,3,4,... is halved.

Original entry on oeis.org

1, 2, 3, 2, 5, 6, 7, 4, 9, 10, 11, 6, 13, 14, 15, 8, 17, 18, 19, 10, 21, 22, 23, 12, 25, 26, 27, 14, 29, 30, 31, 16, 33, 34, 35, 18, 37, 38, 39, 20, 41, 42, 43, 22, 45, 46, 47, 24, 49, 50, 51, 26, 53, 54, 55, 28, 57, 58, 59, 30, 61, 62, 63, 32, 65, 66, 67, 34, 69, 70, 71, 36, 73, 74, 75, 38, 77, 78, 79, 40, 81, 82, 83, 42, 85, 86, 87, 44, 89, 90, 91, 46, 93, 94, 95, 48, 97, 98, 99
Offset: 1

Views

Author

R. J. Mathar, Feb 25 2011

Keywords

Comments

a(n) is the length of the period of the sequence k^2 mod n, k=1,2,3,4,..., i.e., the length of the period of A000035 (n=2), A011655 (n=3), A000035 (n=4), A070430 (n=5), A070431 (n=6), A053879 (n=7), A070432 (n=8), A070433 (n=9), A008959 (n=10), A070434 (n=11), A070435 (n=12) etc.
From Franklin T. Adams-Watters, Feb 24 2011: (Start)
Clearly if gcd(n,m) = 1, a(nm) = lcm(a(n),a(m)), so it suffices to establish this for prime powers.
If p is a prime, the period must divide p, but k^2 mod p is not constant, so a(p) = p.
a(p^e), e > 1, must be divisible by a(p^(e-1)), and must divide p^e. If p != 2, (p^(e-1)+1)^2 = p^(2e-2)+2p^(e-1)+1 == 2p^(e-1)+1 (mod p^2), so a(p^e) != p^(e-1); it must then be e.
By inspection, a(4) = 2 and a(8) = 4.
This leaves a(2^e), e > 3. But then (2^(e-2)+1)^2 = 2^(2e-4)+2^(e-1)+1 == 2^(e-1)+1 (mod 2^e), so a(n) > 2^(e-2). On the other hand, (2^(e-1)+c)^2 = 2^(2e-2)+c2^e+c^2 == c^2 (mod 2^e). Hence the period is 2^(e-1). (End)

Crossrefs

Cf. A000224 (size of the set of moduli of k^2 mod n), A019554, A060819, A061037, A090129, A142705, A164115, A283971.

Programs

  • Maple
    A186646 := proc(n) if n mod 4 = 0 then n/2 ; else n ; end if; end proc ;
  • Mathematica
    Flatten[Table[{n,n+1,n+2,(n+3)/2},{n,1,101,4}]] (* or *) LinearRecurrence[ {0,0,0,2,0,0,0,-1},{1,2,3,2,5,6,7,4},100] (* Harvey P. Dale, May 30 2014 *)
    Table[n (7 - (-1)^n - 2 Cos[n Pi/2])/8, {n, 100}] (* Federico Provvedi , Jan 02 2018 *)
  • PARI
    a(n)=if(n%4,n,n/2) \\ Charles R Greathouse IV, Oct 16 2015
    
  • Python
    def A186646(n): return n if n&3 else n>>1 # Chai Wah Wu, Jan 10 2023

Formula

a(n) = 2*a(n-4) - a(n-8).
a(4n) = 2n; a(4n+1) = 4n+1; a(4n+2) = 4n+2; a(4n+3) = 4n+3.
a(n) = n/A164115(n).
G.f.: x*(1 + 2*x + 3*x^2 + 2*x^3 + 3*x^4 + 2*x^5 + x^6) / ( (x-1)^2*(1+x)^2*(x^2+1)^2 ).
Dirichlet g.f.: (1-2/4^s)*zeta(s-1).
A019554(n) | a(n). - Charles R Greathouse IV, Feb 24 2011
a(n) = n*(7 - (-1)^n - (-i)^n - i^n)/8, with i=sqrt(-1). - Bruno Berselli, Feb 25 2011
Multiplicative with a(p^e)=2^e if p=2 and e<=1; a(p^e)=2^(e-1) if p=2 and e>=2; a(p^e)=p^e otherwise. - David W. Wilson, Feb 26 2011
a(n) * A060819(n+2) = A142705(n+1) = A061037(2n+2). - Paul Curtz, Mar 02 2011
a(n) = n - (n/2)*floor(((n-1) mod 4)/3). - Gary Detlefs, Apr 14 2013
a(2^n) = A090129(n+1). - R. J. Mathar, Oct 09 2014
a(n) = n*(7 - (-1)^n - 2*cos(n*Pi/2))/8. - Federico Provvedi, Jan 02 2018
E.g.f.: (1/4)*x*(4*cosh(x) + sin(x) + 3*sinh(x)). - Stefano Spezia, Jan 26 2020
Sum_{k=1..n} a(k) ~ (7/16) * n^2. - Amiram Eldar, Nov 28 2022
Showing 1-3 of 3 results.