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.

A166486 Periodic sequence [0,1,1,1] of length 4; Characteristic function of numbers that are not multiples of 4.

Original entry on oeis.org

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

Views

Author

Jaume Oliver Lafont, Oct 15 2009

Keywords

Examples

			G.f. = x + x^2 + x^3 + x^5 + x^6 + x^7 + x^9 + x^10 + x^11 + x^13 + x^14 + ...
		

Crossrefs

Characteristic function of A042968, whose complement A008586 gives the positions of zeros (after its initial term).
Absolute values of A046978, A075553, A131729, A358839, and for n >= 1, also of A112299 and of A257196.
Sequence A152822 shifted by two terms.
Row 3 of A225145, Column 2 of A229940 (after the initial term).
First differences of A057353. Sum of A359370 and A359372.
Cf. A000035, A011655, A011558, A097325, A109720, A168181, A168182, A168184, A145568, A168185 (characteristic functions for numbers that are not multiples of k = 2, 3 and 5..12).
Cf. A010873, A033436, A069733 (inverse Möbius transform), A121262 (one's complement), A190621 [= n*a(n)], A355689 (Dirichlet inverse).

Programs

  • Magma
    [Ceiling(n/4)-Floor(n/4) : n in [0..50]]; // Wesley Ivan Hurt, Jun 20 2014
    
  • Maple
    seq(1/2*((n^3+n) mod 4), n=0..50); # Gary Detlefs, Mar 20 2010
  • Mathematica
    PadRight[{},120,{0,1,1,1}] (* Harvey P. Dale, Jul 04 2013 *)
    Table[Ceiling[n/4] - Floor[n/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jun 20 2014 *)
    a[ n_] := Sign[ Mod[n, 4]]; (* Michael Somos, May 05 2015 *)
  • PARI
    {a(n) = !!(n%4)};
    
  • Python
    def A166486(n): return (0,1,1,1)[n&3] # Chai Wah Wu, Jan 03 2023

Formula

G.f.: (x + x^2 + x^3) / (1 - x^4) = x * (1 + x + x^2) / ((1 - x) * (1 + x) * (1 + x^2)) = x * (1 - x^3) / ((1 - x) * (1 - x^4)).
a(n) = (3 - i^n - (-i)^n - (-1)^n) / 4, where i=sqrt(-1).
Sum_{k>0} a(k)/(k*3^k) = log(5)/4.
From Reinhard Zumkeller, Nov 30 2009: (Start)
Multiplicative with a(p^e) = (if p=2 then 0^(e-1) else 1), p prime and e>0.
a(n) = 1-A121262(n).
a(A042968(n))=1; a(A008586(n))=0.
A033436(n) = Sum{k=0..n} a(k)*(n-k). (End)
a(n) = 1/2*((n^3+n) mod 4). - Gary Detlefs, Mar 20 2010
a(n) = (Fibonacci(n)*Fibonacci(3n) mod 3)/2. - Gary Detlefs Dec 21 2010
Euler transform of length 4 sequence [ 1, 0, -1, 1]. - Michael Somos, Feb 12 2011
Dirichlet g.f. (1-1/4^s)*zeta(s). - R. J. Mathar, Feb 19 2011
a(n) = Fibonacci(n)^2 mod 3. - Gary Detlefs, May 16 2011
a(n) = -1/4*cos(Pi*n)-1/2*cos(1/2*Pi*n)+3/4. - Leonid Bedratyuk, May 13 2012
For the general case: the characteristic function of numbers that are not multiples of m is a(n)=floor((n-1)/m)-floor(n/m)+1, m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = ceiling(n/4) - floor(n/4). - Wesley Ivan Hurt, Jun 20 2014
a(n) = a(-n) for all n in Z. - Michael Somos, May 05 2015
For n >= 1, a(n) = A053866(A225546(n)) = A000035(A331733(n)). - Antti Karttunen, Jul 07 2020
a(n) = signum(n mod 4). - Alois P. Heinz, May 12 2021
From Antti Karttunen, Dec 28 2022: (Start)
a(n) = [A010873(n) > 0], where [ ] is the Iverson bracket.
a(n) = abs(A046978(n)) = abs(A075553(n)) = abs(A131729(n)) = abs(A358839(n)).
For all n >= 1, a(n) = abs(A112299(n)) = abs(A257196(n))
a(n) = A152822(2+n).
a(n) = A359370(n) + A359372(n). (End)
E.g.f.: (cosh(x) - cos(x))/2 + sinh(x). - Stefano Spezia, Aug 04 2025

Extensions

Secondary definition (from Reinhard Zumkeller's Nov 30 2009 comment) added to the name by Antti Karttunen, Dec 20 2022

A257196 Expansion of (1 + x) * (1 + x^5) / ((1 + x^2) * (1 + x^4)) in powers of x.

Original entry on oeis.org

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

Views

Author

Michael Somos, Apr 17 2015

Keywords

Examples

			G.f. = 1 + x - x^2 - x^3 + x^5 + x^6 - x^7 + x^9 - x^10 - x^11 + x^13 + ...
		

Crossrefs

Cf. A112299.

Programs

  • Magma
    m:=60; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + x)*(1 + x^5)/((1 + x^2)*(1 + x^4)))); // G. C. Greubel, Aug 02 2018
  • Mathematica
    a[ n_] := Boole[n == 0] + {1, -1, -1, 0, 1, 1, -1, 0}[[Mod[ n, 8, 1]]];
    a[ n_] := If[ n == 0, 1, Sign[ n] SeriesCoefficient[ (1 + x) * (1 + x^5) / ((1 + x^2) * (1 + x^4)), {x, 0, Abs @ n}]];
    CoefficientList[Series[(1 + x)*(1 + x^5)/((1 + x^2)*(1 + x^4)), {x, 0, 60}], x] (* G. C. Greubel, Aug 02 2018 *)
    LinearRecurrence[{0,-1,0,-1,0,-1},{1,1,-1,-1,0,1,1},100] (* Harvey P. Dale, Nov 16 2022 *)
  • PARI
    {a(n) = (n==0) + [0, 1, -1, -1, 0, 1, 1, -1][n%8 + 1]};
    
  • PARI
    {a(n) = if( n==0, 1, n%2, (-1)^(n\2), n%4 == 2, -(-1)^(n\4), 0)};
    
  • PARI
    {a(n) = if( n==0, 1, sign(n) * polcoeff( (1 + x) * (1 + x^5) / ((1 + x^2) * (1 + x^4)) + x * O(x^abs(n)), abs(n)))};
    
  • PARI
    x='x+O('x^60); Vec((1 + x)*(1 + x^5)/((1 + x^2)*(1 + x^4))) \\ G. C. Greubel, Aug 02 2018
    

