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

A002939 a(n) = 2*n*(2*n-1).

Original entry on oeis.org

0, 2, 12, 30, 56, 90, 132, 182, 240, 306, 380, 462, 552, 650, 756, 870, 992, 1122, 1260, 1406, 1560, 1722, 1892, 2070, 2256, 2450, 2652, 2862, 3080, 3306, 3540, 3782, 4032, 4290, 4556, 4830, 5112, 5402, 5700, 6006, 6320, 6642, 6972, 7310, 7656, 8010, 8372
Offset: 0

Views

Author

Keywords

Comments

Write 0,1,2,... in a spiral; sequence gives numbers on one of 4 diagonals (see Example section).
For n>1 this is the Engel expansion of cosh(1), A118239. - Benoit Cloitre, Mar 03 2002
a(n) = A125199(n,n) for n>0. - Reinhard Zumkeller, Nov 24 2006
Central terms of the triangle in A195437: a(n+1) = A195437(2*n,n). - Reinhard Zumkeller, Nov 23 2011
For n>2, the terms represent the sums of those primitive Pythagorean triples with hypotenuse (H) one unit longer than the longest side (L), or H = L + 1. - Richard R. Forberg, Jun 09 2015
For n>1, a(n) is the perimeter of a Pythagorean triangle with an odd leg 2*n-1. - Agola Kisira Odero, Apr 26 2016
From Rigoberto Florez, Nov 07 2020 : (Start)
A338109(n)/a(n+1) is the Kirchhoff index of the join of the disjoint union of two complete graphs on n vertices with the empty graph on n+1 vertices.
Equivalently, the graph can be described as the graph on 3*n + 1 vertices with labels 0..3*n and with i and j adjacent iff iff i+j> 0 mod 3.
A338588(n)/a(n+1) is the Kirchhoff index of the disjoint union of two complete graphs each on n and n+1 vertices with the empty graph on n+1 vertices.
Equivalently, the graph can be described as the graph on 3*n + 2 vertices with labels 0..3*n+1 and with i and j adjacent iff i+j> 0 mod 3.
These graphs are cographs. (End)
a(n), n>=1, is the number of paths of minimum length (length=2) from the origin to the cross polytope of size 2 in Z^n (column 2 in A371064). - Shel Kaphan, Mar 09 2024

Examples

			G.f. = 2*x + 12*x^2 + 30*x^3 + 56*x^4 + 90*x^5 + 132*x^6 + 182*x^7 + 240*x^8 + ...
On a square lattice, place the nonnegative integers at lattice points forming a spiral as follows: place "0" at the origin; then move one step in any of the four cardinal directions and place "1" at the lattice point reached; then turn 90 degrees in either direction and place a "2" at the next lattice point; then make another 90-degree turn in the same direction and place a "3" at the lattice point; etc. The terms of the sequence will lie along one of the diagonals, as seen in the example below:
.
   99  64--65--66--67--68--69--70--71--72
    |   |                               |
   98  63  36--37--38--39--40--41--42  73
    |   |   |                       |   |
   97  62  35  16--17--18--19--20  43  74
    |   |   |   |               |   |   |
   96  61  34  15   4---5---6  21  44  75
    |   |   |   |   |       |   |   |   |
   95  60  33  14   3  *0*  7  22  45  76
    |   |   |   |   |   |   |   |   |   |
   94  59  32  13  *2*--1   8  23  46  77
    |   |   |   |           |   |   |   |
   93  58  31 *12*-11--10---9  24  47  78
    |   |   |                   |   |   |
   92  57 *30*-29--28--27--26--25  48  79
    |   |                           |   |
   91 *56*-55--54--53--52--51--50--49  80
    |                                   |
  *90*-89--88--87--86--85--84--83--82--81
.
[Edited by _Jon E. Schoenfield_, Jan 01 2017]
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 2nd ed., 1994, p. 99.

Crossrefs

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.
Cf. numbers of the form n*(n*k-k+4)/2 listed in A226488 (this sequence is the case k=8). - Bruno Berselli, Jun 10 2013
Cf. A017089 (first differences), A268684 (partial sums), A010050 (partial products).
Cf. A371064.

Programs

Formula

