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

A054488 Expansion of (1+2*x)/(1-6*x+x^2).

Original entry on oeis.org

1, 8, 47, 274, 1597, 9308, 54251, 316198, 1842937, 10741424, 62605607, 364892218, 2126747701, 12395593988, 72246816227, 421085303374, 2454265004017, 14304504720728, 83372763320351, 485932075201378, 2832219687887917
Offset: 0

Views

Author

Barry E. Williams, May 04 2000

Keywords

Comments

Bisection (even part) of Chebyshev sequence with Diophantine property.
b(n)^2 - 8*a(n)^2 = 17, with the companion sequence b(n)= A077240(n).
The odd part is A077413(n) with Diophantine companion A077239(n).

Examples

			8 = a(1) = sqrt((A077240(1)^2 - 17)/8) = sqrt((23^2 - 17)/8)= sqrt(64) = 8.
		

References

  • A. H. Beiler, Recreations in the Theory of Numbers, Dover, N. Y., 1964, pp. 122-125, 194-196.

Crossrefs

Cf. A077241 (even and odd parts).

Programs

  • GAP
    a:=[1,8];; for n in [3..30] do a[n]:=6*a[n-1]-a[n-2]; od; a; # G. C. Greubel, Jan 19 2020
  • Magma
    I:=[1,8]; [n le 2 select I[n] else 6*Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 19 2020
    
  • Magma
    R:=PowerSeriesRing(Integers(), 21); Coefficients(R!( (1+2*x)/(1-6*x+x^2))); // Marius A. Burtea, Jan 20 2020
    
  • Maple
    a[0]:=1: a[1]:=8: for n from 2 to 26 do a[n]:=6*a[n-1]-a[n-2] od: seq(a[n], n=0..20); # Zerinvary Lajos, Jul 26 2006
  • Mathematica
    LinearRecurrence[{6,-1},{1,8},30] (* Harvey P. Dale, Oct 09 2017 *)
    Table[(LucasL[2*n+1, 2] + Fibonacci[2*n, 2])/2, {n,0,30}] (* G. C. Greubel, Jan 19 2020 *)
  • PARI
    my(x='x+O('x^30)); Vec((1+2*x)/(1-6*x+x^2)) \\ G. C. Greubel, Jan 19 2020
    
  • PARI
    apply( {A054488(n)=[1,8]*([0,-1;1,6]^n)[,1]}, [0..30]) \\ M. F. Hasler, Feb 27 2020
    
  • Sage
    [(lucas_number2(2*n+1,2,-1) + lucas_number1(2*n,2,-1))/2 for n in (0..30)] # G. C. Greubel, Jan 19 2020
    

Formula

a(n) = 6*a(n-1) - a(n-2), a(0)=1, a(1)=8.
a(n) = ((3 + 2*sqrt(2))^(n+1) - (3 - 2*sqrt(2))^(n+1) + 2*((3 + 2*sqrt(2))^n - (3 - 2*sqrt(2))^n))/(4*sqrt(2)).
a(n) = S(n, 6) + 2*S(n-1, 6), with S(n, x) Chebyshev's polynomials of the second kind, A049310. S(n, 6) = A001109(n+1).
a(n) = (-1)^n*Sum_{k = 0..n} A238731(n,k)*(-9)^k. - Philippe Deléham, Mar 05 2014
a(n) = (Pell(2*n+2) + 2*Pell(2*n))/2 = (Pell-Lucas(2*n+1) + Pell(2*n))/2. - G. C. Greubel, Jan 19 2020
E.g.f.: (1/4)*exp(3*x)*(4*cosh(2*sqrt(2)*x) + 5*sqrt(2)*sinh(2*sqrt(2)*x)). - Stefano Spezia, Jan 27 2020

Extensions

More terms from James Sellers, May 05 2000
Chebyshev comments from Wolfdieter Lang, Nov 08 2002

A276600 Values of m such that m^2 + 6 is a triangular number (A000217).

Original entry on oeis.org

0, 2, 3, 7, 15, 20, 42, 88, 117, 245, 513, 682, 1428, 2990, 3975, 8323, 17427, 23168, 48510, 101572, 135033, 282737, 592005, 787030, 1647912, 3450458, 4587147, 9604735, 20110743, 26735852, 55980498, 117214000, 155827965, 326278253, 683173257, 908231938
Offset: 1

Views

Author

