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 107 results. Next

A000796 Decimal expansion of Pi (or digits of Pi).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Sometimes called Archimedes's constant.
Ratio of a circle's circumference to its diameter.
Also area of a circle with radius 1.
Also surface area of a sphere with diameter 1.
A useful mnemonic for remembering the first few terms: How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics ...
Also ratio of surface area of sphere to one of the faces of the circumscribed cube. Also ratio of volume of a sphere to one of the six inscribed pyramids in the circumscribed cube. - Omar E. Pol, Aug 09 2012
Also surface area of a quarter of a sphere of radius 1. - Omar E. Pol, Oct 03 2013
Also the area under the peak-shaped even function f(x)=1/cosh(x). Proof: for the upper half of the integral, write f(x) = (2*exp(-x))/(1+exp(-2x)) = 2*Sum_{k>=0} (-1)^k*exp(-(2k+1)*x) and integrate term by term from zero to infinity. The result is twice the Gregory series for Pi/4. - Stanislav Sykora, Oct 31 2013
A curiosity: a 144 X 144 magic square of 7th powers was recently constructed by Toshihiro Shirakawa. The magic sum = 3141592653589793238462643383279502884197169399375105, which is the concatenation of the first 52 digits of Pi. See the MultiMagic Squares link for details. - Christian Boyer, Dec 13 2013 [Comment revised by N. J. A. Sloane, Aug 27 2014]
x*Pi is also the surface area of a sphere whose diameter equals the square root of x. - Omar E. Pol, Dec 25 2013
Also diameter of a sphere whose surface area equals the volume of the circumscribed cube. - Omar E. Pol, Jan 13 2014
From Daniel Forgues, Mar 20 2015: (Start)
An interesting anecdote about the base-10 representation of Pi, with 3 (integer part) as first (index 1) digit:
358 0
359 3
360 6
361 0
362 0
And the circle is customarily subdivided into 360 degrees (although Pi radians yields half the circle)...
(End)
Sometimes referred to as Archimedes's constant, because the Greek mathematician computed lower and upper bounds of Pi by drawing regular polygons inside and outside a circle. In Germany it was called the Ludolphian number until the early 20th century after the Dutch mathematician Ludolph van Ceulen (1540-1610), who calculated up to 35 digits of Pi in the late 16th century. - Martin Renner, Sep 07 2016
As of the beginning of 2019 more than 22 trillion decimal digits of Pi are known. See the Wikipedia article "Chronology of computation of Pi". - Harvey P. Dale, Jan 23 2019
On March 14, 2019, Emma Haruka Iwao announced the calculation of 31.4 trillion digits of Pi using Google Cloud's infrastructure. - David Radcliffe, Apr 10 2019
Also volume of three quarters of a sphere of radius 1. - Omar E. Pol, Aug 16 2019
On August 5, 2021, researchers from the University of Applied Sciences of the Grisons in Switzerland announced they had calculated 62.8 trillion digits. Guinness World Records has not verified this yet. - Alonso del Arte, Aug 23 2021
The Hermite-Lindemann (1882) theorem states, that if z is a nonzero algebraic number, then e^z is a transcendent number. The transcendence of Pi then results from Euler's relation: e^(i*Pi) = -1. - Peter Luschny, Jul 21 2023
The 10000 words of the book "Not A Wake" by Michael Keith, written in Pilish, match in length the first 10000 digits of Pi. - Paolo Xausa, Aug 07 2025

Examples

			3.1415926535897932384626433832795028841971693993751058209749445923078164062\
862089986280348253421170679821480865132823066470938446095505822317253594081\
284811174502841027019385211055596446229489549303819...
		

References

  • Mohammad K. Azarian, A Summary of Mathematical Works of Ghiyath ud-din Jamshid Kashani, Journal of Recreational Mathematics, Vol. 29(1), pp. 32-42, 1998.
  • J. Arndt & C. Haenel, Pi Unleashed, Springer NY 2001.
  • P. Beckmann, A History of Pi, Golem Press, Boulder, CO, 1977.
  • Florian Cajori, A History of Mathematical Notations, Dover edition (2012), par. 396.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 24, 237-239.
  • J.-P. Delahaye, Le fascinant nombre pi, Pour la Science, Paris 1997.
  • P. Eyard and J.-P. Lafon, The Number Pi, Amer. Math. Soc., 2004.
  • S. R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, Section 1.4.
  • Le Petit Archimede, Special Issue On Pi, Supplement to No. 64-5, May 1980 ADCS Amiens.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 31.
  • 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).
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 1, equations 1:7:1, 1:7:2 at pages 12-13.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See pp. 48-55.

Crossrefs

Cf. A001203 (continued fraction).
Pi in base b: A004601 (b=2), A004602 (b=3), A004603 (b=4), A004604 (b=5), A004605 (b=6), A004606 (b=7), A006941 (b=8), A004608 (b=9), this sequence (b=10), A068436 (b=11), A068437 (b=12), A068438 (b=13), A068439 (b=14), A068440 (b=15), A062964 (b=16), A224750 (b=26), A224751 (b=27), A060707 (b=60). - Jason Kimberley, Dec 06 2012
Decimal expansions of expressions involving Pi: A002388 (Pi^2), A003881 (Pi/4), A013661 (Pi^2/6), A019692 (2*Pi=tau), A019727 (sqrt(2*Pi)), A059956 (6/Pi^2), A060294 (2/Pi), A091925 (Pi^3), A092425 (Pi^4), A092731 (Pi^5), A092732 (Pi^6), A092735 (Pi^7), A092736 (Pi^8), A163973 (Pi/log(2)).
Cf. A001901 (Pi/2; Wallis), A002736 (Pi^2/18; Euler), A007514 (Pi), A048581 (Pi; BBP), A054387 (Pi; Newton), A092798 (Pi/2), A096954 (Pi/4; Machin), A097486 (Pi), A122214 (Pi/2), A133766 (Pi/4 - 1/2), A133767 (5/6 - Pi/4), A166107 (Pi; MGL).