Sum_{n >= 1} 1/a(n) = log(2) (cf. Tijdeman).
Log(2) = Sum_{n >= 1} ((1 - 1/2) + (1/3 - 1/4) + (1/5 - 1/6) + (1/7 - 1/8) + ...) = Sum_{n >= 0} (-1)^n/(n+1). Log(2) = Integral_{x=0..1} 1/(1+x) dx. - Gary W. Adamson, Jun 22 2003
a(n) = A000384(n)*2. - Omar E. Pol, May 14 2008
From R. J. Mathar, Apr 23 2009: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: 2*x*(1+3*x)/(1-x)^3. (End)
a(n) = a(n-1) + 8*n - 6 (with a(0)=0). - Vincenzo Librandi, Nov 12 2010
a(n) = A118729(8n+1). - Philippe Deléham, Mar 26 2013
Product_{k=1..n} a(k) = (2n)! = A010050(n). - Tony Foster III, Sep 06 2015
E.g.f.: 2*x*(1 + 2*x)*exp(x). - Ilya Gutkovskiy, Apr 29 2016
a(n) = A002943(-n) for all n in Z. - Michael Somos, Jan 28 2017
0 = 12 + a(n)*(-8 + a(n) - 2*a(n+1)) + a(n+1)*(-8 + a(n+1)) for all n in Z. - Michael Somos, Jan 28 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 - log(2)/2. - Amiram Eldar, Jul 31 2020

A017101 a(n) = 8n + 3.

Original entry on oeis.org

3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 123, 131, 139, 147, 155, 163, 171, 179, 187, 195, 203, 211, 219, 227, 235, 243, 251, 259, 267, 275, 283, 291, 299, 307, 315, 323, 331, 339, 347, 355, 363, 371, 379, 387, 395, 403, 411, 419, 427
Offset: 0

Views

Author

Keywords

Comments

Apart from initial term(s), dimension of the space of weight 2n cusp forms for Gamma_0( 47 ).
Also numbers of the form x^2 + y^2 + z^2, where x,y,z are odd integers. - Alexander Adamchuk, Dec 01 2006
Conjecture: 2*a(n) is the half-period of oscillation of a Langton's ant colony that is n basic blocks in length. To construct such blocks use a pair of ants facing north at (x,y) and (x+1,y+2) (using Golly's coordinate system). Each successive block is placed 1 cell away from the previous one, i.e., the x coordinate shifts by 3, so we have (x+3k,y) and (x+3k+1,y+2). Also, because of the symmetry of the oscillation pattern, 4*a(n) is the length of the whole period (see MathOverflow link for details). - Mikhail Kurkov, Nov 20 2019

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 247.

Crossrefs

Programs

Formula

a(n) = A001969(2*n+1) + A001969(2*n) = A000069(2*n+1) + A000069(2*n). - Philippe Deléham, Feb 04 2004
G.f.: (3+5*x)/(1-x)^2. - R. J. Mathar, Mar 30 2011
a(n) = 2*a(n-1) - a(n-2) for n>1. - Vincenzo Librandi, May 28 2011
a(A002265(n)) = A004442(n) + A004443(n). - Wesley Ivan Hurt, Apr 06 2016
E.g.f.: exp(x)*(3 + 8*x). - Stefano Spezia, Nov 20 2019
a(n) = A004767(2*n), for n >= 0. See also A004767(2*n+1) = A004771(n). - Wolfdieter Lang, Feb 03 2022

A002516 Earliest sequence with a(a(n)) = 2n.

Original entry on oeis.org

0, 3, 6, 2, 12, 7, 4, 10, 24, 11, 14, 18, 8, 15, 20, 26, 48, 19, 22, 34, 28, 23, 36, 42, 16, 27, 30, 50, 40, 31, 52, 58, 96, 35, 38, 66, 44, 39, 68, 74, 56, 43, 46, 82, 72, 47, 84, 90, 32, 51, 54, 98, 60, 55, 100, 106, 80, 59, 62, 114, 104, 63, 116, 122, 192, 67, 70, 130
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a002516 n = a002516_list !! n
    a002516_list = 0 : concat (transpose
    [a004767_list, f a002516_list, a017089_list, g $ drop 2 a002516_list])
    where f [z] = []; f (_:z:zs) = 2 * z : f zs
    g [z] = [z]; g (z:_:zs) = 2 * z : g zs
    -- Reinhard Zumkeller, Jun 08 2015
  • Mathematica
    a[0] = 0; a[n_ /; Mod[n, 2] == 0] := a[n] = 2*a[n/2]; a[n_ /; Mod[n, 4] == 1] := n+2; a[n_ /; Mod[n, 4] == 3] := 2(n-2); Table[a[n], {n, 0, 67}] (* Jean-François Alcover, Feb 06 2012, after Henry Bottomley *)
  • PARI
    v2(n)=valuation(n,2)
    a(n)=2^v2(n)*(-1+3/2*n/2^v2(n)-(-3+1/2*n/2^v2(n))*(-1)^((n/2^v2(n)-1)/2))
    
  • PARI
    a(n)=local(t); if(n<1,0,if(n%2==0,2*a(n/2),t=(n-1)/2; 3*t+1/2-(t-5/2)*(-1)^t)) \\ Ralf Stephan, Feb 22 2004
    