Colin Barker, Sep 07 2016

Keywords

Comments

2*a(n+2) gives the y members of all positive solutions (x(n), y(n)), proper and improper, of the Pell equation x^2 - 2*y^2 = 7^2, n >= 0. The corresponding x members are x(n) = A106525(n). - Wolfdieter Lang, Sep 29 2016

Examples

			7 is in the sequence because 7^2 + 6 = 55, which is a triangular number.
		

Crossrefs

Cf. A001109 (k=0), A106328 (k=1), A077241 (k=2), A276598 (k=3), A276599 (k=5), A276601 (k=9), A276602 (k=10), where k is the value added to n^2.

Programs

  • Magma
    I:=[0,2,3,7,15,20]; [n le 6 select I[n] else 6*Self(n-3) - Self(n-6): n in [1..41]]; // G. C. Greubel, Sep 15 2021
    
  • Mathematica
    LinearRecurrence[{0,0,6,0,0,-1}, {0,2,3,7,15,20}, 41] (* G. C. Greubel, Sep 15 2021 *)
  • PARI
    concat(0, Vec(x^2*(2+3*x+7*x^2+3*x^3+2*x^4)/(1-6*x^3+x^6) + O(x^40)))
    
  • Sage
    def A276600_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x^2*(2+3*x+7*x^2+3*x^3+2*x^4)/(1-6*x^3+x^6) ).list()
    a=A276600_list(41); a[1:] # G. C. Greubel, Sep 15 2021

Formula

a(n) = 6*a(n-3) - a(n-6) for n>6.
G.f.: x^2*(2 + 3*x + 7*x^2 + 3*x^3 + 2*x^4)/(1 - 6*x^3 + x^6).
From Wolfdieter Lang, Sep 29 2016: (Start)
Trisection:
a(2+3*n) = 15*S(n-1,6) - 2*S(n-2,6) = A275794(n),
a(3+3*n) = 20*S(n-1,6) - 3*S(n-2,6) = A275796(n),
a(4+3*n) = 7*(6*S(n-1,6) - S(n-2,6)) = 7*A001109(n+1) for n >= 0, with the Chebyshev polynomials S(n, 6) = A001109(n+1), n >= -1, with S(-2, 6) = -1.
(End)

A077242 Combined Diophantine Chebyshev sequences A077240 and A077239.

Original entry on oeis.org

5, 7, 23, 37, 133, 215, 775, 1253, 4517, 7303, 26327, 42565, 153445, 248087, 894343, 1445957, 5212613, 8427655, 30381335, 49119973, 177075397, 286292183, 1032071047, 1668633125, 6015350885, 9725506567, 35060034263, 56684406277, 204344854693, 330380931095
Offset: 0

Views

Author

Wolfdieter Lang, Nov 08 2002

Keywords

Comments

a(n)^2 - 8*b(n)^2 = 17, with the companion sequence b(n)= A077241(n).
Because there is only one primitive Pythagorean triangle with sum of the legs L = 17 (see also A120681), namely (5,12,13), all positive solutions (x(n), y(n)) = (a(n), 2*A077241(n)) of the (generalized) Pell equation x^2 - 2*y^2 = +17 satisfy x(n) < 2*y(n), for n >= 1, only 5 = x(0) > 2*y(0) = 4. The proof runs along the same line as the one given in a comment on the L=7 case in A077443. - Wolfdieter Lang, Feb 05 2015

Examples

			23 = a(2) = sqrt(8*A077241(2)^2 + 17) = sqrt(8*8^2 + 17)= sqrt(529) = 23.
		