Programs

  • Haskell
    -- see link: Literate Programs
    import Data.Char (digitToInt)
    a000796 n = a000796_list (n + 1) !! (n + 1)
    a000796_list len = map digitToInt $ show $ machin' `div` (10 ^ 10) where
       machin' = 4 * (4 * arccot 5 unity - arccot 239 unity)
       unity = 10 ^ (len + 10)
       arccot x unity = arccot' x unity 0 (unity `div` x) 1 1 where
         arccot' x unity summa xpow n sign
          | term == 0 = summa
          | otherwise = arccot'
            x unity (summa + sign * term) (xpow `div` x ^ 2) (n + 2) (- sign)
          where term = xpow `div` n
    -- Reinhard Zumkeller, Nov 24 2012
    
  • Haskell
    -- See Niemeijer link and also Gibbons link.
    a000796 n = a000796_list !! (n-1) :: Int
    a000796_list = map fromInteger $ piStream (1, 0, 1)
       [(n, a*d, d) | (n, d, a) <- map (\k -> (k, 2 * k + 1, 2)) [1..]] where
       piStream z xs'@(x:xs)
         | lb /= approx z 4 = piStream (mult z x) xs
         | otherwise = lb : piStream (mult (10, -10 * lb, 1) z) xs'
         where lb = approx z 3
               approx (a, b, c) n = div (a * n + b) c
               mult (a, b, c) (d, e, f) = (a * d, a * e + b * f, c * f)
    -- Reinhard Zumkeller, Jul 14 2013, Jun 12 2013
    
  • Macsyma
    py(x) := if equal(6,6+x^2) then 2*x else (py(x:x/3),3*%%-4*(%%-x)^3); py(3.); py(dfloat(%)); block([bfprecision:35], py(bfloat(%))) /* Bill Gosper, Sep 09 2002 */
    
  • Magma
    pi:=Pi(RealField(110)); Reverse(Intseq(Floor(10^105*pi))); // Bruno Berselli, Mar 12 2013
    
  • Maple
    Digits := 110: Pi*10^104:
    ListTools:-Reverse(convert(floor(%), base, 10)); # Peter Luschny, Oct 29 2019
  • Mathematica
    RealDigits[ N[ Pi, 105]] [[1]]
    Table[ResourceFunction["NthDigit"][Pi, n], {n, 1, 102}] (* Joan Ludevid, Jun 22 2022; easy to compute a(10000000)=7 with this function; requires Mathematica 12.0+ *)
  • PARI
    { default(realprecision, 20080); x=Pi; for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b000796.txt", n, " ", d)); } \\ Harry J. Smith, Apr 15 2009
    
  • PARI
    A796=[]; A000796(n)={if(n>#A796, localprec(n*6\5+29); A796=digits(Pi\.1^(precision(Pi)-3))); A796[n]} \\ NOTE: as the other programs, this returns the n-th term of the sequence, with n = 1, 2, 3, ... and not n = 1, 0, -1, -2, .... - M. F. Hasler, Jun 21 2022
    
  • PARI
    first(n)= default(realprecision, n+10); digits(floor(Pi*10^(n-1))) \\ David A. Corneth, Jun 21 2022
    
  • PARI
    lista(nn, p=20)= {my(u=10^(nn+p+1), f(x, u)=my(n=1, q=u\x, r=q, s=1, t); while(t=(q\=(x*x))\(n+=2), r+=(s=-s)*t); r*4); digits((4*f(5, u)-f(239, u))\10^(p+2)); } \\ Machin-like, with p > the maximal number of consecutive 9-digits to be expected (A048940) - Ruud H.G. van Tol, Dec 26 2024
    
  • Python
    from sympy import pi, N; print(N(pi, 1000)) # David Radcliffe, Apr 10 2019
    
  • Python
    from mpmath import mp
    def A000796(n):
        if n >= len(A000796.str): mp.dps = n*6//5+50; A000796.str = str(mp.pi-5/mp.mpf(10)**mp.dps)
        return int(A000796.str[n if n>1 else 0])
    A000796.str = '' # M. F. Hasler, Jun 21 2022
    
  • SageMath
    m=125
    x=numerical_approx(pi, digits=m+5)
    a=[ZZ(i) for i in x.str(skip_zeroes=True) if i.isdigit()]
    a[:m] # G. C. Greubel, Jul 18 2023

Formula

Pi = 4*Sum_{k>=0} (-1)^k/(2k+1) [Madhava-Gregory-Leibniz, 1450-1671]. - N. J. A. Sloane, Feb 27 2013
From Johannes W. Meijer, Mar 10 2013: (Start)
2/Pi = (sqrt(2)/2) * (sqrt(2 + sqrt(2))/2) * (sqrt(2 + sqrt(2 + sqrt(2)))/2) * ... [Viete, 1593]
2/Pi = Product_{k>=1} (4*k^2-1)/(4*k^2). [Wallis, 1655]
Pi = 3*sqrt(3)/4 + 24*(1/12 - Sum_{n>=2} (2*n-2)!/((n-1)!^2*(2*n-3)*(2*n+1)*2^(4*n-2))). [Newton, 1666]
Pi/4 = 4*arctan(1/5) - arctan(1/239). [Machin, 1706]
Pi^2/6 = 3*Sum_{n>=1} 1/(n^2*binomial(2*n,n)). [Euler, 1748]
1/Pi = (2*sqrt(2)/9801) * Sum_{n>=0} (4*n)!*(1103+26390*n)/((n!)^4*396^(4*n)). [Ramanujan, 1914]
1/Pi = 12*Sum_{n>=0} (-1)^n*(6*n)!*(13591409 + 545140134*n)/((3*n)!*(n!)^3*(640320^3)^(n+1/2)). [David and Gregory Chudnovsky, 1989]
Pi = Sum_{n>=0} (1/16^n) * (4/(8*n+1) - 2/(8*n+4) - 1/(8*n+5) - 1/(8*n+6)). [Bailey-Borwein-Plouffe, 1989] (End)
Pi = 4 * Sum_{k>=0} 1/(4*k+1) - 1/(4*k+3). - Alexander R. Povolotsky, Dec 25 2008
Pi = 4*sqrt(-1*(Sum_{n>=0} (i^(2*n+1))/(2*n+1))^2). - Alexander R. Povolotsky, Jan 25 2009
Pi = Integral_{x=-oo..oo} dx/(1+x^2). - Mats Granvik and Gary W. Adamson, Sep 23 2012
Pi - 2 = 1/1 + 1/3 - 1/6 - 1/10 + 1/15 + 1/21 - 1/28 - 1/36 + 1/45 + ... [Jonas Castillo Toloza, 2007], that is, Pi - 2 = Sum_{n>=1} (1/((-1)^floor((n-1)/2)*(n^2+n)/2)). - José de Jesús Camacho Medina, Jan 20 2014
Pi = 3 * Product_{t=img(r),r=(1/2+i*t) root of zeta function} (9+4*t^2)/(1+4*t^2) <=> RH is true. - Dimitris Valianatos, May 05 2016
From Ilya Gutkovskiy, Aug 07 2016: (Start)
Pi = Sum_{k>=1} (3^k - 1)*zeta(k+1)/4^k.
Pi = 2*Product_{k>=2} sec(Pi/2^k).
Pi = 2*Integral_{x>=0} sin(x)/x dx. (End)
Pi = 2^{k + 1}*arctan(sqrt(2 - a_{k - 1})/a_k) at k >= 2, where a_k = sqrt(2 + a_{k - 1}) and a_1 = sqrt(2). - Sanjar Abrarov, Feb 07 2017
Pi = Integral_{x = 0..2} sqrt(x/(2 - x)) dx. - Arkadiusz Wesolowski, Nov 20 2017
Pi = lim_{n->oo} 2/n * Sum_{m=1,n} ( sqrt( (n+1)^2 - m^2 ) - sqrt( n^2 - m^2 ) ). - Dimitri Papadopoulos, May 31 2019
From Peter Bala, Oct 29 2019: (Start)
Pi = Sum_{n >= 0} 2^(n+1)/( binomial(2*n,n)*(2*n + 1) ) - Euler.
More generally, Pi = (4^x)*x!/(2*x)! * Sum_{n >= 0} 2^(n+1)*(n+x)!*(n+2*x)!/(2*n+2*x+1)! = 2*4^x*x!^2/(2*x+1)! * hypergeom([2*x+1,1], [x+3/2], 1/2), valid for complex x not in {-1,-3/2,-2,-5/2,...}. Here, x! is shorthand notation for the function Gamma(x+1). This identity may be proved using Gauss's second summation theorem.
Setting x = 3/4 and x = -1/4 (resp. x = 1/4 and x = -3/4) in the above identity leads to series representations for the constant A085565 (resp. A076390). (End)
Pi = Im(log(-i^i)) = log(i^i)*(-2). - Peter Luschny, Oct 29 2019
From Amiram Eldar, Aug 15 2020: (Start)
Equals 2 + Integral_{x=0..1} arccos(x)^2 dx.
Equals Integral_{x=0..oo} log(1 + 1/x^2) dx.
Equals Integral_{x=0..oo} log(1 + x^2)/x^2 dx.
Equals Integral_{x=-oo..oo} exp(x/2)/(exp(x) + 1) dx. (End)
Equals 4*(1/2)!^2 = 4*Gamma(3/2)^2. - Gary W. Adamson, Aug 23 2021
From Peter Bala, Dec 08 2021: (Start)
Pi = 32*Sum_{n >= 1} (-1)^n*n^2/((4*n^2 - 1)*(4*n^2 - 9))= 384*Sum_{n >= 1} (-1)^(n+1)*n^2/((4*n^2 - 1)*(4*n^2 - 9)*(4*n^2 - 25)).
More generally, it appears that for k = 1,2,3,..., Pi = 16*(2*k)!*Sum_{n >= 1} (-1)^(n+k+1)*n^2/((4*n^2 - 1)* ... *(4*n^2 - (2*k+1)^2)).
Pi = 32*Sum_{n >= 1} (-1)^(n+1)*n^2/(4*n^2 - 1)^2 = 768*Sum_{n >= 1} (-1)^(n+1)*n^2/((4*n^2 - 1)^2*(4*n^2 - 9)^2).
More generally, it appears that for k = 0,1,2,..., Pi = 16*Catalan(k)*(2*k)!*(2*k+2)!*Sum_{n >= 1} (-1)^(n+1)*n^2/((4*n^2 - 1)^2* ... *(4*n^2 - (2*k+1)^2)^2).
Pi = (2^8)*Sum_{n >= 1} (-1)^(n+1)*n^2/(4*n^2 - 1)^4 = (2^17)*(3^5)*Sum_{n >= 2} (-1)^n*n^2*(n^2 - 1)/((4*n^2 - 1)^4*(4*n^2 - 9)^4) = (2^27)*(3^5)*(5^5)* Sum_{n >= 3} (-1)^(n+1)*n^2*(n^2 - 1)*(n^2 - 4)/((4*n^2 - 1)^4*(4*n^2 - 9)^4*(4*n^2 - 25)^4). (End)
For odd n, Pi = (2^(n-1)/A001818((n-1)/2))*gamma(n/2)^2. - Alan Michael Gómez Calderón, Mar 11 2022
Pi = 4/phi + Sum_{n >= 0} (1/phi^(12*n)) * ( 8/((12*n+3)*phi^3) + 4/((12*n+5)*phi^5) - 4/((12*n+7)*phi^7) - 8/((12*n+9)*phi^9) - 4/((12*n+11)*phi^11) + 4/((12*n+13)*phi^13) ) where phi = (1+sqrt(5))/2. - Chittaranjan Pardeshi, May 16 2022
Pi = sqrt(3)*(27*S - 36)/24, where S = A248682. - Peter Luschny, Jul 22 2022
Equals Integral_{x=0..1} 1/sqrt(x-x^2) dx. - Michal Paulovic, Sep 24 2023
From Peter Bala, Oct 28 2023: (Start)
Pi = 48*Sum_{n >= 0} (-1)^n/((6*n + 1)*(6*n + 3)*(6*n + 5)).
More generally, it appears that for k >= 0 we have Pi = A(k) + B(k)*Sum_{n >= 0} (-1)^n/((6*n + 1)*(6*n + 3)*...*(6*n + 6*k + 5)), where A(k) is a rational approximation to Pi and B(k) = (3 * 2^(3*k+3) * (3*k + 2)!) / (2^(3*k+1) - (-1)^k). The first few values of A(k) for k >= 0 are [0, 256/85, 65536/20955, 821559296/261636375, 6308233216/2008080987, 908209489444864/289093830828075, ...].
Pi = 16/5 - (288/5)*Sum_{n >= 0} (-1)^n * (6*n + 1)/((6*n + 1)*(6*n + 3)*...*(6*n + 9)).
More generally, it appears that for k >= 0 we have Pi = C(k) + D(k)*Sum_{n >= 0} (-1)^n* (6*n + 1)/((6*n + 1)*(6*n + 3)*...*(6*n + 6*k + 3)), where C(k) and D(k) are rational numbers. The case k = 0 is the Madhava-Gregory-Leibniz series for Pi.
Pi = 168/53 + (288/53)*Sum_{n >= 0} (-1)^n * (42*n^2 + 25*n)/((6*n + 1)*(6*n + 3)*(6*n + 5)*(6*n + 7)).
More generally, it appears that for k >= 1 we have Pi = E(k) + F(k)*Sum_{n >= 0} (-1)^n * (6*(6*k + 1)*n^2 + (24*k + 1)*n)/((6*n + 1)*(6*n + 3)*...*(6*n + 6*k + 1)), where E(k) and F(k) are rational numbers. (End)
From Peter Bala, Nov 10 2023: (Start)
The series representation Pi = 4 * Sum_{k >= 0} 1/(4*k + 1) - 1/(4*k + 3) given above by Alexander R. Povolotsky, Dec 25 2008, is the case n = 0 of the more general result (obtained by the WZ method): for n >= 0, there holds
Pi = Sum_{j = 0.. n-1} 2^(j+1)/((2*j + 1)*binomial(2*j,j)) + 8*(n+1)!*Sum_{k >= 0} 1/((4*k + 1)*(4*k + 3)*...*(4*k + 2*n + 3)).
Letting n -> oo gives the rapidly converging series Pi = Sum_{j >= 0} 2^(j+1)/((2*j + 1)*binomial(2*j,j)) due to Euler.
More generally, it appears that for n >= 1, Pi = 1/(2*n-1)!!^2 * Sum_{j >= 0} (Product_{i = 0..2*n-1} j - i) * 2^(j+1)/((2*j + 1)*binomial(2*j,j)).
For any integer n, Pi = (-1)^n * 4 * Sum_{k >= 0} 1/(4*k + 1 + 2*n) - 1/(4*k + 3 - 2*n). (End)
Pi = Product_{k>=1} ((k^3*(k + 2)*(2*k + 1)^2)/((k + 1)^4*(2*k - 1)^2))^k. - Antonio Graciá Llorente, Jun 13 2024
Equals Integral_{x=0..2} sqrt(8 - x^2) dx - 2 (see Ambrisi and Rizzi). - Stefano Spezia, Jul 21 2024
Equals 3 + 4*Sum_{k>0} (-1)^(k+1)/(4*k*(1+k)*(1+2*k)) (see Wells at p. 53). - Stefano Spezia, Aug 31 2024
Equals 4*Integral_{x=0..1} sqrt(1 - x^2) dx = lim_{n->oo} (4/n^2)*Sum_{k=0..n} sqrt(n^2 - k^2) (see Finch). - Stefano Spezia, Oct 19 2024
Equals Beta(1/2,1/2) (see Shamos). - Stefano Spezia, Jun 03 2025
From Kritsada Moomuang, Jun 18 2025: (Start)
Equals 2 + Integral_{x=0..1} 1/(sqrt(x)*(1 + sqrt(1 - x))) dx.
Equals 2 + Integral_{x=0..1} log(1 + sqrt(1 - x))/sqrt(x) dx. (End)
Pi = 2*arccos(1/phi) + arccos(1/phi^3) = 4*arcsin(1/phi) + 2*arcsin(1/phi^3) where phi = (1+sqrt(5))/2. - Chittaranjan Pardeshi, Jul 02 2025
Pi = Sum_{n >= 0} zeta(2*n)*(2^(2*n - 1) - 1)/2^(4*n - 3). - Andrea Pinos, Jul 29 2025

Extensions

Additional comments from William Rex Marshall, Apr 20 2001

A016754 Odd squares: a(n) = (2n+1)^2. Also centered octagonal numbers.

Original entry on oeis.org

1, 9, 25, 49, 81, 121, 169, 225, 289, 361, 441, 529, 625, 729, 841, 961, 1089, 1225, 1369, 1521, 1681, 1849, 2025, 2209, 2401, 2601, 2809, 3025, 3249, 3481, 3721, 3969, 4225, 4489, 4761, 5041, 5329, 5625, 5929, 6241, 6561, 6889, 7225, 7569, 7921, 8281, 8649, 9025
Offset: 0

Views

Author

Keywords

Comments

The brown rat (rattus norwegicus) breeds very quickly. It can give birth to other rats 7 times a year, starting at the age of three months. The average number of pups is 8. The present sequence gives the total number of rats, when the intervals are 12/7 of a year and a young rat starts having offspring at 24/7 of a year. - Hans Isdahl, Jan 26 2008
Numbers n such that tau(n) is odd where tau(x) denotes the Ramanujan tau function (A000594). - Benoit Cloitre, May 01 2003
If Y is a fixed 2-subset of a (2n+1)-set X then a(n-1) is the number of 3-subsets of X intersecting Y. - Milan Janjic, Oct 21 2007
Binomial transform of [1, 8, 8, 0, 0, 0, ...]; Narayana transform (A001263) of [1, 8, 0, 0, 0, ...]. - Gary W. Adamson, Dec 29 2007
All terms of this sequence are of the form 8k+1. For numbers 8k+1 which aren't squares see A138393. Numbers 8k+1 are squares iff k is a triangular number from A000217. And squares have form 4n(n+1)+1. - Artur Jasinski, Mar 27 2008
Sequence arises from reading the line from 1, in the direction 1, 25, ... and the line from 9, in the direction 9, 49, ..., in the square spiral whose vertices are the squares A000290. - Omar E. Pol, May 24 2008
Equals the triangular numbers convolved with [1, 6, 1, 0, 0, 0, ...]. - Gary W. Adamson & Alexander R. Povolotsky, May 29 2009
First differences: A008590(n) = a(n) - a(n-1) for n>0. - Reinhard Zumkeller, Nov 08 2009
Central terms of the triangle in A176271; cf. A000466, A053755. - Reinhard Zumkeller, Apr 13 2010
Odd numbers with odd abundance. Odd numbers with even abundance are in A088828. Even numbers with odd abundance are in A088827. Even numbers with even abundance are in A088829. - Jaroslav Krizek, May 07 2011
Appear as numerators in the non-simple continued fraction expansion of Pi-3: Pi-3 = K_{k>=1} (1-2*k)^2/6 = 1/(6+9/(6+25/(6+49/(6+...)))), see also the comment in A007509. - Alexander R. Povolotsky, Oct 12 2011
Ulam's spiral (SE spoke). - Robert G. Wilson v, Oct 31 2011
All terms end in 1, 5 or 9. Modulo 100, all terms are among { 1, 9, 21, 25, 29, 41, 49, 61, 69, 81, 89 }. - M. F. Hasler, Mar 19 2012
Right edge of both triangles A214604 and A214661: a(n) = A214604(n+1,n+1) = A214661(n+1,n+1). - Reinhard Zumkeller, Jul 25 2012
Also: Odd numbers which have an odd sum of divisors (= sigma = A000203). - M. F. Hasler, Feb 23 2013
Consider primitive Pythagorean triangles (a^2 + b^2 = c^2, gcd(a, b) = 1) with hypotenuse c (A020882) and respective even leg b (A231100); sequence gives values c-b, sorted with duplicates removed. - K. G. Stier, Nov 04 2013
For n>1 a(n) is twice the area of the irregular quadrilateral created by the points ((n-2)*(n-1),(n-1)*n/2), ((n-1)*n/2,n*(n+1)/2), ((n+1)*(n+2)/2,n*(n+1)/2), and ((n+2)*(n+3)/2,(n+1)*(n+2)/2). - J. M. Bergot, May 27 2014
Number of pairs (x, y) of Z^2, such that max(abs(x), abs(y)) <= n. - Michel Marcus, Nov 28 2014
Except for a(1)=4, the number of active (ON, black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 737", based on the 5-celled von Neumann neighborhood. - Robert Price, May 23 2016
a(n) is the sum of 2n+1 consecutive numbers, the first of which is n+1. - Ivan N. Ianakiev, Dec 21 2016
a(n) is the number of 2 X 2 matrices with all elements in {0..n} with determinant = 2*permanent. - Indranil Ghosh, Dec 25 2016
Engel expansion of Pi*StruveL_0(1)/2 where StruveL_0(1) is A197037. - Benedict W. J. Irwin, Jun 21 2018
Consider all Pythagorean triples (X,Y,Z=Y+1) ordered by increasing Z; the segments on the hypotenuse {p = a(n)/A001844(n), q = A060300(n)/A001844(n) = A001844(n) - p} and their ratio p/q = a(n)/A060300(n) are irreducible fractions in Q\Z. X values are A005408, Y values are A046092, Z values are A001844. - Ralf Steiner, Feb 25 2020
a(n) is the number of large or small squares that are used to tile primitive squares of type 2 (A344332). - Bernard Schott, Jun 03 2021
Also, positive odd integers with an odd number of odd divisors (for similar sequence with 'even', see A348005). - Bernard Schott, Nov 21 2021
a(n) is the least odd number k = x + y, with 0 < x < y, such that there are n distinct pairs (x,y) for which x*y/k is an integer; for example, a(2) = 25 and the two corresponding pairs are (5,20) and (10,15). The similar sequence with 'even' is A016742 (see Comment of Jan 26 2018). - Bernard Schott, Feb 24 2023
From Peter Bala, Jan 03 2024: (Start)
The sequence terms are the exponents of q in the series expansions of the following infinite products:
1) q*Product_{n >= 1} (1 - q^(16*n))*(1 + q^(8*n)) = q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + ....
2) q*Product_{n >= 1} (1 + q^(16*n))*(1 - q^(8*n)) = q - q^9 - q^25 + q^49 + q^81 - q^121 - q^169 + + - - ....
3) q*Product_{n >= 1} (1 - q^(8*n))^3 = q - 3*q^9 + 5*q^25 - 7*q^49 + 9*q^81 - 11*q^121 + 13*q^169 - + ....
4) q*Product_{n >= 1} ( (1 + q^(8*n))*(1 - q^(16*n))/(1 + q^(16*n)) )^3 = q + 3*q^9 - 5*q^25 - 7*q^49 + 9*q^81 + 11*q^121 - 13*q^169 - 15*q^225 + + - - .... (End)