Formula

a(4n) = 2*(a(2n)), a(4n+1) = 4n+3, a(4n+2) = 2*(a(2n+1)), a(4n+3) = 8n+2. - Henry Bottomley, Apr 27 2000
From Ralf Stephan, Feb 22 2004: (Start)
a(n) = n + 2*A006519(n) if odd part of n is of form 4k+1, or 2n - 4*A006519(n) otherwise.
a(2n) = 2*a(n), a(2n+1) = 2n + 3 + (2n - 5)*[n mod 2].
G.f.: Sum_{k>=0} 2^k*t(6t^6 + t^4 + 2t^2 + 3)/(1 - t^4)^2, t = x^2^k. (End)

A047524 Numbers that are congruent to {2, 7} mod 8.

Original entry on oeis.org

2, 7, 10, 15, 18, 23, 26, 31, 34, 39, 42, 47, 50, 55, 58, 63, 66, 71, 74, 79, 82, 87, 90, 95, 98, 103, 106, 111, 114, 119, 122, 127, 130, 135, 138, 143, 146, 151, 154, 159, 162, 167, 170, 175, 178, 183, 186, 191, 194, 199, 202, 207, 210, 215, 218, 223, 226, 231, 234
Offset: 1

Views

Author

Keywords

Comments

A195605 is a subsequence. - Bruno Berselli, Sep 21 2011

Crossrefs

