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

A352115 Partial sums of the even triangular numbers (A014494).

Original entry on oeis.org

0, 6, 16, 44, 80, 146, 224, 344, 480, 670, 880, 1156, 1456, 1834, 2240, 2736, 3264, 3894, 4560, 5340, 6160, 7106, 8096, 9224, 10400, 11726, 13104, 14644, 16240, 18010, 19840, 21856, 23936, 26214, 28560, 31116, 33744, 36594, 39520, 42680, 45920, 49406, 52976, 56804
Offset: 0

Views

Author

David James Sycamore, Mar 05 2022

Keywords

Comments

The absolute difference between the n-th partial sum of the odd triangular numbers and the (n-1)-th partial sum of the even triangular numbers is equal to n; see formula.
Partial sums of the even generalized hexagonal numbers. - Omar E. Pol, Mar 05 2022

Examples

			a(0) = 0 because 0 is the first even term in A000217.
a(1) = 6, the sum of the first two even terms in A000217, and so on.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2, 1, -4, 1, 2, -1}, {0, 6, 16, 44, 80, 146}, 50] (* Amiram Eldar, Mar 05 2022 *)
  • PARI
    te(n) = (2*n+1)*(2*n+1-(-1)^n)/2; \\ A014494
    a(n) = sum(k=0, n, te(k)); \\ Michel Marcus, Mar 06 2022
    
  • Python
    def A352115(n): return (n + 1)*(2*n*(n+2) + 3*(n%2))//3 # Chai Wah Wu, Mar 11 2022

Formula

a(n) = Sum_{k=0..n-1} A014494(k) = Sum_{k=0..n-1} (2*k+1)(2*k+1-(-1)^k)/2.
|A352116(n) - a(n-1)| = n.
A352116(n) + a(n-1) = A000447(n), (n >= 1).
From Stefano Spezia, Mar 05 2022: (Start)
a(n) = (n + 1)*(4*n^2 + 8*n + 3 - 3*(-1)^n)/6.
G.f.: 2*x*(3 + 2*x + 3*x^2)/((1 - x)^4*(1 + x)^2). (End)

A014601 Numbers congruent to 0 or 3 mod 4.

Original entry on oeis.org

0, 3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 23, 24, 27, 28, 31, 32, 35, 36, 39, 40, 43, 44, 47, 48, 51, 52, 55, 56, 59, 60, 63, 64, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84, 87, 88, 91, 92, 95, 96, 99, 100, 103, 104, 107, 108, 111, 112, 115, 116, 119, 120, 123, 124
Offset: 0

Views

Author

Eric Rains (rains(AT)caltech.edu)

Keywords

Comments

Discriminants of orders in imaginary quadratic fields (negated). [Comment corrected by Christopher E. Thompson, Dec 11 2016]
Numbers such that Langford-Skolem problem has a solution - see A014552.
Complement of A042963. - Reinhard Zumkeller, Oct 04 2004
Also called skew amenable numbers; a number k is skew amenable if there exist a set {a(i)} of integers satisfying the relations k = Sum_{i=1..k} a(i) = -Product_{i=1..k} a(i). Thus we have 8 = 1 + 1 + 1 + 1 + 1 + 1 - 2 + 4 = -(1*1*1*1*1*1*(-2)*4). - Lekraj Beedassy, Jan 07 2005
Possible nonpositive discriminants of quadratic equation a*x^2 + b*x + c or discriminants of binary quadratic forms a*x^2 + b*x*y + c*y^2. - Artur Jasinski, Apr 28 2008
Also, disregarding the 0 term, positive integers m such that, equivalently,
(i) +-1 +-2 +-... +-m is even for all choices of signs,
(ii) +-1 +-2 +-... +-m = 0 for some choices of signs,
(iii) for all -m <= k <= m, k = +-1 +-2 +-... +-(k-1) +-(k+1) +-(k+2) +-... +-m for at least one choice of signs. - Rick L. Shepherd, Oct 29 2008
A145768(a(n)) is even. - Reinhard Zumkeller, Jun 05 2012
Multiples of 4 interleaved with 1 less than multiples of 4. - Wesley Ivan Hurt, Nov 08 2013
((2*k+0) + (2*k+1) + ... + (2*k+m-1) + (2*k+m)) is even if and only if m = a(n) for some n where k is any nonnegative integer. - Gionata Neri, Jul 24 2015
Numbers whose binary reflected Gray code (A014550) ends with 0. - Amiram Eldar, May 17 2021