References

  • L. Lorentzen and H. Waadeland, Continued Fractions with Applications, North-Holland 1992, p. 586.

Crossrefs

Cf. A000447 (partial sums).
Cf. A348005, A379481 [= a(A048673(n)-1)].
Partial sums of A022144.
Positions of odd terms in A341528.
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n) = 1 + Sum_{i=1..n} 8*i = 1 + 8*A000217(n). - Xavier Acloque, Jan 21 2003; Zak Seidov, May 07 2006; Robert G. Wilson v, Dec 29 2010
O.g.f.: (1+6*x+x^2)/(1-x)^3. - R. J. Mathar, Jan 11 2008
a(n) = 4*n*(n + 1) + 1 = 4*n^2 + 4*n + 1. - Artur Jasinski, Mar 27 2008
a(n) = A061038(2+4n). - Paul Curtz, Oct 26 2008
Sum_{n>=0} 1/a(n) = Pi^2/8 = A111003. - Jaume Oliver Lafont, Mar 07 2009
a(n) = A000290(A005408(n)). - Reinhard Zumkeller, Nov 08 2009
a(n) = a(n-1) + 8*n with n>0, a(0)=1. - Vincenzo Librandi, Aug 01 2010
a(n) = A033951(n) + n. - Reinhard Zumkeller, May 17 2009
a(n) = A033996(n) + 1. - Omar E. Pol, Oct 03 2011
a(n) = (A005408(n))^2. - Zak Seidov, Nov 29 2011
From George F. Johnson, Sep 05 2012: (Start)
a(n+1) = a(n) + 4 + 4*sqrt(a(n)).
a(n-1) = a(n) + 4 - 4*sqrt(a(n)).
a(n+1) = 2*a(n) - a(n-1) + 8.
a(n+1) = 3*a(n) - 3*a(n-1) + a(n-2).
(a(n+1) - a(n-1))/8 = sqrt(a(n)).
a(n+1)*a(n-1) = (a(n)-4)^2.
a(n) = 2*A046092(n) + 1 = 2*A001844(n) - 1 = A046092(n) + A001844(n).
Limit_{n -> oo} a(n)/a(n-1) = 1. (End)
a(n) = binomial(2*n+2,2) + binomial(2*n+1,2). - John Molokach, Jul 12 2013
E.g.f.: (1 + 8*x + 4*x^2)*exp(x). - Ilya Gutkovskiy, May 23 2016
a(n) = A101321(8,n). - R. J. Mathar, Jul 28 2016
Product_{n>=1} A033996(n)/a(n) = Pi/4. - Daniel Suteu, Dec 25 2016
a(n) = A014105(n) + A000384(n+1). - Bruce J. Nicholson, Nov 11 2017
a(n) = A003215(n) + A002378(n). - Klaus Purath, Jun 09 2020
From Amiram Eldar, Jun 20 2020: (Start)
Sum_{n>=0} a(n)/n! = 13*e.
Sum_{n>=0} (-1)^(n+1)*a(n)/n! = 3/e. (End)
Sum_{n>=0} (-1)^n/a(n) = A006752. - Amiram Eldar, Oct 10 2020
From Amiram Eldar, Jan 28 2021: (Start)
Product_{n>=0} (1 + 1/a(n)) = cosh(Pi/2).
Product_{n>=1} (1 - 1/a(n)) = Pi/4 (A003881). (End)
From Leo Tavares, Nov 24 2021: (Start)
a(n) = A014634(n) - A002943(n). See Diamond Triangles illustration.
a(n) = A003154(n+1) - A046092(n). See Diamond Stars illustration. (End)
From Peter Bala, Mar 11 2024: (Start)
Sum_{k = 1..n+1} 1/(k*a(k)*a(k-1)) = 1/(9 - 3/(17 - 60/(33 - 315/(57 - ... - n^2*(4*n^2 - 1)/((2*n + 1)^2 + 2*2^2 ))))).
3/2 - 2*log(2) = Sum_{k >= 1} 1/(k*a(k)*a(k-1)) = 1/(9 - 3/(17 - 60/(33 - 315/(57 - ... - n^2*(4*n^2 - 1)/((2*n + 1)^2 + 2*2^2 - ... ))))).
Row 2 of A142992. (End)
From Peter Bala, Mar 26 2024: (Start)
8*a(n) = (2*n + 1)*(a(n+1) - a(n-1)).
Sum_{n >= 0} (-1)^n/(a(n)*a(n+1)) = 1/2 - Pi/8 = 1/(9 + (1*3)/(8 + (3*5)/(8 + ... + (4*n^2 - 1)/(8 + ... )))). For the continued fraction use Lorentzen and Waadeland, p. 586, equation 4.7.9 with n = 1. Cf. A057813. (End)

