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

A046897 Sum of divisors of n that are not divisible by 4.

Original entry on oeis.org

1, 3, 4, 3, 6, 12, 8, 3, 13, 18, 12, 12, 14, 24, 24, 3, 18, 39, 20, 18, 32, 36, 24, 12, 31, 42, 40, 24, 30, 72, 32, 3, 48, 54, 48, 39, 38, 60, 56, 18, 42, 96, 44, 36, 78, 72, 48, 12, 57, 93, 72, 42, 54, 120, 72, 24, 80, 90, 60, 72, 62, 96, 104, 3, 84, 144, 68, 54, 96, 144, 72
Offset: 1

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
The o.g.f. is (theta_3(0,x)^4 - 1)/8, see the Hardy reference, eqs. 9.2.1, 9.2.3 and 9.2.4 on p. 133 for Sum' m*u_m. Also Hardy-Wright, p. 314. See also the Somos, Jan 25 2008 formula below. - Wolfdieter Lang, Dec 11 2016

Examples

			G.f. = q + 3*q^2 + 4*q^3 + 3*q^4 + 6*q^5 + 12*q^6 + 8*q^7 + 3*q^8 + 13*q^9 + ...
		

References

  • J. M. Borwein, D. H. Bailey and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 194.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, AMS Chelsea Publishing, Providence, Rhode Island 2002, p. 133.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Clarendon Press, Oxford, Fifth edition, 1979, p. 314.
  • P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 31, Article 273.
  • C. J. Moreno and S. S. Wagstaff, Jr., Sums of Squares of Integers, Chapman & Hall, 2006.

Crossrefs

Cf. A000203, A000118, A051731, A069733, A027748, A124010, A190621, A000593 (not divis. by 2), A046913 (not divis. by 3), A116073 (not divis. by 5).

Programs

  • Haskell
    a046897 1 = 1
    a046897 n = product $ zipWith
                (\p e -> if p == 2 then 3 else div (p ^ (e + 1) - 1) (p - 1))
                (a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, Aug 12 2015
  • Magma
    A := Basis( ModularForms( Gamma0(4), 2), 72); B := (A[1] - 1)/8 + A[2]; B; /* Michael Somos, Dec 30 2014 */
    
  • Maple
    A046897 := proc(n) if n mod 4 = 0 then numtheory[sigma](n)-4*numtheory[sigma](n/4) ; else numtheory[sigma](n) ; end if; end proc: # R. J. Mathar, Mar 23 2011
  • Mathematica
    a[n_] := Sum[ Boole[ !Divisible[d, 4]]*d, {d, Divisors[n]}]; Table[ a[n], {n, 1, 71}] (* Jean-François Alcover, Dec 12 2011 *)
    DivisorSum[#1, # &, Mod[#, 4] != 0 &] & /@ Range[71] (* Jayanta Basu, Jun 30 2013 *)
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q]^4 - 1) / 8, {q, 0, n}]; (* Michael Somos, Dec 30 2014 *)
    f[2, e_] := 3; f[p_, e_] := (p^(e+1)-1)/(p-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 15 2020 *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, if(d%4, d)))};
    

Formula

a(n) = (-1)^(n+1)*Sum_{d divides n} (-1)^(n/d+d)*d. Multiplicative with a(2^e) = 3, a(p^e) = (p^(e+1)-1)/(p-1) for an odd prime p. - Vladeta Jovovic, Sep 10 2002 [For a proof of the multiplicative property, see for example Moreno and Wagstaff, p. 33. - N. J. A. Sloane, Nov 09 2016]
G.f.: Sum_{k>0} x^k/(1+(-x)^k)^2, or Sum_{k>0} k*x^k/(1+(-x)^k). - Vladeta Jovovic, Dec 16 2002
Expansion of (1 - phi(q)^4) / 8 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Jan 25 2008
Equals inverse Mobius transform of A190621. - Gary W. Adamson, Jul 03 2008
A000118(n) = 8*a(n) for all n>0.
Dirichlet g.f.: (1 - 4^(1-s)) * zeta(s) * zeta(s-1). - Michael Somos, Oct 21 2015
L.g.f.: log(Product_{k>=1} (1 - x^(4*k))/(1 - x^k)) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Mar 14 2018
From Peter Bala, Dec 19 2021: (Start)
Logarithmic g.f.: Sum_{n >= 1} a(n)*x^n/n = Sum_{n >= 1} x^n*(1 + x^n + x^(2*n))/( n*(1 - x^(4*n)) )
G.f.: Sum_{n >= 1} x^n*(x^(6*n) + 2*x^(5*n) + 3*x^(4*n) + 3*x^(2*n) + 2*x^n + 1)/(1 - x^(4*n))^2. (End)
Sum_{k=1..n} a(k) ~ (Pi^2/16) * n^2. - Amiram Eldar, Oct 04 2022