Examples

			G.f. = 3*x + 4*x^2 + 7*x^3 + 8*x^4 + 11*x^5 + 12*x^6 + 15*x^7 + 16*x^8 + ...
		

References

  • H. Cohen, Course in Computational Alg. No. Theory, Springer, 1993, pp. 514-5.
  • A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, p. 108.

Crossrefs

Cf. A274406. - Bruno Berselli, Jun 26 2016

Programs

  • Haskell
    a014601 n = a014601_list !! n
    a014601_list = [x | x <- [0..], mod x 4 `elem` [0, 3]]
    -- Reinhard Zumkeller, Jun 05 2012
  • Magma
    [n: n in [0..200]|n mod 4 in {0,3}]; // Vincenzo Librandi, Dec 24 2010
    
  • Maple
    A014601:=n->3*n-2*floor(n/2); seq(A014601(k), k=0..100); # Wesley Ivan Hurt, Nov 08 2013
  • Mathematica
    aa = {}; Do[Do[Do[d = b^2 - 4 a c; If[d <= 0, AppendTo[aa, -d]], {a, 0, 50}], {b, 0, 50}], {c, 0, 50}]; Union[aa] (* Artur Jasinski, Apr 28 2008 *)
    Select[Range[0, 124], Or[Mod[#, 4] == 0, Mod[#, 4] == 3] &] (* Ant King, Nov 18 2010 *)
    CoefficientList[Series[2 x/(1 - x)^2 + (1/(1 - x) + 1/(1 + x)) x/2, {x, 0, 100}], x] (* Vincenzo Librandi, May 18 2014 *)
    a[ n_] := 2 n + Mod[n, 2]; (* Michael Somos, Jul 24 2015 *)
  • PARI
    {a(n) = 2*n + n%2}; /* Michael Somos, Dec 27 2010 */
    

Formula

a(n) = (n + 1)*2 + 1 - n mod 2. - Reinhard Zumkeller, Apr 21 2003
A014494(n) = A000217(a(n)). - Reinhard Zumkeller, Oct 04 2004
a(n) = Sum_{k=1..n} (2 - (-1)^k). - William A. Tedeschi, Mar 20 2008
A139131(a(n)) = A078636(a(n)). - Reinhard Zumkeller, Apr 10 2008
From R. J. Mathar, Sep 25 2009: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 2.
G.f.: x*(3+x)/((1+x)*(x-1)^2). (End)
a(n) = 2*n + (n mod 2). - Paolo Valzasina (p.valzasina(AT)gmail.com), Nov 24 2009
a(n) = (4*n - (-1)^n + 1)/2. - Bruno Berselli, Oct 06 2010
a(n) = 4*n - a(n-1) - 1 (with a(0) = 0). - Vincenzo Librandi, Dec 24 2010
a(n) = -A042948(-n) for all n in Z. - Michael Somos, Dec 27 2010
G.f.: 2*x / (1 - x)^2 + (1 / (1 - x) + 1 / (1 + x)) * x/2. - Michael Somos, Dec 27 2010
a(n) = Sum_{k>=0} A030308(n,k)*b(k) with b(0) = 3 and b(k) = 2^(k+1) for k > 0. - Philippe Deléham, Oct 17 2011
a(n) = ceiling((4/3)*ceiling(3*n/2)). - Clark Kimberling, Jul 04 2012
a(n) = 3n - 2*floor(n/2). - Wesley Ivan Hurt, Nov 08 2013
a(n) = A042948(n+1) - 1 for all n in Z. - Michael Somos, Jul 24 2015
a(n) + a(n+1) = A004767(n) for all n in Z. - Michael Somos, Jul 24 2015
Sum_{n>=1} (-1)^(n+1)/a(n) = 3*log(2)/4 - Pi/8. - Amiram Eldar, Dec 05 2021
E.g.f.: ((4*x + 1)*exp(x) - exp(-x))/2. - David Lovler, Aug 04 2022

A047522 Numbers that are congruent to {1, 7} mod 8.

Original entry on oeis.org

1, 7, 9, 15, 17, 23, 25, 31, 33, 39, 41, 47, 49, 55, 57, 63, 65, 71, 73, 79, 81, 87, 89, 95, 97, 103, 105, 111, 113, 119, 121, 127, 129, 135, 137, 143, 145, 151, 153, 159, 161, 167, 169, 175, 177, 183, 185, 191, 193, 199, 201, 207, 209, 215, 217, 223, 225, 231, 233
Offset: 1

Views

Author

Keywords

Comments

Also n such that Kronecker(2,n) = mu(gcd(2,n)). - Jon Perry and T. D. Noe, Jun 13 2003
Also n such that x^2 == 2 (mod n) has a solution. The primes are given in sequence A001132. - T. D. Noe, Jun 13 2003
As indicated in the formula, a(n) is related to the even triangular numbers. - Frederick Magata (frederick.magata(AT)uni-muenster.de), Jun 17 2004
Cf. property described by Gary Detlefs in A113801: more generally, these a(n) are of the form (2*h*n + (h-4)*(-1)^n-h)/4 (h,n natural numbers). Therefore a(n)^2 - 1 == 0 (mod h); in this case, a(n)^2 - 1 == 0 (mod 8). Also a(n)^2 - 1 == 0 (mod 16). - Bruno Berselli, Nov 17 2010
A089911(3*a(n)) = 2. - Reinhard Zumkeller, Jul 05 2013
S(a(n+1)/2, 0) = (1/2)*(S(a(n+1), sqrt(2)) - S(a(n+1) - 2, sqrt(2))) = T(a(n+1), sqrt(2)/2) = cos(a(n+1)*Pi/4) = sqrt(2)/2 = A010503, identically for n >= 0, where S is the Chebyshev polynomial (A049310) here extended to fractional n, evaluated at x = 0. (For T see A053120.) - Wolfdieter Lang, Jun 04 2023

References

  • L. B. W. Jolley, Summation of Series, Dover Publications, 1961, p. 16.

Crossrefs

Programs

  • Haskell
    a047522 n = a047522_list !! (n-1)
    a047522_list = 1 : 7 : map (+ 8) a047522_list
    -- Reinhard Zumkeller, Jan 07 2012
    
  • Mathematica
    Select[Range[1, 191, 2], JacobiSymbol[2, # ]==1&]
  • PARI
    a(n)=4*n-2+(-1)^n \\ Charles R Greathouse IV, Sep 24 2015

Formula

a(n) = sqrt(8*A014494(n)+1) = sqrt(16*ceiling(n/2)*(2*n+1)+1) = sqrt(8*A056575(n)-8*(2n+1)*(-1)^n+1). - Frederick Magata (frederick.magata(AT)uni-muenster.de), Jun 17 2004
1 - 1/7 + 1/9 - 1/15 + 1/17 - ... = (Pi/8)*(1 + sqrt(2)). [Jolley] - Gary W. Adamson, Dec 16 2006
From R. J. Mathar, Feb 19 2009: (Start)
a(n) = 4n - 2 + (-1)^n = a(n-2) + 8.
G.f.: x(1+6x+x^2)/((1+x)(1-x)^2). (End)
a(n) = 8*n - a(n-1) - 8. - Vincenzo Librandi, Aug 06 2010
From Bruno Berselli, Nov 17 2010: (Start)
a(n) = -a(-n+1) = a(n-1) + a(n-2) - a(n-3).
a(n) = 8*A000217(n-1)+1 - 2*Sum_{i=1..n-1} a(i) for n > 1. (End)
E.g.f.: 1 + (4*x - 1)*cosh(x) + (4*x - 3)*sinh(x). - Stefano Spezia, May 13 2021
E.g.f.: 1 + (4*x - 3)*exp(x) + 2*cosh(x). - David Lovler, Jul 16 2022
From Amiram Eldar, Nov 22 2024: (Start)
Product_{n>=1} (1 - (-1)^n/a(n)) = sqrt(2+sqrt(2)) (A179260).
Product_{n>=2} (1 + (-1)^n/a(n)) = (Pi/8)*cosec(Pi/8) (A352125). (End)

A074378 Even triangular numbers halved.

Original entry on oeis.org

0, 3, 5, 14, 18, 33, 39, 60, 68, 95, 105, 138, 150, 189, 203, 248, 264, 315, 333, 390, 410, 473, 495, 564, 588, 663, 689, 770, 798, 885, 915, 1008, 1040, 1139, 1173, 1278, 1314, 1425, 1463, 1580, 1620, 1743, 1785, 1914, 1958, 2093, 2139, 2280, 2328, 2475
Offset: 0

Views

Author

W. Neville Holmes, Sep 04 2002

Keywords

Comments

Set of integers k such that k + (1 + 2 + 3 + 4 + ... + x) = 3*k, where x is sufficiently large. For example, 203 is a term because 203 + (1 + 2 + 3 + 4 + ... +28) = 609 and 609 = 3*203. - Gil Broussard, Sep 01 2008
Set of all m such that 16*m+1 is a perfect square. - Gary Detlefs, Feb 21 2010
Integers of the form Sum_{k=0..n} k/2. - Arkadiusz Wesolowski, Feb 07 2012
Numbers of the form h*(4*h + 1) for h = 0, -1, 1, -2, 2, -3, 3, ... - Bruno Berselli, Feb 26 2018
Numbers whose distance to nearest square equals their distance to nearest oblong; that is, numbers k such that A053188(k) = A053615(k). - Lamine Ngom, Oct 27 2020
The sequence terms are the exponents in the expansion of Product_{n >= 1} (1 - q^(8*n))*(1 + q^(8*n-3))*(1 + q^(8*n-5)) = 1 + q^3 + q^5 + q^14 + q^18 + .... - Peter Bala, Dec 30 2024

Crossrefs

Cf. A010709, A047522. [Vincenzo Librandi, Feb 14 2009]
Cf. A266883 (numbers n such that 16*n-15 is a square).

Programs

  • Magma
    f:=func; [0] cat [f(n*m): m in [-1,1], n in [1..25]]; // Bruno Berselli, Nov 13 2012
  • Maple
    a:=n->(2*n+1)*floor((n+1)/2): seq(a(n),n=0..50); # Muniru A Asiru, Feb 01 2019
  • Mathematica
    1/2 * Select[PolygonalNumber@ Range[0, 100], EvenQ] (* Michael De Vlieger, Jun 01 2017, Version 10.4 *)
    Select[Accumulate[Range[0,100]],EvenQ]/2 (* Harvey P. Dale, Feb 15 2025 *)
  • PARI
    a(n)=(2*n+1)*(n-n\2)
    

Formula

Sum_{n>=0} q^a(n) = (Prod_{n>0} (1-q^n))*(Sum_{n>=0} A035294(n)*q^n).
a(n) = n*(n + 1)/4 where n*(n + 1)/2 is even.
G.f.: x*(3 + 2*x + 3*x^2)/((1 - x)*(1 - x^2)^2).
From Benoit Jubin, Feb 05 2009: (Start)
a(n) = (2*n + 1)*floor((n + 1)/2).
a(2*k) = k*(4*k+1); a(2*k+1) = (k+1)*(4*k+3). (End)
a(2*n) = A007742(n), a(2*n-1) = A033991(n). - Arkadiusz Wesolowski, Jul 20 2012
a(n) = (4*n + 1 - (-1)^n)*(4*n + 3 - (-1)^n)/4^2. - Peter Bala, Jan 21 2019
a(n) = (2*n+1)*(n+1)*(1+(-1)^(n+1))/4 + (2*n+1)*(n)*(1+(-1)^n)/4. - Eric Simon Jacob, Jan 16 2020
From Amiram Eldar, Jul 03 2020: (Start)
Sum_{n>=1} 1/a(n) = 4 - Pi (A153799).
Sum_{n>=1} (-1)^(n+1)/a(n) = 6*log(2) - 4 (See A016687). (End)
a(n) = A014494(n)/2 = A274757(n)/3 = A266883(n) - 1. - Hugo Pfoertner, Dec 31 2024

A058377 Number of solutions to 1 +- 2 +- 3 +- ... +- n = 0.

Original entry on oeis.org

0, 0, 1, 1, 0, 0, 4, 7, 0, 0, 35, 62, 0, 0, 361, 657, 0, 0, 4110, 7636, 0, 0, 49910, 93846, 0, 0, 632602, 1199892, 0, 0, 8273610, 15796439, 0, 0, 110826888, 212681976, 0, 0, 1512776590, 2915017360, 0, 0, 20965992017, 40536016030, 0, 0, 294245741167
Offset: 1

Author

Naohiro Nomoto, Dec 19 2000

Keywords

Comments

Consider the set { 1,2,3,...,n }. Sequence gives number of ways this set can be partitioned into 2 subsets with equal sums. For example, when n = 7, { 1,2,3,4,5,6,7} can be partitioned in 4 ways: {1,6,7} {2,3,4,5}; {2,5,7} {1,3,4,6}; {3,4,7} {1,2,5,6} and {1,2,4,7} {3,5,6}. - sorin (yamba_ro(AT)yahoo.com), Mar 24 2007
The "equal sums" of Sorin's comment are the positive terms of A074378 (Even triangular numbers halved). In the current sequence a(n) <> 0 iff n is the positive index (A014601) of an even triangular number (A014494). - Rick L. Shepherd, Feb 09 2010
a(n) is the number of partitions of n(n-3)/4 into distinct parts not exceeding n-1. - Alon Amit, Oct 18 2017
a(n) is the coefficient of x^(n*(n+1)/4-1) of Product_{k=2..n} (1+x^k). - Jianing Song, Nov 19 2021

Examples

			1+2-3=0, so a(3)=1;
1-2-3+4=0, so a(4)=1;
1+2-3+4-5-6+7=0, 1+2-3-4+5+6-7=0, 1-2+3+4-5+6-7=0, 1-2-3-4-5+6+7=0, so a(7)=4.
		

Programs

  • Maple
    b:= proc(n, i) option remember; local m; m:= i*(i+1)/2;
          `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i), i-1) +b(n+i, i-1)))
        end:
    a:= n-> `if`(irem(n-1, 4)<2, 0, b(n, n-1)):
    seq(a(n), n=1..60);  # Alois P. Heinz, Oct 30 2011
  • Mathematica
    f[n_, s_] := f[n, s] = Which[n == 0, If[s == 0, 1, 0], Abs[s] > (n*(n + 1))/2, 0, True, f[n - 1, s - n] + f[n - 1, s + n]]; Table[ f[n, 0]/2, {n, 1, 50}]
  • PARI
    list(n) = my(poly=vector(n), v=vector(n)); poly[1]=1; for(k=2, n, poly[k]=poly[k-1]*(1+'x^k)); for(k=1, n, if(k%4==1||k%4==2, v[k]=0, v[k]=polcoeff(poly[k], k*(k+1)/4-1))); v \\ Jianing Song, Nov 19 2021

Formula

a(n) is half the coefficient of q^0 in product('(q^(-k)+q^k)', 'k'=1..n) for n >= 1. - Floor van Lamoen, Oct 10 2005
a(4n+1) = a(4n+2) = 0. - Michael Somos, Apr 15 2007
a(n) = [x^n] Product_{k=1..n-1} (x^k + 1/x^k). - Ilya Gutkovskiy, Feb 01 2024

Extensions

More terms from Sascha Kurz, Mar 25 2002
Edited and extended by Robert G. Wilson v, Oct 24 2002

A014493 Odd triangular numbers.

Original entry on oeis.org

1, 3, 15, 21, 45, 55, 91, 105, 153, 171, 231, 253, 325, 351, 435, 465, 561, 595, 703, 741, 861, 903, 1035, 1081, 1225, 1275, 1431, 1485, 1653, 1711, 1891, 1953, 2145, 2211, 2415, 2485, 2701, 2775, 3003, 3081, 3321, 3403, 3655, 3741, 4005, 4095, 4371, 4465, 4753, 4851
Offset: 1

Keywords

Comments

Odd numbers of the form n*(n+1)/2.
For n such that n(n+1)/2 is odd see A042963 (congruent to 1 or 2 mod 4).
Even central polygonal numbers minus 1. - Omar E. Pol, Aug 17 2011
Odd generalized hexagonal numbers. - Omar E. Pol, Sep 24 2015

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 68.

Programs

  • GAP
    List([1..50], n -> (2*n-1)*(2*n-1-(-1)^n)/2); # G. C. Greubel, Feb 09 2019
    
  • Magma
    [(2*n-1)*(2*n-1-(-1)^n)/2: n in [1..50]]; // Vincenzo Librandi, Aug 18 2011
    
  • Maple
    [(2*n-1)*(2*n-1-(-1)^n)/2$n=1..50]; # Muniru A Asiru, Mar 10 2019
  • Mathematica
    Select[ Table[n(n + 1)/2, {n, 93}], OddQ[ # ] &] (* Robert G. Wilson v, Nov 05 2004 *)
    LinearRecurrence[{1,2,-2,-1,1},{1,3,15,21,45},50] (* Harvey P. Dale, Jun 19 2011 *)
  • PARI
    a(n)=(2*n-1)*(2*n-1-(-1)^n)/2 \\ Charles R Greathouse IV, Sep 24 2015
    
  • Python
    def A014493(n): return ((n<<1)-1)*(n-(n&1^1)) # Chai Wah Wu, Feb 12 2023
  • Sage
    [(2*n-1)*(2*n-1-(-1)^n)/2 for n in (1..50)] # G. C. Greubel, Feb 09 2019
    

Formula

From Ant King, Nov 17 2010: (Start)
a(n) = (2*n-1)*(2*n - 1 - (-1)^n)/2.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). (End)
G.f.: x*(1 + 2*x + 10*x^2 + 2*x^3 + x^4)/((1+x)^2*(1-x)^3). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 10 2009
a(n) = A000217(A042963(n)). - Reinhard Zumkeller, Feb 14 2012, Oct 04 2004
a(n) = A193868(n) - 1. - Omar E. Pol, Aug 17 2011
Let S = Sum_{n>=0} x^n/a(n), then S = Q(0) where Q(k) = 1 + x*(4*k+1)/(4*k + 3 - x*(2*k+1)*(4*k+3)^2/(x*(2*k+1)*(4*k+3) + (4*k+5)*(2*k+3)/Q(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 27 2013
E.g.f.: (2*x^2+x+1)*cosh(x)+x*(2*x-1)*sinh(x)-1. - Ilya Gutkovskiy, Apr 24 2016
Sum_{n>=1} 1/a(n) = Pi/2 (A019669). - Robert Bilinski, Jan 20 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2). - Amiram Eldar, Mar 06 2022

Extensions

More terms from Erich Friedman

A299645 Numbers of the form m*(8*m + 5), where m is an integer.

Original entry on oeis.org

0, 3, 13, 22, 42, 57, 87, 108, 148, 175, 225, 258, 318, 357, 427, 472, 552, 603, 693, 750, 850, 913, 1023, 1092, 1212, 1287, 1417, 1498, 1638, 1725, 1875, 1968, 2128, 2227, 2397, 2502, 2682, 2793, 2983, 3100, 3300, 3423, 3633, 3762, 3982, 4117, 4347, 4488, 4728, 4875
Offset: 1

Author

Bruno Berselli, Feb 26 2018

Keywords

Comments

Equivalently, numbers k such that 32*k + 25 is a square. This means that 4*a(n) + 3 is a triangular number.
Interleaving of A139277 and A139272 (without 0).

Crossrefs

Subsequence of A011861, A047222.
Cf. numbers of the form m*(8*m + h): A154260 (h=1), A014494 (h=2), A274681 (h=3), A046092 (h=4), this sequence (h=5), 2*A074377 (h=6), A274979 (h=7).

Programs

  • GAP
    List([1..50], n -> (8*n*(n-1)-(2*n-1)*(-1)^n-1)/4);
    
  • Julia
    [div((8n*(n-1)-(2n-1)*(-1)^n-1), 4) for n in 1:50] # Peter Luschny, Feb 27 2018
  • Magma
    [(8*n*(n-1)-(2*n-1)*(-1)^n-1)/4: n in [1..50]];
    
  • Maple
    seq((exp(I*Pi*x)*(1-2*x)+8*(x-1)*x-1)/4, x=1..50); # Peter Luschny, Feb 27 2018
  • Mathematica
    Table[(8 n (n - 1) - (2 n - 1) (-1)^n - 1)/4, {n, 1, 50}]
  • Maxima
    makelist((8*n*(n-1)-(2*n-1)*(-1)^n-1)/4, n, 1, 50);
    
  • PARI
    vector(50, n, nn; (8*n*(n-1)-(2*n-1)*(-1)^n-1)/4)
    
  • PARI
    concat(0, Vec(x^2*(3 + 10*x + 3*x^2)/((1 - x)^3*(1 + x)^2) + O(x^60))) \\ Colin Barker, Feb 27 2018
    
  • Python
    [(8*n*(n-1)-(2*n-1)*(-1)**n-1)/4 for n in range(1, 60)]
    
  • Python
    def A299645(n): return (n>>1)*((n<<2)+(1 if n&1 else -5)) # Chai Wah Wu, Mar 11 2025
    
  • Sage
    [(8*n*(n-1)-(2*n-1)*(-1)^n-1)/4 for n in (1..50)]
    

Formula

O.g.f.: x^2*(3 + 10*x + 3*x^2)/((1 - x)^3*(1 + x)^2).
E.g.f.: (1 + 2*x - (1 - 8*x^2)*exp(2*x))*exp(-x)/4.
a(n) = a(-n+1) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = (8*n*(n - 1) - (2*n - 1)*(-1)^n - 1)/4 = (2*n + (-1)^n - 1)*(4*n - 3*(-1)^n - 2)/4. Therefore, 3 and 13 are the only prime numbers in this sequence.
a(n) + a(n+1) = 4*n^2 for even n, otherwise a(n) + a(n+1) = 4*n^2 - 1.
From Amiram Eldar, Mar 18 2022: (Start)
Sum_{n>=2} 1/a(n) = 8/25 + (sqrt(2)-1)*Pi/5.
Sum_{n>=2} (-1)^n/a(n) = 8*log(2)/5 - sqrt(2)*log(2*sqrt(2)+3)/5 - 8/25. (End)
a(n) = (n-1)*(4*n+1)/2 if n is odd and a(n) = n*(4*n-5)/2 if n is even. - Chai Wah Wu, Mar 11 2025

A193867 Odd central polygonal numbers.

Original entry on oeis.org

1, 7, 11, 29, 37, 67, 79, 121, 137, 191, 211, 277, 301, 379, 407, 497, 529, 631, 667, 781, 821, 947, 991, 1129, 1177, 1327, 1379, 1541, 1597, 1771, 1831, 2017, 2081, 2279, 2347, 2557, 2629, 2851, 2927, 3161, 3241, 3487, 3571, 3829, 3917, 4187, 4279
Offset: 1

Author

Omar E. Pol, Aug 15 2011

Keywords

Comments

Even triangular numbers plus 1.
Union of A188135 and A185438 without repetitions (A188135 is a bisection of this sequence. Another bisection is A185438 but without its initial term).

Programs

  • Mathematica
    Select[Accumulate[Range[0,100]],EvenQ]+1 (* or *) LinearRecurrence[{1,2,-2,-1,1},{1,7,11,29,37},50] (* Harvey P. Dale, Nov 29 2014 *)
  • PARI
    Vec(-x*(x^2+1)*(x^2+6*x+1) / ((1+x)^2*(x-1)^3) + O(x^100)) \\ Colin Barker, Jan 27 2016

Formula

a(n) = A000124(A014601(n-1)).
a(n) = 1 + A014494(n-1).
G.f.: -x*(x^2+1)*(x^2+6*x+1) / ( (1+x)^2*(x-1)^3 ). - R. J. Mathar, Aug 25 2011
From Colin Barker, Jan 27 2016: (Start)
a(n) = (4*n^2+2*(-1)^n*n-4*n-(-1)^n+3)/2.
a(n) = 2*n^2-n+1 for n even.
a(n) = 2*n^2-3*n+2 for n odd. (End)
Sum_{n>=1} 1/a(n) = 2*Pi*sinh(sqrt(7)*Pi/4)/(sqrt(7)*(2*cosh(sqrt(7)*Pi/4) - sqrt(2))). - Amiram Eldar, May 11 2025

A353136 Primes whose gaps to both neighbor primes are triangular numbers.

Original entry on oeis.org

53, 157, 173, 251, 257, 263, 337, 373, 547, 557, 563, 577, 587, 593, 607, 653, 733, 947, 977, 1039, 1103, 1123, 1181, 1187, 1223, 1367, 1627, 1747, 1753, 1907, 2017, 2063, 2287, 2417, 2677, 2719, 2897, 2903, 2963, 3307, 3313, 3517, 3547, 3637, 3733, 4013, 4211
Offset: 1

Author

Alois P. Heinz, Apr 25 2022

Keywords

Examples

			Prime 251 is a term, the gap to the previous prime 241 is 10 and the gap to the next prime 257 is 6 and both gaps are triangular numbers.
		

Programs

  • Maple
    t:= proc(n) option remember; issqr(8*n+1) end:
    q:= n-> isprime(n) and andmap(t, [n-prevprime(n), nextprime(n)-n]):
    select(q, [$3..5000])[];
  • Mathematica
    t[n_] := IntegerQ@Sqrt[8n+1];
    q[n_] := PrimeQ[n] && t[n-NextPrime[n, -1]] && t[NextPrime[n]-n];
    Select[Range[3, 5000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)

A014738 Squares of even triangular numbers.

Original entry on oeis.org

36, 100, 784, 1296, 4356, 6084, 14400, 18496, 36100, 44100, 76176, 90000, 142884, 164836, 246016, 278784, 396900, 443556, 608400, 672400, 894916, 980100, 1272384, 1382976, 1758276, 1898884, 2371600, 2547216, 3132900, 3348900
Offset: 0

Keywords

Crossrefs

Programs

  • GAP
    List([1..30], n-> ((2*n+1)*(2*n+1-(-1)^n))^2/4); # G. C. Greubel, Jul 24 2019
  • Magma
    [((2*n+1)*(2*n+1-(-1)^n))^2/4: n in [1..30]]; // G. C. Greubel, Jul 24 2019
    
  • Mathematica
    Select[Accumulate[Range[100]],EvenQ]^2 (* Harvey P. Dale, Oct 09 2012 *)
  • PARI
    vector(30, n, ((2*n+1)*(2*n+1-(-1)^n))^2/4) \\ G. C. Greubel, Jul 24 2019
    
  • Sage
    [((2*n+1)*(2*n+1-(-1)^n))^2/4 for n in (1..30)] # G. C. Greubel, Jul 24 2019
    

Formula

a(n) = A014494(n + 1)^2. - Sean A. Irvine, Nov 18 2018
From G. C. Greubel, Jul 24 2019: (Start)
G.f.: 4*x*(9 +16*x +135*x^2 +64*x^3 +135*x^4 +16*x^5 +9*x^6)/((1-x)^5*(1+x)^4).
E.g.f.: x*(35+41*x+36*x^2+4*x^3)*cosh(x) + (1+9*x+77*x^2+28*x^3+4*x^4)* sinh(x). (End)
From Amiram Eldar, Mar 06 2022: (Start)
Sum_{n>=0} 1/a(n) = 7*Pi^2/12 + 2*Pi - 12.
Sum_{n>=0} (-1)^n/a(n) = 12 - 4*G - 12*log(2), where G is Catalan's constant (A006752). (End)

Extensions

More terms from James Sellers
Showing 1-10 of 15 results. Next