Extensions

Additional description from Terrel Trotter, Jr., Apr 06 2002

A002024 k appears k times; a(n) = floor(sqrt(2n) + 1/2).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13
Offset: 1

Views

Author

Keywords

Comments

Integer inverse function of the triangular numbers A000217. The function trinv(n) = floor((1+sqrt(1+8n))/2), n >= 0, gives the values 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, ..., that is, the same sequence with offset 0. - N. J. A. Sloane, Jun 21 2009
Array T(k,n) = n+k-1 read by antidiagonals.
Eigensequence of the triangle = A001563. - Gary W. Adamson, Dec 29 2008
Can apparently also be defined via a(n+1)=b(n) for n >= 2 where b(0)=b(1)=1 and b(n) = b(n-b(n-2))+1. Tested to be correct for all n <= 150000. - José María Grau Ribas, Jun 10 2011
For any n >= 0, a(n+1) is the least integer m such that A000217(m)=m(m+1)/2 is larger than n. This is useful when enumerating representations of n as difference of triangular numbers; see also A234813. - M. F. Hasler, Apr 19 2014
Number of binary digits of A023758, i.e., a(n) = ceiling(log_2(A023758(n+2))). - Andres Cicuttin, Apr 29 2016
a(n) and A002260(n) give respectively the x(n) and y(n) coordinates of the sorted sequence of points in the integer lattice such that x(n) > 0, 0 < y(n) <= x(n), and min(x(n), y(n)) < max(x(n+1), y(n+1)) for n > 0. - Andres Cicuttin, Dec 25 2016
Partial sums (A060432) are given by S(n) = (-a(n)^3 + a(n)*(1+6n))/6. - Daniel Cieslinski, Oct 23 2017
As an array, T(k,n) is the number of digits columns used in carryless multiplication between a k-digit number and an n-digit number. - Stefano Spezia, Sep 24 2022
a(n) is the maximum number of possible solutions to an n-statement Knights and Knaves Puzzle, where each statement is of the form "x of us are knights" for some 1 <= x <= n, knights can only tell the truth and knaves can only lie. - Taisha Charles and Brittany Ohlinger, Jul 29 2023

Examples

			From _Clark Kimberling_, Sep 16 2008: (Start)
As a rectangular array, a northwest corner:
  1 2 3 4 5 6
  2 3 4 5 6 7
  3 4 5 6 7 8
  4 5 6 7 8 9
This is the weight array (cf. A144112) of A107985 (formatted as a rectangular array). (End)
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 4*x^9 + 4*x^9 + 4*x^10 + ...
		

References

  • Edward S. Barbeau, Murray S. Klamkin, and William O. J. Moser, Five Hundred Mathematical Challenges, Prob. 441, pp. 41, 194. MAA 1995.
  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 97.
  • K. Hardy and K. S. Williams, The Green Book of Mathematical Problems, p. 59, Solution to Prob. 14, Dover NY, 1985
  • R. Honsberger, Mathematical Morsels, pp. 133-134, MAA 1978.
  • J. F. Hurley, Litton's Problematical Recreations, pp. 152; 313-4 Prob. 22, VNR Co., NY, 1971.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 43.
  • 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).
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

a(n+1) = 1+A003056(n), A022846(n)=a(n^2), a(n+1)=A002260(n)+A025581(n).
A123578 is an essentially identical sequence.

Programs

  • Haskell
    a002024 n k = a002024_tabl !! (n-1) !! (k-1)
    a002024_row n = a002024_tabl !! (n-1)
    a002024_tabl = iterate (\xs@(x:_) -> map (+ 1) (x : xs)) [1]
    a002024_list = concat a002024_tabl
    a002024' = round . sqrt . (* 2) . fromIntegral
    -- Reinhard Zumkeller, Jul 05 2015, Feb 12 2012, Mar 18 2011
    
  • Haskell
    a002024_list = [1..] >>= \n -> replicate n n
    
  • Haskell
    a002024 = (!!) $ [1..] >>= \n -> replicate n n
    -- Sascha Mücke, May 10 2016
    
  • Magma
    [Floor(Sqrt(2*n) + 1/2): n in [1..80]]; // Vincenzo Librandi, Nov 19 2014
    
  • Maple
    A002024 := n-> ceil((sqrt(1+8*n)-1)/2); seq(A002024(n), n=1..100);
  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - a[n - 1]] + 1 (* Branko Curgus, May 12 2009 *)
    Table[n, {n, 13}, {n}] // Flatten (* Robert G. Wilson v, May 11 2010 *)
    Table[PadRight[{},n,n],{n,15}]//Flatten (* Harvey P. Dale, Jan 13 2019 *)
  • PARI
    t1(n)=floor(1/2+sqrt(2*n)) /* A002024 = this sequence */
    
  • PARI
    t2(n)=n-binomial(floor(1/2+sqrt(2*n)),2) /* A002260(n-1) */
    
  • PARI
    t3(n)=binomial(floor(3/2+sqrt(2*n)),2)-n+1 /* A004736 */
    
  • PARI
    t4(n)=n-1-binomial(floor(1/2+sqrt(2*n)),2) /* A002260(n-1)-1 */
    
  • PARI
    A002024(n)=(sqrtint(n*8)+1)\2 \\ M. F. Hasler, Apr 19 2014
    
  • PARI
    a(n)=(sqrtint(8*n-7)+1)\2
    
  • PARI
    a(n)=my(k=1);while(binomial(k+1,2)+1<=n,k++);k \\ R. J. Cano, Mar 17 2014
    
  • Python
    from math import isqrt
    def A002024(n): return (isqrt(8*n)+1)//2 # Chai Wah Wu, Feb 02 2022
  • Sage
    [floor(sqrt(2*n) +1/2) for n in (1..80)] # G. C. Greubel, Dec 10 2018
    

Formula