Programs

  • Magma
    I:=[5,7,23,37]; [n le 4 select I[n] else 6*Self(n-2)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Feb 18 2014
    
  • Mathematica
    A077239 = Table[2*ChebyshevT[n+1, 3] + ChebyshevT[n, 3], {n, 0, 12}]; A077240 = Table[ChebyshevT[n+1, 3] + 2*ChebyshevT[n, 3], {n, 0, 12}]; Riffle[A077240, A077239] (* Jean-François Alcover, Dec 19 2013 *)
    CoefficientList[Series[(1 - x) (5 + 12 x + 5 x^2)/(1 - 6 x^2 + x^4), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 18 2014 *)
  • PARI
    Vec((1-x)*(5+12*x+5*x^2)/(1-6*x^2+x^4) + O(x^50)) \\ Colin Barker, Mar 27 2016

Formula

a(2*k) = A077240(k) and a(2*k+1) = A077239(k), k>=0.
G.f.: (1-x)*(5+12*x+5*x^2)/(1-6*x^2+x^4).
a(n) = 6*a(n-2)-a(n-4) for n>3. - Vincenzo Librandi, Feb 18 2014
a(n) = ((6-5*sqrt(2))*(1-sqrt(2))^n - (-1-sqrt(2))^n*(-4+sqrt(2)) + 4*(-1+sqrt(2))^n + sqrt(2)*(-1+sqrt(2))^n + 6*(1+sqrt(2))^n + 5*sqrt(2)*(1+sqrt(2))^n)/4. - Colin Barker, Mar 27 2016

A077413 Bisection (odd part) of Chebyshev sequence with Diophantine property.

Original entry on oeis.org

2, 13, 76, 443, 2582, 15049, 87712, 511223, 2979626, 17366533, 101219572, 589950899, 3438485822, 20040964033, 116807298376, 680802826223, 3968009658962, 23127255127549, 134795521106332, 785645871510443, 4579079707956326, 26688832376227513, 155553914549408752
Offset: 0

Views

Author

Wolfdieter Lang, Nov 08 2002

Keywords

Comments

-8*a(n)^2 + b(n)^2 = 17, with the companion sequence b(n) = A077239(n).
The even part is A054488(n) with Diophantine companion A077240(n).

Examples

			8*a(1)^2 + 17 = 8*13^2+17 = 1369 = 37^2 = A077239(1)^2.
G.f. = 2 + 13*x + 76*x^2 + 443*x^3 + 2582*x^4 + ... - _Michael Somos_, Jul 30 2024
		

Crossrefs

Cf. A077241 (even and odd parts), A001109, A054488.

Programs

  • Magma
    I:=[2,13]; [n le 2 select I[n] else 6*Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 18 2018
  • Mathematica
    LinearRecurrence[{6,-1}, {2,13}, 30] (* or *) CoefficientList[Series[ (2+x)/(1-6*x+x^2), {x, 0, 50}], x] (* G. C. Greubel, Jan 18 2018 *)
    a[ n_] := 2*ChebyshevU[n, 3] + ChebyshevU[n-1, 3]; (* Michael Somos, Jul 30 2024 *)
  • PARI
    Vec((2+x)/(1-6*x+x^2) + O(x^30)) \\ Colin Barker, Jun 16 2015
    
  • PARI
    {a(n) = 2*polchebyshev(n, 2, 3) + polchebyshev(n-1, 2, 3)}; /* Michael Somos, Jul 30 2024 */
    
  • PARI
    {a(n) = my(w = 3 + quadgen(32)); imag(w^n + 2*w^(n+1))}; /* Michael Somos, Jul 30 2024 */
    

Formula

a(n) = 6*a(n-1) - a(n-2), a(-1)=-1, a(0)=2.
a(n) = 2*S(n, 6)+S(n-1, 6), with S(n, x) = U(n, x/2), Chebyshev polynomials of 2nd kind, A049310. S(n, 6) = A001109(n+1).
G.f.: (2+x)/(1-6*x+x^2).
a(n) = (((3-2*sqrt(2))^n*(-7+4*sqrt(2))+(3+2*sqrt(2))^n*(7+4*sqrt(2))))/(4*sqrt(2)). - Colin Barker, Oct 12 2015
a(n) = -A054488(-1-n) for all n in Z. - Michael Somos, Jul 30 2024

A276598 Values of m such that m^2 + 3 is a triangular number (A000217).

Original entry on oeis.org

0, 5, 30, 175, 1020, 5945, 34650, 201955, 1177080, 6860525, 39986070, 233055895, 1358349300, 7917039905, 46143890130, 268946300875, 1567533915120, 9136257189845, 53250009223950, 310363798153855, 1808932779699180, 10543232880041225, 61450464500548170
Offset: 1

Views

Author

Colin Barker, Sep 07 2016

Keywords

Examples

			5 is in the sequence because 5^2 + 3 = 28, which is a triangular number.
		

Crossrefs

Cf. A001109 (k=0), A106328 (k=1), A077241 (k=2), A276599 (k=5), A276600 (k=6), A276601 (k=9), A276602 (k=10), where k is the value added to n^2.
Cf. A328791 (the resulting triangular numbers).

Programs

  • Magma
    [n le 2 select 5*(n-1) else 6*Self(n-1) - Self(n-2): n in [1..31]]; // G. C. Greubel, Sep 15 2021
    
  • Mathematica
    CoefficientList[Series[5*x/(1 - 6*x + x^2), {x, 0, 20}], x] (* Wesley Ivan Hurt, Sep 07 2016 *)
    LinearRecurrence[{6,-1},{0,5},30] (* Harvey P. Dale, Apr 26 2019 *)
    (5/2)*Fibonacci[2*Range[30] -2, 2] (* G. C. Greubel, Sep 15 2021 *)
  • PARI
    concat(0, Vec(5*x^2/(1-6*x+x^2) + O(x^30)))
    
  • PARI
    a(n)=([0,1;-1,6]^n*[-5;0])[1,1] \\ Charles R Greathouse IV, Sep 07 2016
    
  • Sage
    [(5/2)*lucas_number1(2*n-2, 2, -1) for n in (1..30)] # G. C. Greubel, Sep 15 2021

Formula

a(n) = 5*A001109(n-1).
a(n) = 5*( (3 - 2*sqrt(2))*(3 + 2*sqrt(2))^n - (3 + 2*sqrt(2))*(3 - 2*sqrt(2))^n )/(4*sqrt(2)).
a(n) = 6*a(n-1) - a(n-2) for n>2.
G.f.: 5*x^2 / (1-6*x+x^2).
a(n) = (5/2)*A000129(2*n-2). - G. C. Greubel, Sep 15 2021

A276599 Values of n such that n^2 + 5 is a triangular number (A000217).

Original entry on oeis.org

1, 4, 10, 25, 59, 146, 344, 851, 2005, 4960, 11686, 28909, 68111, 168494, 396980, 982055, 2313769, 5723836, 13485634, 33360961, 78600035, 194441930, 458114576, 1133290619, 2670087421, 6605301784, 15562409950, 38498520085, 90704372279, 224385818726
Offset: 1

Views

Author

Colin Barker, Sep 07 2016

Keywords

Examples

			4 is in the sequence because 4^2 + 5 = 21, which is a triangular number.
		

Crossrefs

Cf. A001109 (k=0), A106328 (k=1), A077241 (k=2), A276598 (k=3), A276600 (k=6), A276601 (k=9), A276602 (k=10), where k is the value added to n^2.

Programs

  • Magma
    I:=[1,4,10,25]; [n le 4 select I[n] else 6*Self(n-2) - Self(n-4): n in [1..31]]; // G. C. Greubel, Sep 15 2021
    
  • Mathematica
    CoefficientList[Series[(1+x)*(1+3*x+x^2)/((1+2*x-x^2)*(1-2*x-x^2)), {x, 0, 30}], x] (* Wesley Ivan Hurt, Sep 07 2016 *)
    LinearRecurrence[{0,6,0,-1},{1,4,10,25},30] (* Harvey P. Dale, Feb 13 2017 *)
  • PARI
    Vec(x*(1+x)*(1+3*x+x^2)/((1+2*x-x^2)*(1-2*x-x^2)) + O(x^40))
    
  • PARI
    a(n)=([0,1;-1,6]^(n\2)*if(n%2,[1;10],[-1;4]))[1,1] \\ Charles R Greathouse IV, Sep 07 2016
    
  • Sage
    def P(n): return lucas_number1(n, 2, -1)
    [(1/4)*(P(n+2) + P(n+1) + (-1)^n*(3*P(n) - 7*P(n-1))) for n in (1..30)] # G. C. Greubel, Sep 15 2021

Formula

a(n) = 6*a(n-2) - a(n-4) for n>4.
G.f.: x*(1+x)*(1+3*x+x^2) / ((1+2*x-x^2)*(1-2*x-x^2)).
a(n) = (1/4)*(P(n+2) + P(n+1) + (-1)^n*(3*P(n) - 7*P(n-1))), where P(n) = A000129(n). - G. C. Greubel, Sep 15 2021

A276601 Values of k such that k^2 + 9 is a triangular number (A000217).

Original entry on oeis.org

1, 6, 12, 37, 71, 216, 414, 1259, 2413, 7338, 14064, 42769, 81971, 249276, 477762, 1452887, 2784601, 8468046, 16229844, 49355389, 94594463, 287664288, 551336934, 1676630339, 3213427141, 9772117746, 18729225912, 56956076137, 109161928331, 331964339076
Offset: 1

Views

Author

Colin Barker, Sep 07 2016

Keywords

Examples

			6 is in the sequence because 6^2+9 = 45, which is a triangular number.
		

Crossrefs

Cf. A001109 (k=0), A106328 (k=1), A077241 (k=2), A276598 (k=3), A276599 (k=5), A276600 (k=6), A276602 (k=10), where k is the value added to n^2.

Programs

  • Magma
    I:=[1,6,12,37]; [n le 2 select I[n] else 6*Self(n-2) - Self(n-4): n in [1..31]]; // G. C. Greubel, Sep 15 2021
    
  • Mathematica
    CoefficientList[Series[(1+x)*(1+5*x+x^2)/((1+2*x-x^2)*(1-2*x-x^2)), {x, 0, 30}], x] (* Wesley Ivan Hurt, Sep 07 2016 *)
    LinearRecurrence[{0,6,0,-1}, {1,6,12,37}, 31] (* G. C. Greubel, Sep 15 2021 *)
  • PARI
    Vec(x*(1+x)*(1+5*x+x^2) / ((1+2*x-x^2)*(1-2*x-x^2)) + O(x^40))
    
  • Sage
    def P(n): return lucas_number1(n, 2, -1)
    [(1/4)*(5*P(n+1) - P(n) + (-1)^n*(P(n-1) + 5*P(n-2))) for n in (1..30)] # G. C. Greubel, Sep 15 2021

Formula

a(n) = 6*a(n-2) - a(n-4) for n>4.
G.f.: x*(1+x)*(1+5*x+x^2) / ((1+2*x-x^2)*(1-2*x-x^2)).
a(n) = (1/4)*(5*P(n+1) - P(n) + (-1)^n*(P(n-1) + 5*P(n-2))), where P(n) = A000129(n). - G. C. Greubel, Sep 15 2021

A276602 Values of k such that k^2 + 10 is a triangular number (A000217).

Original entry on oeis.org

0, 9, 54, 315, 1836, 10701, 62370, 363519, 2118744, 12348945, 71974926, 419500611, 2445028740, 14250671829, 83059002234, 484103341575, 2821561047216, 16445262941721, 95850016603110, 558654836676939, 3256079003458524, 18977819184074205, 110610836100986706
Offset: 1

Views

Author

Colin Barker, Sep 07 2016

Keywords

Examples

			9 is in the sequence because 9^2+10 = 91, which is a triangular number.
		

Crossrefs

Cf. A001109 (k=0), A106328 (k=1), A077241 (k=2), A276598 (k=3), A276599 (k=5), A276600 (k=6), A276601 (k=9), where k is the value added to n^2.

Programs

  • Magma
    [n le 2 select 9*(n-1) else 6*Self(n-1) - Self(n-2): n in [1..31]]; // G. C. Greubel, Sep 15 2021
    
  • Mathematica
    CoefficientList[Series[9*x/(1 - 6*x + x^2), {x, 0, 20}], x] (* Wesley Ivan Hurt, Sep 07 2016 *)
    (9/2)*Fibonacci[2*(Range[30] -1), 2] (* G. C. Greubel, Sep 15 2021 *)
  • PARI
    concat(0, Vec(9*x^2/(1-6*x+x^2) + O(x^30)))
    
  • Sage
    [(9/2)*lucas_number1(2*n-2, 2, -1) for n in (1..30)] # G. C. Greubel, Sep 15 2021

Formula

a(n) = (9/(4*sqrt(2))*( (3 - 2*sqrt(2))*(3 + 2*sqrt(2))^n - (3 + 2*sqrt(2))*(3 - 2*sqrt(2))^n) ).
a(n) = 9*A001109(n-1).
a(n) = 6*a(n-1) - a(n-2) for n>2.
G.f.: 9*x^2 / (1-6*x+x^2).
a(n) = (9/2)*A000129(2*n-2). - G. C. Greubel, Sep 15 2021

A214838 Triangular numbers of the form k^2 + 2.

Original entry on oeis.org

3, 6, 66, 171, 2211, 5778, 75078, 196251, 2550411, 6666726, 86638866, 226472403, 2943171003, 7693394946, 99981175206, 261348955731, 3396416785971, 8878171099878, 115378189547778, 301596468440091, 3919462027838451, 10245401755863186, 133146330756959526, 348042063230908203
Offset: 1

Views

Author

Alex Ratushnyak, Mar 07 2013

Keywords

Comments

Corresponding k values are in A077241.
Except 3, all terms are in A089982: in fact, a(2) = 3+3 and a(n) = (k-2)*(k-1)/2+(k+1)*(k+2)/2, where k = sqrt(a(n)-2) > 2 for n > 2. [Bruno Berselli, Mar 08 2013]

Examples

			2211 is in the sequence because 2211 = 47^2 + 2.
		

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(-3*(x^4+x^3-14*x^2+x+1)/((x-1)*(x^2-6*x+1)*(x^2+6*x+1)))); // Bruno Berselli, Mar 08 2013
    
  • Mathematica
    LinearRecurrence[{1, 34, -34, -1, 1}, {3, 6, 66, 171, 2211}, 25] (* Bruno Berselli, Mar 08 2013 *)
  • Maxima
    t[n]:=((5-2*sqrt(2))*(1+(-1)^n*sqrt(2))^(2*floor(n/2))+(5+2*sqrt(2))*(1-(-1)^n*sqrt(2))^(2*floor(n/2))-2)/4$
    makelist(expand(t[n]*(t[n]+1)/2), n, 1, 25); /* Bruno Berselli, Mar 08 2013 */
  • PARI
    for(n=1, 10^9, t=n*(n+1)/2; if(issquare(t-2), print1(t,", "))); \\ Joerg Arndt, Mar 08 2013
    
  • Python
    import math
    for i in range(2, 1<<32):
          t = i*(i+1)//2 - 2
          sr = int(math.sqrt(t))
          if sr*sr == t:
              print(f'{sr:10} {i:10} {t+2}')
    

Formula

G.f.: -3*x*(x^4+x^3-14*x^2+x+1)/((x-1)*(x^2-6*x+1)*(x^2+6*x+1)). - Joerg Arndt, Mar 08 2013
a(n) = A000217(t), where t = ((5-2*sqrt(2))*(1+(-1)^n*sqrt(2))^(2*floor(n/2))+(5+2*sqrt(2))*(1-(-1)^n*sqrt(2))^(2*floor(n/2))-2)/4. - Bruno Berselli, Mar 08 2013

A230038 Distance between n^2 and the smallest triangular number >= n^2.

Original entry on oeis.org

0, 2, 1, 5, 3, 0, 6, 2, 10, 5, 15, 9, 2, 14, 6, 20, 11, 1, 17, 6, 24, 12, 32, 19, 5, 27, 12, 36, 20, 3, 29, 11, 39, 20, 0, 30, 9, 41, 19, 53, 30, 6, 42, 17, 55, 29, 2, 42, 14, 56, 27, 71, 41, 10, 56, 24, 72, 39, 5, 55, 20, 72, 36, 90, 53, 15, 71, 32, 90, 50, 9, 69, 27, 89, 46, 2, 66, 21, 87, 41, 109, 62
Offset: 1

Views

Author

Ralf Stephan, Oct 08 2013

Keywords

Comments

Smallest positive Z such that x^2 + x - 2n^2 - 2Z = 0 has a solution in integer x.
a(A077241(m)) = 2.
Apparently, a(n) is triangular itself if n is of form (2k+1)*A001109(m), whenever k < A003499(m), or m > some small constant, k >= 0 (see A230060). [Comment improved by Nathaniel Johnston, Oct 08 2013]

Examples

			The smallest triangular number >= 7^2 is 55 and 55-49=6, so a(7)=6.
		

Crossrefs

Cf. A064784.

Programs

  • Maple
    a := proc(n) local t: t := ceil((sqrt(1 + 8*n^2) - 1)/2): return t*(t+1)/2 - n^2: end proc: seq(a(n),n=1..100); # Nathaniel Johnston, Oct 08 2013
  • Mathematica
    Module[{nn=200,tr},tr=Accumulate[Range[nn]];Table[SelectFirst[tr,#>=n^2&]-n^2,{n,Floor[Sqrt[tr[[-1]]]]}]] (* Harvey P. Dale, Sep 17 2022 *)
  • PARI
    a(n)=t=floor((sqrt(8*n^2)-1)/2)+1;t*(t+1)/2-n^2
Showing 1-10 of 13 results. Next