A266491 a(n) = n*A130658(n).

Original entry on oeis.org

0, 1, 4, 6, 4, 5, 12, 14, 8, 9, 20, 22, 12, 13, 28, 30, 16, 17, 36, 38, 20, 21, 44, 46, 24, 25, 52, 54, 28, 29, 60, 62, 32, 33, 68, 70, 36, 37, 76, 78, 40, 41, 84, 86, 44, 45, 92, 94, 48, 49, 100, 102, 52, 53, 108, 110, 56, 57, 116, 118, 60, 61, 124, 126, 64
Offset: 0

Views

Author

Paul Curtz, Dec 30 2015

Keywords

Comments

Successive differences:
r(0): 0, 1, 4, 6, 4, 5, 12, 14, ...
r(1): 1, 3, 2, -2, 1, 7, 2, -6, ...
r(2): 2, -1, -4, 3, 6, -5, -8, 7, ... (see A103889)
r(3): -3, -3, 7, 3, -11, -3, 15, 3, ...
r(4): 0, 10, -4, -14, 8, 18, -12, -22, ...
r(5): 10, -14, -10, 22, 10, -30, -10, 38, ...
r(6): -24, 4, 32, -12, -40, 20, 48, -28, ...
r(7): 28, 28, -44, -28, 60, 28, -76, -28, ...
r(8): 0, -72, 16, 88, -32, -104, 48, 120, ...
r(9): -72, 88, 72, -120, -72, 152, 72, -184, ...
r(10): 160, -16, -192, 48, 224, -80, -256, 112, ...
etc.
Let b(n) = 1, 1, 1, 1, 2, 2, 4, 4, 8, 8, 16, 16, ..., with n>=0, which is formed from the terms of A011782 repeated twice.
Conjecture: all terms of the row r(i) are divisible by b(i).
Conjecture: the terms of the first column divided by b(n) provide 0, 1, 2, -3, 0, 5, -6, 7, 0, -9, 10, -11, ..., the absolute values of which are listed in A190621.

Crossrefs

Programs

  • Magma
    [n*(3-(-1)^((n-1)*n div 2))/2: n in [0..70]]; // Vincenzo Librandi, Jan 08 2016
  • Mathematica
    Table[n (3 - (-1)^((n - 1) n/2))/2, {n, 0, 55}]
    Table[n (Boole@ OddQ@ Floor[n/2] + 1), {n, 0, 55}] (* or *) Table[SeriesCoefficient[x (3/(1 - x)^2 + 2 x/(1 + x^2)^2 - (1 - x^2)/(1 + x^2)^2)/2, {x, 0, n}], {n, 0, 55}] (* Michael De Vlieger, Jan 04 2016 *)
  • PARI
    vector(60, n, n--; n*(3-(-1)^((n-1)*n/2))/2) \\ Altug Alkan, Jan 04 2016
    

Formula

a(n) = n*(3 - (-1)^((n-1)*n/2))/2.
a(n) = a(n-4) + 4*A130658(n) for n>3.
a(n) = 2*a(n-1) -3*a(n-2) +4*a(n-3) -3*(n-4) +2*a(n-5) -a(n-6) for n>5.
G.f.: x*(3/(1 - x)^2 + 2*x/(1 + x^2)^2 - (1 - x^2)/(1 + x^2)^2)/2. - Michael De Vlieger, Jan 04 2016

Extensions

Edited by Bruno Berselli, Jan 07 2016
Showing 1-3 of 3 results.