Formula

Euler transform of length 10 sequence [1, -2, 0, 0, 1, 0, 0, 1, 0, -1].
a(n) is multiplicative with a(2) = -1, a(2^e) = 0 if e>1, a(p^e) = 1 if p == 1 (mod 4), a(p^e) = (-1)^e if p == 3 (mod 4) and a(0) = 1.
G.f.: 1 + x / (1 + x^2) - x^2 / (1 + x^4).
G.f.: (1 + x) * (1 + x^5) / ((1 + x^2) * (1 + x^4)).
a(n) = -a(-n) for all n in Z unless n = 0. a(n+8) = a(n) unless n=0 or n=-8. a(4*n) = 0 unless n=0.
a(n) = A112299(n) unless n=0. - R. J. Mathar, Apr 19 2015

A239466 Expansion of (1 - x + x^2 + sqrt(1 + 2*x + 3*x^2 - 2*x^3 + x^4)) / 2 in powers of x.

Original entry on oeis.org

1, 0, 1, -1, 1, 0, -2, 4, -3, -5, 20, -29, 1, 94, -221, 191, 327, -1454, 2282, -162, -8002, 19902, -18275, -30505, 143511, -234364, 24437, 841723, -2164873, 2069014, 3325410, -16315410, 27375369, -3714435, -98829168, 260605269, -257026289, -395719442
Offset: 0

Views

Author

Michael Somos, Mar 19 2014

Keywords

Examples

			G.f. = 1 + x^2 - x^3 + x^4 - 2*x^6 + 4*x^7 - 3*x^8 - 5*x^9 + 20*x^10 + ...
		

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Rationals(), m); Coefficients(R!((1-x+x^2 +Sqrt(1+2*x+3*x^2-2*x^3+x^4))/2)); // G. C. Greubel, Aug 08 2018
  • Mathematica
    CoefficientList[Series[(1-x+x^2 +Sqrt[1+2*x+3*x^2-2*x^3+x^4])/2, {x, 0, 50}], x] (* G. C. Greubel, Aug 08 2018 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 - x + x^2 + sqrt(1 + 2*x + 3*x^2 - 2*x^3 + x^4 + x * O(x^n))) / 2, n))};
    
  • PARI
    {a(n) = my(A = 1 + O(x)); for(k=1, ceil(n / 3), A = 1 + x^2 / (1 + x / A)); polcoeff(A, n)};
    

Formula

G.f.: 1 - x + x^2 + x / (1 - x + x^2 + x / (1 - x + x^2 + x / ...)). (continued fraction convergence is one power series term per iteration).
G.f.: 1 + x^2 / (1 + x / (1 + x^2 / (1 + x / ...))). (continued fraction convergence is three power series terms per iteration).
a(n) = - A129509(n) if n>2.
HANKEL transform is period 8 sequence A112299(n+5) = [1, 1, -1, 0, 1, -1, -1, 0, ...].
HANKEL transform of a(n+1) is period 8 sequence -A112299(n+4) = [0, -1, -1, 1, 0, -1, 1, 1, ...].
D-finite with recurrence: n*a(n) +(2*n-3)*a(n-1) +3*(n-3)*a(n-2) +(-2*n+9)*a(n-3) +(n-6)*a(n-4)=0. - R. J. Mathar, Jan 25 2020
Showing 1-3 of 3 results.