Programs

  • GAP
    Filtered([0..250],n->n mod 8=2 or n mod 8=7); # Muniru A Asiru, Aug 06 2018
    
  • Maple
    seq(coeff(series(x*(2+5*x+x^2)/((1+x)*(1-x)^2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Aug 06 2018
  • Mathematica
    Select[Range[300],MemberQ[{2,7},Mod[#,8]]&] (* or *)
    LinearRecurrence[ {1,1,-1},{2,7,10},60] (* Harvey P. Dale, Nov 05 2017 *)
    CoefficientList[ Series[(x^2 + 5x + 2)/((x - 1)^2 (x + 1)), {x, 0, 60}], x] (* Robert G. Wilson v, Aug 07 2018 *)
  • Maxima
    makelist(4*n - mod(n,2) - 1, n, 1, 100); /* Franck Maminirina Ramaharo, Aug 06 2018 */
    
  • PARI
    is(n) = #setintersect([n%8], [2, 7]) > 0 \\ Felix Fröhlich, Aug 06 2018
    
  • Python
    def A047524(n): return (n<<2)-1-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = 8*n - a(n-1) - 7, n > 1. - Vincenzo Librandi, Aug 06 2010
From R. J. Mathar, Mar 22 2011: (Start)
a(n) = 4*n - 3/2 + (-1)^n/2.
G.f.: x*(2+5*x+x^2) / ( (1+x)*(x-1)^2 ). (End)
From Franck Maminirina Ramaharo, Aug 06 2018: (Start)
a(n) = 4*n - (n mod 2) - 1.
a(n) = A047615(n) + 2.
a(2*n) = A004771(n-1).
a(2*n-1) = A017089(n-1).
E.g.f.: ((8*x - 3)*exp(x) + exp(-x) + 2)/2. (End)
a(n) = a(n-1) + a(n-2) - a(n-3). - Muniru A Asiru, Aug 06 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+2)*Pi/16 - log(2)/8 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A125202 a(n) = 4*n^2 - 6*n + 1.

Original entry on oeis.org

-1, 5, 19, 41, 71, 109, 155, 209, 271, 341, 419, 505, 599, 701, 811, 929, 1055, 1189, 1331, 1481, 1639, 1805, 1979, 2161, 2351, 2549, 2755, 2969, 3191, 3421, 3659, 3905, 4159, 4421, 4691, 4969, 5255, 5549, 5851, 6161, 6479, 6805, 7139, 7481, 7831, 8189, 8555, 8929, 9311, 9701, 10099, 10505, 10919, 11341
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 24 2006

Keywords

Crossrefs

Programs

Formula

a(n) = A125199(n,n-1) for n>1.
A003415(a(n)) = A017089(n-1).
From Arkadiusz Wesolowski, Dec 25 2011: (Start)
a(1) = -1, a(n) = a(n-1) + 8*n - 10.
a(n) = 2*a(n-1) - a(n-2) + 8 with a(1) = -1 and a(2) = 5.
G.f.: (1 - 4*x + 11*x^2)/(1 - x)^3. (End)
a(n) = A002943(n-1) - 1. - Arkadiusz Wesolowski, Feb 15 2012
a(n) = A028387(2n-3), with A028387(-1) = -1. - Vincenzo Librandi, Oct 10 2013
E.g.f.: exp(x)*(1 - 2*x + 4*x^2). - Stefano Spezia, Oct 10 2022
Sum_{n>=1} 1/a(n) = sqrt(5)/10*(psi(1/4+sqrt(5)/4) - psi(1/4-sqrt(5)/4)) = -0.656213833... - R. J. Mathar, Apr 22 2024

A047467 Numbers that are congruent to {0, 2} mod 8.

Original entry on oeis.org

0, 2, 8, 10, 16, 18, 24, 26, 32, 34, 40, 42, 48, 50, 56, 58, 64, 66, 72, 74, 80, 82, 88, 90, 96, 98, 104, 106, 112, 114, 120, 122, 128, 130, 136, 138, 144, 146, 152, 154, 160, 162, 168, 170, 176, 178, 184, 186, 192, 194, 200, 202, 208, 210, 216, 218, 224, 226, 232
Offset: 1

Views

Author

Keywords

Crossrefs

Union of A008590 and A017089.

Programs

  • Mathematica
    {#,#+2}&/@(8*Range[0,30])//Flatten (* or *) LinearRecurrence[{1,1,-1},{0,2,8},60] (* Harvey P. Dale, Nov 30 2019 *)
  • PARI
    forstep(n=0,200,[2,6],print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
    
  • PARI
    a(n) = 4*n - 5 - (-1)^n; \\ David Lovler, Jul 25 2022

Formula

From R. J. Mathar, Sep 19 2008: (Start)
a(n) = 4*n - 5 - (-1)^n = 2*A042948(n-1).
G.f.: 2*x^2*(1+3x)/((1-x)^2*(1+x)). (End)
a(n) = 8*n - a(n-1) - 14 with a(1)=0. - Vincenzo Librandi, Aug 06 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=2 and b(k)=2^(k+2)for k > 0. - Philippe Deléham, Oct 17 2011
a(n) = floor((8/3)*floor(3*n/2)). - Clark Kimberling, Jul 04 2012
Sum_{n>=2} (-1)^n/a(n) = Pi/16 + 3*log(2)/8. - Amiram Eldar, Dec 18 2021
E.g.f.: 6 + (4*x - 5)*exp(x) - exp(-x). - David Lovler, Jul 22 2022

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047463 Numbers that are congruent to {2, 4} mod 8.

Original entry on oeis.org

2, 4, 10, 12, 18, 20, 26, 28, 34, 36, 42, 44, 50, 52, 58, 60, 66, 68, 74, 76, 82, 84, 90, 92, 98, 100, 106, 108, 114, 116, 122, 124, 130, 132, 138, 140, 146, 148, 154, 156, 162, 164, 170, 172, 178, 180, 186, 188, 194, 196, 202, 204, 210, 212, 218, 220, 226, 228, 234
Offset: 1

Views

Author

Keywords

Comments

First differences in A010696.

Crossrefs

Union of A017089 and A017113.
Cf. A014848.

Programs

  • Magma
    [ n: n in [2..234 by 2] | n mod 8 in [2,4] ];  // Bruno Berselli, May 11 2011
  • Mathematica
    Select[Range[250], MemberQ[{2, 4}, Mod[#, 8]] &] (* Amiram Eldar, Dec 18 2021 *)

Formula

a(n) = 8*n - a(n-1) - 10, with a(1)=2. - Vincenzo Librandi, Aug 06 2010
From Bruno Berselli, May 11 2011: (Start)
G.f.: 2*x*(1+x+2*x^2)/((1+x)*(1-x)^2).
a(n) = 4*n-(-1)^n-3.
Sum_{i=1..n} a(i) = 2*A014848(n).
a(n) = 2*A042963(n-1). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/16 + log(2)/8. - Amiram Eldar, Dec 18 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A119413 a(n) = 16*n - 12.

Original entry on oeis.org

4, 20, 36, 52, 68, 84, 100, 116, 132, 148, 164, 180, 196, 212, 228, 244, 260, 276, 292, 308, 324, 340, 356, 372, 388, 404, 420, 436, 452, 468, 484, 500, 516, 532, 548, 564, 580, 596, 612, 628, 644, 660, 676, 692, 708, 724, 740, 756, 772, 788, 804, 820, 836
Offset: 1

Views

Author

Jorge Coveiro, Jul 26 2006

Keywords

Comments

General form: (q*n+1)*q: q=2: A016825, q=3: A017197, q=4: A119413, ... . - Vladimir Joseph Stephan Orlovsky, Feb 16 2009

Crossrefs

Programs

Formula

O.g.f.: 4*x*(1+3*x)/(1-x)^2. - R. J. Mathar, Aug 08 2008
From Elmo R. Oliveira, Apr 03 2025: (Start)
E.g.f.: 4*(exp(x)*(4*x - 3) + 3).
a(n) = 2*a(n-1) - a(n-2) for n > 2.
a(n) = 4*A016813(n-1) = 2*A017089(n-1). (End)

A225975 Square root of A226008(n).

Original entry on oeis.org

0, 2, 2, 6, 1, 10, 6, 14, 4, 18, 10, 22, 3, 26, 14, 30, 8, 34, 18, 38, 5, 42, 22, 46, 12, 50, 26, 54, 7, 58, 30, 62, 16, 66, 34, 70, 9, 74, 38, 78, 20, 82, 42, 86, 11, 90, 46, 94, 24, 98, 50, 102, 13, 106, 54, 110, 28, 114, 58
Offset: 0

Views

Author

Paul Curtz, May 22 2013

Keywords

Comments

Repeated terms of A016825 are in the positions 1,2,3,6,5,10,... (A043547).
From Wolfdieter Lang, Dec 04 2013: (Start)
This sequence a(n), n>=1, appears in the formula 2*sin(2*Pi/n) = R(p(n), x) modulo C(a(n), x), with x = rho(a(n)) = 2*cos(Pi/a(n)), the R-polynomials given in A127672 and the minimal C-polynomials of rho given in A187360. This follows from the identity 2*sin(2*Pi/n) = 2*cos(Pi*p(n)/a(n)) with gcd(p(n), a(n)) = 1. For p(n) see a comment on A106609,
Because R is an integer polynomial it shows that 2*sin(2*Pi/n) is an integer in the algebraic number field Q(rho(a(n))) of degree delta(a(n)) (the degree of C(a(n), x)), with delta(k) = A055034(k). This degree is given in A093819. For the coefficients of 2*sin(2*Pi/n) in the power basis of Q(rho(a(n))) see A231189 . (End)

Examples

			For the first formula: a(0)=-1+1=0, a(1)=-3+5=2, a(2)=-1+3=2, a(3)=-1+7=6, a(4)=0+1=1.
		

Crossrefs

Programs

  • Mathematica
    a[0]=0; a[n_] := Sqrt[Denominator[1/4 - 4/n^2]]; Table[a[n], {n, 0, 58}] (* Jean-François Alcover, May 30 2013 *)
    LinearRecurrence[{0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,-1},{0,2,2,6,1,10,6,14,4,18,10,22,3,26,14,30},60] (* Harvey P. Dale, Nov 21 2019 *)

Formula

a(n) = A106609(n-4) + A106609(n+4) with A106609(-4)=-1, A106609(-3)=-3, A106609(-2)=-1, A106609(-1)=-1.
a(n) = 2*a(n-8) -a(n-16).
a(2n+1) = A016825(n), a(2n) = A145979(n-2) for n>1, a(0)=0, a(2)=2.
a(4n) = A022998(n).
a(4n+1) = A017089(n).
a(4n+2) = A016825(n).
a(4n+3) = A017137(n).
G.f.: x*(2 +2*x +6*x^2 +x^3 +10*x^4 +6*x^5 +14*x^6 +4*x^7 +14*x^8 +6*x^9 +10*x^10 +x^11 +6*x^12 +2*x^13 +2*x^14)/((1-x)^2*(1+x)^2*(1+x^2)^2*(1+x^4)^2). [Bruno Berselli, May 23 2013]
From Wolfdieter Lang, Dec 04 2013: (Start)
a(n) = 2*n if n is odd; if n is even then a(n) is n if n/2 == 1, 3, 5, 7 (mod 8), it is n/2 if n/2 == 0, 4 (mod 8) and it is n/4 if n/2 == 2, 6 (mod 8). This leads to the given G.f..
With c(n) = A178182(n), n>=1, a(n) = c(n)/2 if c(n) is even and c(n) if c(n) is odd. This leads to the preceding formula. (End)

Extensions

Edited by Bruno Berselli, May 24 2013

A085805 Numbers n such that the permanent of the character table of the dihedral group D_n is not zero.

Original entry on oeis.org

4, 20, 36, 52, 68
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Jul 24 2003

Keywords

Comments

Probably these are the numbers of the form 16m+4.

Crossrefs

Cf. A017089.
Showing 1-10 of 27 results. Next