a(n) = floor(1/2 + sqrt(2n)). Also a(n) = ceiling((sqrt(1+8n)-1)/2). [See the Liu link for a large collection of explicit formulas. - N. J. A. Sloane, Oct 30 2019]
a((k-1)*k/2 + i) = k for k > 0 and 0 < i <= k. - Reinhard Zumkeller, Aug 30 2001
a(n) = a(n - a(n-1)) + 1, with a(1)=1. - Ian M. Levitt (ilevitt(AT)duke.poly.edu), Aug 18 2002
a(n) = round(sqrt(2n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 01 2002
T(n,k) = A003602(A118413(n,k)); = T(n,k) = A001511(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
G.f.: (x/(1-x))*Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, Oct 06 2003
Equals A127899 * A004736. - Gary W. Adamson, Feb 09 2007
Sum_{i=1..n} Sum_{j=i..n+i-1} T(j,i) = A000578(n); Sum_{i=1..n} T(n,i) = A000290(n). - Reinhard Zumkeller, Jun 24 2007
a(n) + n = A014132(n). - Vincenzo Librandi, Jul 08 2010
a(n) = ceiling(-1/2 + sqrt(2n)). - Branko Curgus, May 12 2009
a(A169581(n)) = A038567(n). - Reinhard Zumkeller, Dec 02 2009
a(n) = round(sqrt(2*n)) = round(sqrt(2*n-1)); there exist a and b greater than zero such that 2*n = 2+(a+b)^2 -(a+3*b) and a(n)=(a+b-1). - Fabio Civolani (civox(AT)tiscali.it), Feb 23 2010
A005318(n+1) = 2*A005318(n) - A205744(n), A205744(n) = A005318(A083920(n)), A083920(n) = n - a(n). - N. J. A. Sloane, Feb 11 2012
Expansion of psi(x) * x / (1 - x) in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Mar 19 2014
G.f.: (x/(1-x)) * Product_{n>=1} (1 + x^n) * (1 - x^(2*n)). - Paul D. Hanna, Feb 27 2016
a(n) = 1 + Sum_{i=1..n/2} ceiling(floor(2(n-1)/(i^2+i))/(2n)). - José de Jesús Camacho Medina, Jan 07 2017
a(n) = floor((sqrt(8*n-7)+1)/2). - Néstor Jofré, Apr 24 2017
a(n) = floor((A000196(8*n)+1)/2). - Pontus von Brömssen, Dec 10 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 (A003881). - Amiram Eldar, Oct 01 2022
G.f. as array: (x^2*(1 - y)^2 + y^2 + x*y*(1 - 2*y))/((1 - x)^2*(1 - y)^2). - Stefano Spezia, Apr 22 2024

A002654 Number of ways of writing n as a sum of at most two nonzero squares, where order matters; also (number of divisors of n of form 4m+1) - (number of divisors of form 4m+3).

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 0, 1, 1, 2, 0, 0, 2, 0, 0, 1, 2, 1, 0, 2, 0, 0, 0, 0, 3, 2, 0, 0, 2, 0, 0, 1, 0, 2, 0, 1, 2, 0, 0, 2, 2, 0, 0, 0, 2, 0, 0, 0, 1, 3, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 1, 4, 0, 0, 2, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 4, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 3, 2, 0, 0, 2, 0
Offset: 1

Views

Author

Keywords

Comments

Glaisher calls this E(n) or E_0(n). - N. J. A. Sloane, Nov 24 2018
Number of sublattices of Z X Z of index n that are similar to Z X Z; number of (principal) ideals of Z[i] of norm n.
a(n) is also one fourth of the number of integer solutions of n = x^2 + y^2 (order and signs matter, and 0 (without signs) is allowed). a(n) = N(n)/4, with N(n) from p. 147 of the Niven-Zuckermann reference. See also Theorem 5.12, p. 150, which defines a (strongly) multiplicative function h(n) which coincides with A056594(n-1), n >= 1, and N(n)/4 = sum(h(d), d divides n). - Wolfdieter Lang, Apr 19 2013
a(2+8*N) = A008441(N) gives the number of ways of writing N as the sum of 2 (nonnegative) triangular numbers for N >= 0. - Wolfdieter Lang, Jan 12 2017
Coefficients of Dedekind zeta function for the quadratic number field of discriminant -4. See A002324 for formula and Maple code. - N. J. A. Sloane, Mar 22 2022

Examples

			4 = 2^2, so a(4) = 1; 5 = 1^2 + 2^2 = 2^2 + 1^2, so a(5) = 2.
x + x^2 + x^4 + 2*x^5 + x^8 + x^9 + 2*x^10 + 2*x^13 + x^16 + 2*x^17 + x^18 + ...
2 = (+1)^2 + (+1)^2 = (+1)^2 + (-1)^2  = (-1)^2 + (+1)^2 = (-1)^2 + (-1)^2. Hence there are 4 integer solutions, called N(2) in the Niven-Zuckerman reference, and a(2) = N(2)/4 = 1.  4 = 0^1 + (+2)^2 = (+2)^2 + 0^2 = 0^2 + (-2)^2 = (-2)^2 + 0^2. Hence N(4) = 4 and a(4) = N(4)/4 = 1. N(5) = 8, a(5) = 2. - _Wolfdieter Lang_, Apr 19 2013
		

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.
  • George Chrystal, Algebra: An elementary text-book for the higher classes of secondary schools and for colleges, 6th ed., Chelsea Publishing Co., New York, 1959, Part II, p. 346 Exercise XXI(17). MR0121327 (22 #12066)
  • Emil Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 15.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley, 1980, pp. 147 and 150.
  • Günter Scheja and Uwe Storch, Lehrbuch der Algebra, Tuebner, 1988, p. 251.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 89.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 340.

Crossrefs

Equals 1/4 of A004018. Partial sums give A014200.
Cf. A002175, A008441, A121444, A122856, A122865, A022544, A143574, A000265, A027748, A124010, A025426 (two squares, order does not matter), A120630 (Dirichlet inverse), A101455 (Mobius transform), A000089, A241011.
If one simply reads the table in Glaisher, PLMS 1884, which omits the zero entries, one gets A213408.
Dedekind zeta functions for imaginary quadratic number fields of discriminants -3, -4, -7, -8, -11, -15, -19, -20 are A002324, A002654, A035182, A002325, A035179, A035175, A035171, A035170, respectively.
Dedekind zeta functions for real quadratic number fields of discriminants 5, 8, 12, 13, 17, 21, 24, 28, 29, 33, 37, 40 are A035187, A035185, A035194, A035195, A035199, A035203, A035188, A035210, A035211, A035215, A035219, A035192, respectively.

Programs

  • Haskell
    a002654 n = product $ zipWith f (a027748_row m) (a124010_row m) where
       f p e | p `mod` 4 == 1 = e + 1
             | otherwise      = (e + 1) `mod` 2
       m = a000265 n
    -- Reinhard Zumkeller, Mar 18 2013
    
  • Maple
    with(numtheory):
    A002654 := proc(n)
        local count1, count3, d;
        count1 := 0:
        count3 := 0:
        for d in numtheory[divisors](n) do
            if d mod 4 = 1 then
                count1 := count1+1
            elif d mod 4 = 3 then
                count3 := count3+1
            fi:
        end do:
        count1-count3;
    end proc:
    # second Maple program:
    a:= n-> add(`if`(d::odd, (-1)^((d-1)/2), 0), d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 04 2020
  • Mathematica
    a[n_] := Count[Divisors[n], d_ /; Mod[d, 4] == 1] - Count[Divisors[n], d_ /; Mod[d, 4] == 3]; a/@Range[105] (* Jean-François Alcover, Apr 06 2011, after R. J. Mathar *)
    QP = QPochhammer; CoefficientList[(1/q)*(QP[q^2]^10/(QP[q]*QP[q^4])^4-1)/4 + O[q]^100, q] (* Jean-François Alcover, Nov 24 2015 *)
    f[2, e_] := 1; f[p_, e_] := If[Mod[p, 4] == 1, e + 1, Mod[e + 1, 2]]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 19 2020 *)
    Rest[CoefficientList[Series[EllipticTheta[3, 0, q]^2/4, {q, 0, 100}], q]] (* Vaclav Kotesovec, Mar 10 2023 *)
  • PARI
    direuler(p=2,101,1/(1-X)/(1-kronecker(-4,p)*X))
    
  • PARI
    {a(n) = polcoeff( sum(k=1, n, x^k / (1 + x^(2*k)), x * O(x^n)), n)}
    
  • PARI
    {a(n) = sumdiv( n, d, (d%4==1) - (d%4==3))}
    
  • PARI
    {a(n) = local(A); A = x * O(x^n); polcoeff( eta(x^2 + A)^10 / (eta(x + A) * eta(x^4 + A))^4 / 4, n)} \\ Michael Somos, Jun 03 2005
    
  • PARI
    a(n)=my(f=factor(n>>valuation(n,2))); prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, (f[i,2]+1)%2)) \\ Charles R Greathouse IV, Sep 09 2014
    
  • PARI
    my(B=bnfinit(x^2+1)); vector(100,n,#bnfisintnorm(B,n)) \\ Joerg Arndt, Jun 01 2024
    
  • Python
    from math import prod
    from sympy import factorint
    def A002654(n): return prod(1 if p == 2 else (e+1 if p % 4 == 1 else (e+1) % 2) for p, e in factorint(n).items()) # Chai Wah Wu, May 09 2022

Formula

Dirichlet series: (1-2^(-s))^(-1)*Product (1-p^(-s))^(-2) (p=1 mod 4) * Product (1-p^(-2s))^(-1) (p=3 mod 4) = Dedekind zeta-function of Z[ i ].
Coefficients in expansion of Dirichlet series Product_p (1-(Kronecker(m, p)+1)*p^(-s)+Kronecker(m, p)*p^(-2s))^(-1) for m = -16.
If n=2^k*u*v, where u is product of primes 4m+1, v is product of primes 4m+3, then a(n)=0 unless v is a square, in which case a(n) = number of divisors of u (Jacobi).
Multiplicative with a(p^e) = 1 if p = 2; e+1 if p == 1 (mod 4); (e+1) mod 2 if p == 3 (mod 4). - David W. Wilson, Sep 01 2001
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u - v)^2 - (v - w) * (4*w + 1). - Michael Somos, Jul 19 2004
G.f.: Sum_{n>=1} ((-1)^floor(n/2)*x^((n^2+n)/2)/(1+(-x)^n)). - Vladeta Jovovic, Sep 15 2004
Expansion of (eta(q^2)^10 / (eta(q) * eta(q^4))^4 - 1)/4 in powers of q.
G.f.: Sum_{k>0} x^k / (1 + x^(2*k)) = Sum_{k>0} -(-1)^k * x^(2*k - 1) / (1 - x^(2*k - 1)). - Michael Somos, Aug 17 2005
a(4*n + 3) = a(9*n + 3) = a(9*n + 6) = 0. a(9*n) = a(2*n) = a(n). - Michael Somos, Nov 01 2006
a(4*n + 1) = A008441(n). a(3*n + 1) = A122865(n). a(3*n + 2) = A122856(n). a(12*n + 1) = A002175(n). a(12*n + 5) = 2 * A121444(n). 4 * a(n) = A004018(n) unless n=0.
a(n) = Sum_{k=1..n} A010052(k)*A010052(n-k). a(A022544(n)) = 0; a(A001481(n)) > 0.
- Reinhard Zumkeller, Sep 27 2008
a(n) = A001826(n) - A001842(n). - R. J. Mathar, Mar 23 2011
a(n) = Sum_{d|n} A056594(d-1), n >= 1. See the above comment on A056594(d-1) = h(d) of the Niven-Zuckerman reference. - Wolfdieter Lang, Apr 19 2013
Dirichlet g.f.: zeta(s)*beta(s) = zeta(s)*L(chi_2(4),s). - Ralf Stephan, Mar 27 2015
G.f.: (theta_3(x)^2 - 1)/4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 17 2018
a(n) = Sum_{ m: m^2|n } A000089(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = A053866(n) + 2 * A025441(n). - Andrey Zabolotskiy, Apr 23 2019
a(n) = Im(Sum_{d|n} i^d). - Ridouane Oudra, Feb 02 2020
a(n) = Sum_{d|n} sin((1/2)*d*Pi). - Ridouane Oudra, Jan 22 2021
Sum_{n>=1} (-1)^n*a(n)/n = Pi*log(2)/4 (Covo, 2010). - Amiram Eldar, Apr 07 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/4 = 0.785398... (A003881). - Amiram Eldar, Oct 11 2022
From Vaclav Kotesovec, Mar 10 2023: (Start)
Sum_{k=1..n} a(k)^2 ~ n * (log(n) + C) / 4, where C = A241011 =
4*gamma - 1 + log(2)/3 - 2*log(Pi) + 8*log(Gamma(3/4)) - 12*Zeta'(2)/Pi^2 = 2.01662154573340811526279685971511542645018417752364748061...
The constant C, published by Ramanujan (1916, formula (22)), 4*gamma - 1 + log(2)/3 - log(Pi) + 4*log(Gamma(3/4)) - 12*Zeta'(2)/Pi^2 = 2.3482276258576... is wrong! (End)

A000960 Flavius Josephus's sieve: Start with the natural numbers; at the k-th sieving step, remove every (k+1)-st term of the sequence remaining after the (k-1)-st sieving step; iterate.

Original entry on oeis.org

1, 3, 7, 13, 19, 27, 39, 49, 63, 79, 91, 109, 133, 147, 181, 207, 223, 253, 289, 307, 349, 387, 399, 459, 481, 529, 567, 613, 649, 709, 763, 807, 843, 927, 949, 1009, 1093, 1111, 1189, 1261, 1321, 1359, 1471, 1483, 1579, 1693, 1719, 1807, 1899, 1933, 2023
Offset: 1

Views

Author

Keywords

Comments

a(n) is never divisible by 2 or 5. - Thomas Anton, Nov 01 2018

Examples

			Start with
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... (A000027) and delete every second term, giving
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... (A005408) and delete every 3rd term, giving
1 3 7 9 13 15 19 21 25 27 ... (A056530) and delete every 4th term, giving
1 3 7 13 15 19 25 27 ... (A056531) and delete every 5th term, giving
.... Continue forever and what's left is the sequence.
(The array formed by these rows is A278492.)
For n = 5, 5^2 = 25, go down to a multiple of 4 giving 24, then to a multiple of 3 = 21, then to a multiple of 2 = 20, then to a multiple of 1 = 19, so a(5) = 19.
		

References

  • V. Brun, Un procédé qui ressemble au crible d'Ératosthène, Analele Stiintifice Univ. "Al. I. Cuza", Iasi, Romania, Sect. Ia Matematica, 1965, vol. 11B, pp. 47-53.
  • Problems 107, 116, Nord. Mat. Tidskr. 5 (1957), 114-116.
  • 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

Cf. A119446 for triangle whose leading diagonal is A119447 and this sequence gives all possible values for A119447 (except A119447 cannot equal 1 because prime(n)/n is never 1).
Cf. A100617 (a left inverse), A100618.
Cf. A278169 (characteristic function).
Main diagonal of A278492, leftmost column of A278505, positions of zeros in A278528 & A278529.

Programs

  • Haskell
    a000960 n = a000960_list !! (n-1)
    a000960_list = sieve 1 [1..] where
       sieve k (x:xs) = x : sieve (k+1) (flavius xs) where
          flavius xs = us ++ flavius vs where (u:us,vs) = splitAt (k+1) xs
    -- Reinhard Zumkeller, Oct 31 2012
    
  • Maple
    S[1]:={seq(i,i=1..2100)}: for n from 2 to 2100 do S[n]:=S[n-1] minus {seq(S[n-1][n*i],i=1..nops(S[n-1])/n)} od: A:=S[2100]; # Emeric Deutsch, Nov 17 2004
  • Mathematica
    del[lst_, k_] := lst[[Select[Range[Length[lst]], Mod[ #, k] != 0 &]]]; For[k = 2; s = Range[2100], k <= Length[s], k++, s = del[s, k]]; s
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 1] &, n, Reverse@Range[n - 1]]; Array[f, 60] (* Robert G. Wilson v, Nov 05 2005 *)
  • PARI
    a(n)=local(A=n,D);for(i=1,n-1,D=n-i;A=D*ceil(A/D+1));return(A) \\ Paul D. Hanna, Oct 10 2005
    
  • Python
    def flavius(n):
        L = list(range(1,n+1));j=2
        while j <= len(L):
            L = [L[i] for i in range(len(L)) if (i+1)%j]
            j+=1
        return L
    flavius(100)
    # Robert FERREOL, Nov 08 2015

Formula

Let F(n) = number of terms <= n. Andersson, improving results of Brun, shows that F(n) = 2 sqrt(n/Pi) + O(n^(1/6)). Hence a(n) grows like Pi*n^2 / 4.
To get n-th term, start with n and successively round up to next 2 multiples of n-1, n-2, ..., 1 (compare to Mancala sequence A002491). E.g.: to get 11th term: 11->30->45->56->63->72->80->84->87->90->91; i.e., start with 11, successively round up to next 2 multiples of 10, 9, .., 1. - Paul D. Hanna, Oct 10 2005
As in Paul D. Hanna's formula, start with n^2 and successively move down to the highest multiple of n-1, n-2, etc., smaller than your current number: 121 120 117 112 105 102 100 96 93 92 91, so a(11) = 91, from moving down to multiples of 10, 9, ..., 1. - Joshua Zucker, May 20 2006
Or, similarly for n = 5, begin with 25, down to a multiple of 4 = 24, down to a multiple of 3 = 21, then to a multiple of 2 = 20 and finally to a multiple of 1 = 19, so a(5) = 19. - Joshua Zucker, May 20 2006
This formula arises in A119446; the leading term of row k of that triangle = a(prime(k)/k) from this sequence. - Joshua Zucker, May 20 2006
a(n) = 2*A073359(n-1) + 1, cf. link to posts on the SeqFan list. - M. F. Hasler, Nov 23 2016
a(n) = 1 + A278484(n-1). - Antti Karttunen, Nov 23 2016, after David W. Wilson's posting on SeqFan list Nov 22 2016

Extensions

More terms and better description from Henry Bottomley, Jun 16 2000
Entry revised by N. J. A. Sloane, Nov 13 2004
More terms from Paul D. Hanna, Oct 10 2005

A004523 Two even followed by one odd; or floor(2n/3).

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46
Offset: 0

Views

Author

Keywords

Comments

Guenther Rosenbaum showed that the sequence represents the optimal number of guesses in the static Mastermind game with two pegs. Namely, the optimal number of static guesses equals 2k, if the number of colors is either (3k - 1) or 3k and is (2k + 1), if the number of colors is (3k + 1), k >= 1. - Alex Bogomolny, Mar 06 2002
First differences are in A011655. - R. J. Mathar, Mar 19 2008
a(n+1) is the maximum number of wins by a team in a sequence of n basketball games if the team's longest winning streak is 2 games. See example below. In general, floor(k(n+1)/(k+1)) gives the maximum number of wins in n games when the longest winning streak is of length k. - Dennis P. Walsh, Apr 18 2012
Sum_{n>=2} 1/a(n)^k = Sum_{j>=1} Sum_{i=1..2} 1/(i*j)^k = Zeta(k)^2 - Zeta(k)*Zeta(k,3), where Zeta(,) is the generalized Riemann zeta function, for the case k=2 this sum is 5*Pi^2/24. - Enrique Pérez Herrero, Jun 25 2012
a(n) is the pattern of (0+2k, 0+2k, 1+2k), k>=0. a(n) is also the number of odd integers divisible by 3 in ]2(n-1)^2, 2n^2[. - Ralf Steiner, Jun 25 2017
a(n) is also the total domination number of the n-triangular (Johnson) graph for n > 2. - Eric W. Weisstein, Apr 09 2018
a(n) is the maximum total domination number of connected graphs with order n>2. The extremal graphs are "brushes", as defined in the links below. - Allan Bickle, Dec 24 2021
a(n) is the minimal number of ascending or descending staircase walks necessary to cover a chessboard of size n-1, for n > 1. See Ackerman and Pinchasi. - Sela Fried, Jan 16 2023

Examples

			For n=11, we have a(11)=7 since there are at most 7 wins by a team in a sequence of 10 games in which its longest winning streak is 2 games. One such win-loss sequence with 7 wins is wwlwwlwwlw. - _Dennis P. Walsh_, Apr 18 2012
		

Crossrefs

Zero followed by partial sums of A011655.

Programs

  • Haskell
    a004523 n = a004523_list !! n
    a004523_list = 0 : 0 : 1 : map (+ 2) a004523_list
    -- Reinhard Zumkeller, Nov 06 2012
    
  • Magma
    [Floor(2*n/3): n in [0..50]]; // G. C. Greubel, Nov 02 2017
  • Maple
    seq(floor(2n/3), n=0..75);
  • Mathematica
    Table[Floor[2 n/3], {n, 0, 75}]
    Table[(6 n + 3 Cos[2 n Pi/3] - Sqrt[3] Sin[2 n Pi/3] - 3)/9, {n, 0, 20}] (* Eric W. Weisstein, Apr 08 2018 *)
    Floor[2 Range[0, 20]/3] (* Eric W. Weisstein, Apr 08 2018 *)
    LinearRecurrence[{1, 0, 1, -1}, {0, 1, 2, 2}, {0, 20}] (* Eric W. Weisstein, Apr 08 2018 *)
    CoefficientList[Series[x^2 (1 + x)/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Apr 08 2018 *)
    Table[If[EvenQ[n],{n,n},n],{n,0,50}]//Flatten (* Harvey P. Dale, May 27 2021 *)
  • PARI
    a(n)=2*n\3 \\ Charles R Greathouse IV, Sep 02 2015
    

Formula

G.f.: (x^2 + 2*x^3 + 2*x^4 + x^5)/(1 - x^3)^2, not reduced. - Len Smiley
a(n) = floor(2*n/3).
a(0) = a(1) = 0; for n > 1, a(n) = n - 1 - floor(a(n-1)/2). - Benoit Cloitre, Nov 26 2002
a(n) = a(n-1) + (1/2)*((-1)^floor((2*n+2)/3)+1), with a(0)=0. - Mario Catalani (mario.catalani(AT)unito.it), Oct 20 2003
a(n) = Sum_{k=0..n-1} (Fibonacci(k) mod 2). - Paul Barry, May 31 2005
a(n) = A004773(n) - A004396(n). - Reinhard Zumkeller, Aug 29 2005
O.g.f.: x^2*(1 + x)/((1 - x)^2*(1 + x + x^2)). - R. J. Mathar, Mar 19 2008
a(n) = ceiling(2*(n-1)/3) = n - 1 - floor((n-1)/3). - Bruno Berselli, Jan 18 2017
a(n) = (6*n - 3 + 2*sqrt(3)*sin(2*(n-2)*Pi/3))/9. - Wesley Ivan Hurt, Sep 30 2017
Sum_{n>=2} (-1)^n/a(n) = Pi/4 (A003881). - Amiram Eldar, Sep 29 2022

A101455 a(n) = 0 for even n, a(n) = (-1)^((n-1)/2) for odd n. Periodic sequence 1,0,-1,0,...

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
Offset: 0

Views

Author

Gerald McGarvey, Jan 20 2005

Keywords

Comments

Called X(n) (i.e., Chi(n)) in Hardy and Wright (p. 241), who show that X(n*m) = X(n)*X(m) for all n and m (i.e., X(n) is completely multiplicative) since (n*m - 1)/2 - (n - 1)/2 - (m - 1)/2 = (n - 1)*(m - 1)/2 == 0 (mod 2) when n and m are odd.
Same as A056594 but with offset 1.
From R. J. Mathar, Jul 15 2010: (Start)
The sequence is the non-principal Dirichlet character mod 4. (The principal character is A000035.)
Associated Dirichlet L-functions are for example L(1,chi) = Sum_{n>=1} a(n)/n = A003881, or L(2,chi) = Sum_{n>=1} a(n)/n^2 = A006752, or L(3,chi) = Sum_{n>=1} a(n)/n^3 = A153071. (End)
a(n) is a strong elliptic divisibility sequence t_n as given in [Kimberling, p. 16] where x = 0, y = -1, z is arbitrary. - Michael Somos, Nov 27 2019

Examples

			G.f. = x - x^3 + x^5 - x^7 + x^9 - x^11 + x^13 - x^15 + x^17 - x^19 + x^21 + ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1986, page 139, k=4, Chi_2(n).
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 5th ed., Oxford Univ. Press, 1979, p. 241.

Crossrefs

Kronecker symbols {(d/n)} where d is a fundamental discriminant with |d| <= 24: A109017 (d=-24), A011586 (d=-23), A289741 (d=-20), A011585 (d=-19), A316569 (d=-15), A011582 (d=-11), A188510 (d=-8), A175629 (d=-7), this sequence (d=-4), A102283 (d=-3), A080891 (d=5), A091337 (d=8), A110161 (d=12), A011583 (d=13), A011584 (d=17), A322829 (d=21), A322796 (d=24).

Programs

  • GAP
    a := [1, 0];; for n in [3..10^2] do a[n] := a[n-2]; od; a; # Muniru A Asiru, Feb 02 2018
    
  • Magma
    m:=75; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x/(1+x^2))); // G. C. Greubel, Aug 23 2018
    
  • Maple
    a := n -> `if`(n mod 2=0, 0, (-1)^((n-1)/2)):
    seq(a(n), n=1..10^3); # Muniru A Asiru, Feb 02 2018
  • Mathematica
    a[ n_] := {1, 0, -1, 0}[[ Mod[ n, 4, 1]]]; (* Michael Somos, Jan 13 2014 *)
    LinearRecurrence[{0, -1}, {1, 0}, 75] (* G. C. Greubel, Aug 23 2018 *)
  • PARI
    {a(n) = if( n%2, (-1)^(n\2))}; /* Michael Somos, Sep 02 2005 */
    
  • PARI
    {a(n) = kronecker( -4, n)}; /* Michael Somos, Mar 30 2012 */
    
  • Python
    def A101455(n): return (0,1,0,-1)[n&3] # Chai Wah Wu, Jun 21 2024

Formula

Multiplicative with a(2^e) = 0, a(p^e) = (-1)^((p^e-1)/2) otherwise. - Mitch Harris May 17 2005
Euler transform of length 4 sequence [0, -1, 0, 1]. - Michael Somos, Sep 02 2005
G.f.: (x - x^3)/(1 - x^4) = x/(1 + x^2). - Michael Somos, Sep 02 2005
G.f. A(x) satisfies: 0 = f(A(x), A(x^2)) where f(u, v) = v - u^2 * (1 + 2*v). - Michael Somos, Aug 04 2011
a(n + 4) = a(n), a(n + 2) = a(-n) = -a(n), a(2*n) = 0, a(2*n + 1) = (-1)^n for all n in Z. - Michael Somos, Aug 04 2011
a(n + 1) = A056594(n). - Michael Somos, Jan 13 2014
REVERT transform is A126120. STIRLING transform of A009454. BINOMIAL transform is A146559. BINOMIAL transform of A009116. BIN1 transform is A108520. MOBIUS transform of A002654. EULER transform is A111335. - Michael Somos, Mar 30 2012
Completely multiplicative with a(p) = 2 - (p mod 4). - Werner Schulte, Feb 01 2018
a(n) = (-(n mod 2))^binomial(n, 2). - Peter Luschny, Sep 08 2018
a(n) = sin(n*Pi/2) = Im(i^n) where i is the imaginary unit. - Jianing Song, Sep 09 2018
From Jianing Song, Nov 14 2018: (Start)
a(n) = ((-4)/n) (or more generally, ((-4^i)/n) for i > 0), where (k/n) is the Kronecker symbol.
E.g.f.: sin(x).
Dirichlet g.f. is the Dirichlet beta function.
a(n) = A091337(n)*A188510(n). (End)

Extensions

a(0) prepended by Jianing Song, Nov 14 2024

A197476 Decimal expansion of least x>0 having cos(x) = cos(2*x)^2.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Oct 15 2011

Keywords

Comments

The Mathematica program includes a graph. Guide for least x>0 satisfying cos(b*x) = cos(c*x)^2, for selected b and c:
b.....c......x
1.....2.......A197476
1.....3.......A197477
1.....4.......A197478
2.....1.......A000796, Pi
2.....3.......A197479
2.....4.......A197480
3.....1.......A019669, Pi/2
3.....2.......A197482
3.....4.......A197483
4.....1.......A168229, arctan(sqrt(7))
4.....2.......A019669, Pi/2
4.....3.......A019679, Pi/12
4.....6.......A197485
4.....8.......A197486
6.....2.......A003881, Pi/4
6.....3.......A019670, Pi/3, tangency point
6.....4.......A197488
6.....8.......A197489
1.....4*Pi....A197334
1.....3*Pi....A197335
1.....2*Pi....A197490
1.....3*Pi/2..A197491
1.....Pi......A197492
1.....Pi/2....A197493
1.....Pi/3....A197494
1.....Pi/4....A197495
1.....2*Pi/3..A197506
2.....3*Pi....A197507
2.....3*Pi/2..A197508
2.....2*Pi....A197509
2.....Pi......A197510
2.....Pi/2....A197511
2.....Pi/3....A197512
2.....Pi/4....A197513
2.....Pi/6....A197514
Pi....1.......A197515
Pi....2.......A197516
Pi....1/2.....A197517
2*Pi..1.......A197518
2*Pi..2.......A197519
2*Pi..3.......A197520
Pi/2..Pi/3....A197521
Pi/2..Pi/6....3
Pi/3..1.......A197582
Pi/3..2.......A197583
Pi/3..1/3.....A197584
See A197133 for a guide for least x>0 satisfying sin(b*x) = sin(c*x)^2 for selected b and c.

Examples

			1.137743932905455557789449860055008349584...
		

Crossrefs

Cf. A197133.

Programs

  • Mathematica
    b = 1; c = 2; f[x_] := Cos[x]
    t = x /. FindRoot[f[b*x] == f[c*x]^2, {x, 1.1, 1.3}, WorkingPrecision -> 200]
    RealDigits[t] (* A197476 *)
    Plot[{f[b*x], f[c*x]^2}, {x, 0, 2}]
    (* or *)
    RealDigits[ ArcCos[ ((19 - 3*Sqrt[33])^(1/3) + (19 + 3*Sqrt[33])^(1/3) - 2)/6], 10, 99] // First (* Jean-François Alcover, Feb 19 2013 *)

Extensions

Edited by Georg Fischer, Jul 28 2021

A019670 Decimal expansion of Pi/3.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 11 1996

Keywords

Comments

With an offset of zero, also the decimal expansion of Pi/30 ~ 0.104719... which is the average arithmetic area of the 0-winding sectors enclosed by a closed Brownian planar path, of a given length t, according to Desbois, p. 1. - Jonathan Vos Post, Jan 23 2011
Polar angle (or apex angle) of the cone that subtends exactly one quarter of the full solid angle. See comments in A238238. - Stanislav Sykora, Jun 07 2014
60 degrees in radians. - M. F. Hasler, Jul 08 2016
Volume of a quarter sphere of radius 1. - Omar E. Pol, Aug 17 2019
Also smallest positive zero of Sum_{k>=1} cos(k*x)/k = -log(2*|sin(x/2)|). Proof of this identity: Sum_{k>=1} cos(k*x)/k = Re(Sum_{k>=1} exp(k*x*i)/k) = Re(-log(1-exp(x*i))) = -log(2*|sin(x/2)|), x != 2*m*Pi, where i = sqrt(-1). - Jianing Song, Nov 09 2019
The area of a circle circumscribing a unit-area regular dodecagon. - Amiram Eldar, Nov 05 2020

Examples

			Pi/3 = 1.04719755119659774615421446109316762806572313312503527365831486...
From _Peter Bala_, Nov 16 2016: (Start)
Case n = 1. Pi/3 = 18 * Sum_{k >= 0} (-1)^(k+1)( 1/((6*k - 5)*(6*k + 1)*(6*k + 7)) + 1/((6*k - 1)*(6*k + 5)*(6*k + 11)) ).
Using the methods of Borwein et al. we can find the following asymptotic expansion for the tails of this series: for N divisible by 6 there holds Sum_{k >= N/6} (-1)^(k+1)( 1/((6*k - 5)*(6*k + 1)*(6*k + 7)) + 1/((6*k - 1)*(6*k + 5)*(6*k + 11)) ) ~ 1/N^3 + 6/N^5 + 1671/N ^7 - 241604/N^9 + ..., where the sequence [1, 0, 6, 0, 1671, 0, -241604, 0, ...] is the sequence of coefficients in the expansion of ((1/18)*cosh(2*x)/cosh(3*x)) * sinh(3*x)^2 = x^2/2! + 6*x^4/4! + 1671*x^6/6! - 241604*x^8/8! + .... Cf. A024235, A278080 and A278195. (End)
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 8.3, p. 489.

Crossrefs

Integral_{x=0..oo} 1/(1+x^m) dx: A013661 (m=2), A248897 (m=3), A093954 (m=4), A352324 (m=5), this sequence (m=6), A352125 (m=8), A094888 (m=10).

Programs

Formula

A third of A000796, a sixth of A019692, the square root of A100044.
Sum_{k >= 0} (-1)^k/(6k+1) + (-1)^k/(6k+5). - Charles R Greathouse IV, Sep 08 2011
Product_{k >= 1}(1-(6k)^(-2))^(-1). - Fred Daniel Kline, May 30 2013
From Peter Bala, Feb 05 2015: (Start)
Pi/3 = Sum {k >= 0} binomial(2*k,k)*1/(2*k + 1)*(1/16)^k = 2F1(1/2,1/2;3/2;1/4). Similar series expansions hold for Pi^2 (A002388), Pi^3 (A091925) and Pi/(2*sqrt(2)) (A093954.)
The integer sequences A(n) := 4^n*(2*n + 1)! and B(n) := A(n)*( Sum {k = 0..n} binomial(2*k,k)*1/(2*k + 1)*(1/16)^k ) both satisfy the second-order recurrence equation u(n) = (20*n^2 + 4*n + 1)*u(n-1) - 8*(n - 1)*(2*n - 1)^3*u(n-2). From this observation we can obtain the continued fraction expansion Pi/3 = 1 + 1/(24 - 8*3^3/(89 - 8*2*5^3/(193 - 8*3*7^3/(337 - ... - 8*(n - 1)*(2*n - 1)^3/((20*n^2 + 4*n + 1) - ... ))))). Cf. A002388 and A093954. (End)
Equals Sum_{k >= 1} arctan(sqrt(3)*L(2k)/L(4k)) where L=A000032. See also A005248 and A056854. - Michel Marcus, Mar 29 2016
Equals Product_{n >= 1} A016910(n) / A136017(n). - Fred Daniel Kline, Jun 09 2016
Equals Integral_{x=-oo..oo} sech(x)/3 dx. - Ilya Gutkovskiy, Jun 09 2016
From Peter Bala, Nov 16 2016: (Start)
Euler's series transformation applied to the series representation Pi/3 = Sum_{k >= 0} (-1)^k/(6*k + 1) + (-1)^k/(6*k + 5) given above by Greathouse produces the faster converging series Pi/3 = (1/2) * Sum_{n >= 0} 3^n*n!*( 1/(Product_{k = 0..n} (6*k + 1)) + 1/(Product_{k = 0..n} (6*k + 5)) ).
The series given above by Greathouse is the case n = 0 of the more general result Pi/3 = 9^n*(2*n)! * Sum_{k >= 0} (-1)^(k+n)*( 1/(Product_{j = -n..n} (6*k + 1 + 6*j)) + 1/(Product_{j = -n..n} (6*k + 5 + 6*j)) ) for n = 0,1,2,.... Cf. A003881. See the example section for notes on the case n = 1.(End)
Equals Product_{p>=5, p prime} p/sqrt(p^2-1). - Dimitris Valianatos, May 13 2017
Equals A019699/4 or A019693/2. - Omar E. Pol, Aug 17 2019
Equals Integral_{x >= 0} (sin(x)/x)^4 = 1/2 + Sum_{n >= 0} (sin(n)/n)^4, by the Abel-Plana formula. - Peter Bala, Nov 05 2019
Equals Integral_{x=0..oo} 1/(1 + x^6) dx. - Bernard Schott, Mar 12 2022
Pi/3 = -Sum_{n >= 1} i/(n*P(n, 1/sqrt(-3))*P(n-1, 1/sqrt(-3))), where i = sqrt(-1) and P(n, x) denotes the n-th Legendre polynomial. The first twenty terms of the series gives the approximation Pi/3 = 1.04719755(06...) correct to 8 decimal places. - Peter Bala, Mar 16 2024
Equals Integral_{x >= 0} (2*x^2 + 1)/((x^2 + 1)*(4*x^2 + 1)) dx. - Peter Bala, Feb 12 2025

A088538 Decimal expansion of 4/Pi.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Nov 16 2003

Keywords

Comments

Average length of chord formed from two randomly chosen points on the circumference of a unit circle (see Weisstein/MathWorld link). - Rick L. Shepherd, Jun 19 2006
Suppose u(0) = 1 + i where i^2 = -1 and u(n+1) = (1/2)*(u(n) + |u(n)|). Conjecture: lim_{n -> oo} Real(u(n)) = 4/Pi. - Yalcin Aktar, Jul 18 2007
Ratio of the arc length of the cycloid for one period to the circumference of the corresponding circle rolling on a line. Thus, for any integral number n of revolutions of a circle of radius r, a point on the circle travels (4/Pi)*2*Pi*r*n = 8*r*n (while the center of the circle moves only 2*Pi*r*n). This ratio varies for partial revolutions and depends upon the initial position of the point with points nearest the line moving the slowest (see Dudeney, who explains how the tops of bicycle wheels move faster than the parts nearest the ground). - Rick L. Shepherd, May 05 2014
Average distance traveled in two steps of length 1 for a random walk in the plane starting at the origin. - Jean-François Alcover, Aug 04 2014
Ratio of the circle area to the area of a square having equal perimeters. - Iaroslav V. Blagouchine, May 06 2016
This is also the value of a special case (n=1) of an n-family of series considered by Hardy (see A278145): 1 + (1/2)*(1/2)^2 + (1/3)*(1*3/(2*4))^2 + (1/4)*((1*3*5) / (2*4*6))^2 + ... = Sum_{k>=0} (1/(k+1))*((2*k-1)!!/(2*k)!!)^2. - Wolfdieter Lang, Nov 14 2016
Minimum ratio of the area of a rectangle to one of its inscribed ellipses, or only existing ratio if the rectangle is a square and then the only inscribed ellipse is a circle. This ellipse has its semiaxes parallel to the sides of the rectangle. If a rectangle has sides of length 2a and 2b, its area is 4*a*b, while the ellipse inscribed has a and b as semiaxes, therefore its area is a*b*Pi. Thus the ratio is (4*a*b)/(a*b*Pi) = 4/Pi. - Giovanni Zedda, Jun 20 2019
The diameter of the conventional spherical earth is (4/Pi)*10000 km = 12732.395... km. - Jean-François Alcover, Oct 30 2021
From Jianing Song, Aug 06 2022: (Start)
sign(sin(x)) = (4/Pi) * Sum_{n>=0} sin((2*n+1)*x)/(2*n+1), for all x in R;
sign(cos(x)) = (4/Pi) * Sum_{n>=0} (-1)^n*cos((2*n+1)*x)/(2*n+1), for all x in R. (End)

Examples

			4/Pi = 1.2732395.... = 1/0.78539816...
		

References

  • Florian Cajori, A History of Mathematical Notations, Dover edition (2012), par. 195.
  • H. E. Dudeney, 536 Puzzles & Curious Problems, Charles Scribner's Sons, New York, 1967, pp. 99, 300-301, #294.
  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, p. 86.
  • G. H. Hardy, Ramanujan, AMS Chelsea Publ., Providence, RI, 2002, p. 105, eq. (7.5.1) for n=1.
  • L. B. W. Jolley, Summation of Series, Dover (1961).

Crossrefs

Cf. A079097 for terms of a generalized continued fraction for 4/Pi. Inverse of A003881. A060294, A278145, A049541 (1/Pi).

Programs

Formula

4/Pi = Product_(1-(-1)^((p-1)/2)/p) where p runs through the odd primes.
Arcsin x = (4/Pi) Sum_{n = 1, 3, 5, 7, ...} T_n(x)/n^2 (Chebyshev series of arcsin; App C of math.CA/0403344). - R. J. Mathar, Jun 26 2006
Equals 1 + Sum_{n >= 1} ((2n-3)!!/(2n)!!)^2. [Jolley eq 274]. - R. J. Mathar, Nov 03 2011
Equals binomial(1,1/2). - Bruno Berselli, May 17 2016
2*A060294 (twice Buffon's constant) = 1/Gamma(3/2)^2. - Wolfdieter Lang, Nov 14 2016
Equals 1 + Sum_{n>=0} (Catalan(n)/2^(2*n+1))^2, with Catalan(n) = A000108(n). This is the rewritten Jolley (274) series. See the above R. J. Mathar entry with (-1)!! := 1. - Ralf Steiner, Sep 18 2018
4/Pi = 1 + (1/4)*hypergeometric([1, 1/2, 1/2], [2, 2], 1) = hypergeometric([-1/2, -1/2], [1], 1). From the g.f. of Catalan^2 given in A001246. - Wolfdieter Lang, Sep 18 2018
Equals Product_{k>=1} (1 + 1/(4*k*(k+1))). - Amiram Eldar, Aug 05 2020
From Stefano Spezia, Oct 26 2024: (Start)
4/Pi = 1 + K_{n>=1} n^2/(2*n + 1), where K is the Gauss notation for an infinite continued fraction. In the expanded form, 4/Pi = 1 + 1^2/(3 + 2^2/(5 + 3^2/(7 + 4^2/(9 + 5^2/(11 + ...))))) (see Finch at p. 23).
4/Pi = Sum_{n>=0} tan(Pi/2^(n+2))/2^n (see Shamos). (End)
4/Pi = Sum_{n >= 0} (-1)^n * mu(2*n+1)/(2*n + 1), where mu(n) is the Möbius function A008683 (see, for example, Benito et al., p. 77). - Peter Bala, Jan 07 2025
Equals Integral_{x=0..1} (2*EllipticK(x))/Pi dx. - Kritsada Moomuang, Jun 04 2025
Showing 1-10 of 107 results. Next