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.

Previous Showing 11-20 of 25 results. Next

A055979 Solutions (value of r) of the Diophantine equation 2*x^2 + 3*x + 2 = r^2.

Original entry on oeis.org

4, 11, 134, 373, 4552, 12671, 154634, 430441, 5253004, 14622323, 178447502, 496728541, 6061962064, 16874148071, 205928262674, 573224305873, 6995498968852, 19472752251611, 237641036678294, 661500352248901, 8072799748093144, 22471539224211023
Offset: 0

Views

Author

Helge Robitzsch (hrobi(AT)math.uni-goettingen.de), Jul 24 2000

Keywords

Comments

A necessary condition on any solution of the equation is x = [r/sqrt(2)] where [] denotes the floor function. The sequence lists the radii of circles for which a "best" digital approximation, as drawn by Bresenham-like algorithms, contains a point sequence [(x-1,x), (x,x), (x,x-1)] that is multiply connected by king moves. - clarified by M. Douglas McIlroy, May 18 2015
Corresponding values of x for above equation are given by A056161(n). The numbers a(n) are also solutions (value of r) to the Diophantine equation: 2x^2 - x + 1 = r^2, (excluding r = 1 at x = 0). - Richard R. Forberg, Nov 24 2013
This sequence lists the degrees n of those Chebyshev polynomials T(n,x) of the first kind which have the following exceptional property: There are exactly two coefficients in the power form of T(n,x) whose absolute values are identical and coincide with the height of T(n,x). This property is exceptional because for all remaining degrees n there is only one coefficient in the power form of T(n,x) whose absolute value coincides with the height of T(n,x). Recall that the height of a polynomial in power form is the maximum of the absolute value of its coefficients. Example: T(4,x) = 1 - 8x^2 + 8x^4; T(11,x) = - 11x + 220x^3 - 1232x^5 + 2816x^7 - 2816x^9 + 1024x^11. - Heinz-Joachim Rack, Nov 14 2015

References

  • H.-J. Rack, On the length and height of Chebyshev polynomials in one and two variables, East Journal on Approximations, 16 (2010), 35 - 91. See Theorem 5.2.1, Remark (k), and Table 5.

Crossrefs

Cf. A006452.

Programs

  • Magma
    I:=[4,11,134,373]; [n le 4 select I[n] else 34*Self(n-2)-Self(n-4): n in [1..30]]; // Vincenzo Librandi, May 19 2015
    
  • Maple
    a:= n-> (Matrix([11,4,1,2]). Matrix([[0,1,0,0], [34,0,1,0], [0,0,0,1], [ -1,0,0,0]])^n)[1,2]: seq(a(n), n=0..25); # Alois P. Heinz, Jun 03 2009
  • Mathematica
    LinearRecurrence[{0,34,0,-1},{4,11,134,373},20] (* Harvey P. Dale, Feb 21 2012 *)
  • PARI
    Vec((4+11*x-2*x^2-x^3)/(1+x^4-34*x^2) + O(x^50)) \\ Altug Alkan, Nov 15 2015

Formula

a(n) = A006452(2n+3) if n=0, 2, 4, ... a(n) = A006452(2n+2) if n=1, 3, 5, ...
G.f.: (4+11*x-2*x^2-x^3) / (1+x^4-34*x^2). - Alois P. Heinz, Jun 03 2009
a(n) = 34*a(n-2) - a(n-4); a(0)=4, a(1)=11, a(2)=134, a(3)=373. - Harvey P. Dale, Feb 21 2012

Extensions

More terms from Alois P. Heinz, Jun 03 2009

A266504 a(n) = 2*a(n - 2) + a(n - 4) with a(0) = a(1) = 2, a(2) = 1, a(3) = 3.

Original entry on oeis.org

2, 2, 1, 3, 4, 8, 9, 19, 22, 46, 53, 111, 128, 268, 309, 647, 746, 1562, 1801, 3771, 4348, 9104, 10497, 21979, 25342, 53062, 61181, 128103, 147704, 309268, 356589, 746639, 860882, 1802546, 2078353, 4351731, 5017588, 10506008, 12113529, 25363747, 29244646, 61233502
Offset: 0

Views

Author

Raphie Frank, Dec 30 2015

Keywords

Comments

This sequence gives all x in N | 2*x^2 - 7(-1)^x = y^2. The companion sequence to this sequence, giving y values, is A266505.
A266505(n)/a(n) converges to sqrt(2).
Alternatively, 1/4*(3*A002203(floor[n/2]) - A002203(n-(-1)^n)), where A002203 gives the Companion Pell numbers, or, in Lucas sequence notation, V_n(2, -1).
Alternatively, bisection of A266506.
Alternatively, A048654(n -1) and A078343(n + 1) interlaced.
Alternatively, A100525(n-1), A266507(n), A038761(n) and A253811(n) interlaced.
Let b(n) = (a(n) - a(n)(mod 2))/2, that is b(n) = {1, 1, 0, 1, 2, 4, 4, 9, 11, 23, 26, 55, 64, ...}. Then:
A006452(n) = {b(4n+0) U b(4n+1)} gives n in N such that n^2 - 1 is triangular;
A216134(n) = {b(4n+2) U b(4n+3)} gives n in N such that n^2 + n + 1 is triangular (indices of Sophie Germain triangular numbers);
A216162(n) = {b(4n+0) U b(4n+2) U b(4n+1) U b(4n+3)}, sequences A006452 and A216134 interlaced.

Crossrefs

Programs

  • Magma
    I:=[2,2,1,3]; [n le 4 select I[n] else 2*Self(n-2)+Self(n-4): n in [1..70]]; // Vincenzo Librandi, Dec 31 2015
    
  • Mathematica
    LinearRecurrence[{0, 2, 0, 1}, {2, 2, 1, 3}, 70] (* Vincenzo Librandi, Dec 31 2015 *)
    Table[SeriesCoefficient[(1 - x) (2 + 4 x + x^2)/(1 - 2 x^2 - x^4), {x, 0, n}], {n, 0, 41}] (* Michael De Vlieger, Dec 31 2015 *)
  • PARI
    Vec((1-x)*(2+4*x+x^2)/(1-2*x^2-x^4) + O(x^50)) \\ Colin Barker, Dec 31 2015

Formula

a(n) = 1/sqrt(8)*(+sqrt(2)*(1+sqrt(2))^(floor(n/2)-(-1)^n)*(-1)^n - 3*(1-sqrt(2))^(floor(n/2)-(-1)^n) + sqrt(2)*(1-sqrt(2))^(floor(n/2)-(-1)^n)*(-1)^n + 3*(1+sqrt(2))^(floor(n/2)-(-1)^n)).
a(n) = 1/4*((3*((1+sqrt(2))^floor(n/2)+(1-sqrt(2))^floor(n/2))) - (-1)^n*((1+sqrt(2))^(floor(n/2)-(-1)^n)+(1-sqrt(2))^(floor(n/2)-(-1)^n))).
a(2n) = (+sqrt(2)*(1+sqrt(2))^(n-1) - 3 *(1-sqrt(2))^(n-1) + sqrt(2)*(1-sqrt(2))^(n-1) + 3*(1 + sqrt(2))^(n-1))/sqrt(8) = A048654(n -1).
a(2n) = 1/4*((3*((1+sqrt(2))^n+(1-sqrt(2))^n)) - ((1+sqrt(2))^(n-1)+(1-sqrt(2))^(n-1))) = A048654(n -1).
a(2n + 1) = (-sqrt(2)*(1+sqrt(2))^(n+1) - 3 *(1-sqrt(2))^(n+1) - sqrt(2)*(1-sqrt(2))^(n+1) + 3*(1+sqrt(2))^(n+1))/sqrt(8) = A078343(n + 1).
a(2n + 1) =1/4*((3*((1+sqrt(2))^n+(1-sqrt(2))^n)) + ((1+sqrt(2))^(n+1)+(1-sqrt(2))^(n+1))) = A078343(n + 1).
a(4n + 0) = 6*a(4n - 4) - a(4n - 8) = A100525(n-1).
a(4n + 1) = 6*a(4n - 3) - a(4n - 7) = A266507(n).
a(4n + 2) = 6*a(4n - 2) - a(4n - 6) = A038761(n).
a(4n + 3) = 6*a(4n - 1) - a(4n - 5) = A253811(n).
sqrt(2*a(n)^2 - 7(-1)^a(n))*sgn(2*n - 1) = A266505(n).
(a(2n + 1) + a(2n))/2 = A002203(n), where A002203 gives the companion Pell numbers.
(a(2n + 1) - a(2n))/2 = A000129(n), where A000129 gives the Pell numbers.
(a(2n+2) + a(2n+1))*2 = A002203(n+2)
(a(2n+2) - a(2n+1))*2 = A002203(n-1).
G.f.: (1-x)*(2+4*x+x^2) / (1-2*x^2-x^4). - Colin Barker, Dec 31 2015

A217278 Sequences A124174 and A006454 interlaced.

Original entry on oeis.org

0, 0, 1, 3, 10, 15, 45, 120, 351, 528, 1540, 4095, 11935, 17955, 52326, 139128, 405450, 609960, 1777555, 4726275, 13773376, 20720703, 60384555, 160554240, 467889345, 703893960, 2051297326, 5454117903, 15894464365, 23911673955, 69683724540, 185279454480
Offset: 0

Views

Author

Raphie Frank, Sep 29 2012

Keywords

Comments

a(2n) and 2*a(2n) + 1 are triangular.
a(2n + 1) is triangular and a(2n + 1)/2 is the harmonic mean of consecutive triangular numbers (therefore, a(2n + 1) + 1 is square).

Examples

			a(18) = 35*(52326 - 1540) + 45 = 1777555,
a(19) = 35*(139128 - 4095) + 120 = 4726275.
		

Crossrefs

Cf. (sqrt(8a(2n) + 1) - 1)/2 = A216134(n) = A216162(2n + 1).
Cf. sqrt(a(2n+1) + 1) = A006452(n + 1) = A216162(2n + 2).
Cf. (sqrt(8a(2n+1) + 1) - 1)/2 = A006451(n).

Programs

  • Mathematica
    LinearRecurrence[{0,1,0,34,0,-34,0,-1,0,1},{0,0,1,3,10,15,45,120,351,528},40] (* Harvey P. Dale, Aug 04 2019 *)
  • PARI
    concat([0,0], Vec(-x^2*(3*x^5+x^4+12*x^3+9*x^2+3*x+1)/((x-1)*(x+1)*(x^2-2*x-1)*(x^2+2*x-1)*(x^4+6*x^2+1)) + O(x^100))) \\ Colin Barker, Jun 23 2015

Formula

a(n) = 35*(a(n-4) - a(n-8)) + a(n-12).
lim n --> infinity a(2n)/a(2n - 1) = (3 + sqrt(8))/2.
From Raphie Frank, Dec 21 2015: (Start)
a(2*n + 1) = 1/64*(((4 + sqrt(2)) * (1 - (-1)^(n+1) * sqrt(2))^(2*floor((n+1)/2)) + (4 - sqrt(2)) * (1+(-1)^(n+1) * sqrt(2))^(2*floor((n+1)/2))))^2 - 1.
a(2*n + 2) = 1/2*(3*(a(2*n + 1)) + sqrt((a(2*n + 1)) + 1) * sqrt(8*(a(2*n + 1)) + 1) + 1).
(End)

A226070 Numbers k such that k^2-1 is a triangular number and k^2+1 is a prime.

Original entry on oeis.org

1, 2, 4, 134, 2174, 154634
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

Subsequence of A006452 that consists of the terms k such that k^2+1 is prime.
a(7) is too large to include here (see b-file). - Max Alekseyev, Jan 30 2014

Crossrefs

Corresponding primes: A226069.
Indices of corresponding triangular numbers: A226071.

Programs

  • C
    // see A226069.
  • Mathematica
    Select[Range[155000],PrimeQ[#^2+1]&&OddQ[Sqrt[8(#^2-1)+1]]&] (* Harvey P. Dale, Jul 19 2019 *)

Extensions

Terms a(7)-a(12) from Max Alekseyev, Jan 30 2014

A258149 Triangle of the absolute difference of the two legs (catheti) of primitive Pythagorean triangles.

Original entry on oeis.org

1, 0, 7, 7, 0, 17, 0, 1, 0, 31, 23, 0, 0, 0, 49, 0, 17, 0, 23, 0, 71, 47, 0, 7, 0, 41, 0, 97, 0, 41, 0, 7, 0, 0, 0, 127, 79, 0, 31, 0, 0, 0, 89, 0, 161, 0, 73, 0, 17, 0, 47, 0, 119, 0, 199, 119, 0, 0, 0, 1, 0, 73, 0, 0, 0, 241
Offset: 2

Views

Author

Wolfdieter Lang, Jun 10 2015

Keywords

Comments

For primitive Pythagorean triangles characterized by certain (n,m) pairs and references see A225949.
Here a(n,m) = 0 for non-primitive Pythagorean triangles, and for primitive Pythagorean triangles a(n,m) = abs(n^2 - m^2 - 2*n*m) = abs((n-m)^2 - 2*m^2).
The number of non-vanishing entries in row n is A055034(n).
D(n,m):= n^2 - m^2 - 2*n*m >= 0 if 1 <= m <= floor(n/(sqrt(2)+1)), and D(n,m) < 0 if n/(sqrt(2)+1)+1 <= m <= n-1, for n >= 2.
The Pell equation (n-m)^2 - 2*m^2 = +/- N is important here to find the representations of +N or -N in the triangle D(n,m). For instance, odd primes N have to be of the +1 (mod 8) (A007519) or -1 (mod 8) (A007522) form, that is, from A001132. See the Nagell reference, Theorem 110, p. 208 with Theorem 111, pp. 210-211. E.g., N = +7 appears for m = 1, 3, 9, 19, 53, ... (A077442) for n = 4, 8, 22, 46, 128, ... (2*A006452).
N = -7 appears for n = 3, 9, 19, 53, 111, ... (A077442) and m = 2, 4, 8, 22, 46, ... (2*A006452).
For the signed version 2*n*m - (n^2 - m^2) see A278717. - Wolfdieter Lang, Nov 30 2016

Examples

			The triangle a(n,m) begins:
n\m   1  2  3  4  5  6  7   8   9  10  11 ...
2:    1
3:    0  7
4:    7  0 17
5:    0  1  0 31
6:   23  0  0  0 49
7:    0 17  0 23  0 71
8:   47  0  7  0 41  0 97
9:    0 41  0  7  0  0  0 127
10:  79  0 31  0  0  0 89   0 161
11:   0 73  0 17  0 47  0 119   0 199
12: 119  0  0  0  1  0 73   0   0   0 241
...
a(2,1) = |1^2 - 2*1^2| = 1 for the primitive Pythagorean triangle (pPt) [3,4,5] with |3-4| = 1.
a(3,2) = |1^2 - 2*2^2| = 7 for the pPt [5,12,13] with |5 - 12| = 7.
a(4,1) = |3^2 - 2*1^2| = 7 for the pPt [15, 8, 17] with |15 - 8| = 7.
		

References

  • See also A225949.
  • T. Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964, pp. 208, 210-211.

Crossrefs

Programs

  • Mathematica
    a[n_, m_] /; n > m >= 1 && CoprimeQ[n, m] && (-1)^(n+m) == -1 := Abs[n^2 - m^2 - 2*n*m]; a[, ] = 0; Table[a[n, m], {n, 2, 12}, {m, 1, n-1}] // Flatten (* Jean-François Alcover, Jun 16 2015, after given formula *)

Formula

a(n,m) = abs(n^2 - m^2 -2*n*m) = abs((n-m)^2 - 2*m^2) if n > m >= 1, gcd(n,m) = 1, and n and m are integers of opposite parity (i.e., (-1)^(n+m) = -1); otherwise a(n,m) = 0.

A266505 a(n) = 2*a(n - 2) + a(n - 4) with a(0) = -1, a(1) = 1, a(2) = 3, a(3) = 5.

Original entry on oeis.org

-1, 1, 3, 5, 5, 11, 13, 27, 31, 65, 75, 157, 181, 379, 437, 915, 1055, 2209, 2547, 5333, 6149, 12875, 14845, 31083, 35839, 75041, 86523, 181165, 208885, 437371, 504293, 1055907, 1217471, 2549185, 2939235, 6154277, 7095941, 14857739, 17131117, 35869755, 41358175, 86597249, 99847467
Offset: 0

Views

Author

Raphie Frank, Dec 30 2015

Keywords

Comments

a(n)/A266504(n) converges to sqrt(2).
Alternatively, bisection of A266506.
Alternatively, A135532(n) and A048655(n) interlaced.
Alternatively, A255236(n-1), A054490(n), A038762(n) and A101386(n) interlaced.
Let b(n) = (a(n) - (a(n) mod 2))/2, that is b(n) = {-1, 0, 1, 2, 2, 5, 6, 13, 15, 32, 37, 78, 90, ...}. Then:
A006451(n) = {b(4n+0) U b(4n+1)} gives n in N such that triangular(n) + 1 is square;
A216134(n) = {b(4n+2) U b(4n+3)} gives n in N such that triangular(n) follows form n^2 + n + 1 (twice a triangular number + 1).

Crossrefs

Programs

  • Magma
    I:=[-1,1,3,5]; [n le 4 select I[n] else 2*Self(n-2)+Self(n-4): n in [1..70]]; // Vincenzo Librandi, Dec 31 2015
    
  • Maple
    a:=proc(n) option remember; if n=0 then -1 elif n=1 then 1 elif n=2 then 3 elif n=3 then 5 else 2*a(n-2)+a(n-4); fi; end:  seq(a(n), n=0..50); # Wesley Ivan Hurt, Jan 01 2016
  • Mathematica
    LinearRecurrence[{0, 2, 0, 1}, {-1, 1, 3, 5}, 70] (* Vincenzo Librandi, Dec 31 2015 *)
    Table[SeriesCoefficient[(-1 + 3 x) (1 + x)^2/(1 - 2 x^2 - x^4), {x, 0, n}], {n, 0, 42}] (* Michael De Vlieger, Dec 31 2015 *)
  • PARI
    my(x='x+O('x^40)); Vec((-1+3*x)*(1+x)^2/(1-2*x^2-x^4)) \\ G. C. Greubel, Jul 26 2018

Formula

G.f.: (-1 + 3*x)*(1 + x)^2/(1 - 2*x^2 - x^4).
a(n) = (-(1+sqrt(2))^floor(n/2)*(-1)^n - sqrt(8)*(1-sqrt(2))^floor(n/2) - (1-sqrt(2))^floor(n/2)*(-1)^n + sqrt(8)*(1+sqrt(2))^floor(n/2))/2.
a(n) = 3*(((1+sqrt(2))^floor(n/2)-(1-sqrt(2))^floor(n/2))/sqrt(8)) - (-1)^n*(((1+sqrt(2))^(floor(n/2)-(-1)^n)-(1-sqrt(2))^(floor(n/2)-(-1)^n))/sqrt(8)).
a(n) = (3*A000129(floor(n/2)) - A000129(n-(-1)^n)), where A000129 gives the Pell numbers.
a(n) = sqrt(2*A266504(n)^2 - 7*(-1)^A266504(n))*sgn(2*n-1), where A266504 gives all x in N such that 2*x^2 - 7*(-1)^x = y^2. This sequence gives associated y values.
a(2n) = (-(1 + sqrt(2))^n - sqrt(8)*(1 - sqrt(2))^n - (1 - sqrt(2))^n + sqrt(8)*(1 + sqrt(2))^n)/2 = a(2n) = A135532(n).
a(2n) = 3*(((1+sqrt(2))^n-(1-sqrt(2))^n)/sqrt(8)) - (((1+sqrt(2))^(n-1)-(1-sqrt(2))^(n-1))/sqrt(8)) = A135532(n).
a(2n+1) = (+(1 + sqrt(2))^n - sqrt(8)*(1 - sqrt(2))^n + (1 - sqrt(2))^n + sqrt(8)*(1 + sqrt(2))^n)/2 = a(2n + 1) = A048655(n).
a(2n+1) = 3*(((1+sqrt(2))^n-(1-sqrt(2))^n)/sqrt(8)) + (((1+sqrt(2))^(n+1)-(1-sqrt(2))^(n+1))/sqrt(8)) = A048655(n).
a(4n + 0) = 6*a(4n - 4) - a(4n - 8) = A255236(n-1).
a(4n + 1) = 6*a(4n - 3) - a(4n - 7) = A054490(n).
a(4n + 2) = 6*a(4n - 2) - a(4n - 6) = A038762(n).
a(4n + 3) = 6*a(4n - 1) - a(4n - 5) = A101386(n).
(sqrt(2*(a(2n + 1) )^2 + 14*(-1)^floor(n/2)))/2 = A266504(n).
(a(2n + 1) + a(2n))/8 = A000129(n), where A000129 gives the Pell numbers.
a(2n + 1) - a(2n) = A002203(n), where A002203 gives the companion Pell numbers.
(a(2n + 2) + a(2n + 1))/2 = A000129(n+2).
(a(2n + 2) - a(2n + 1))/2 = A000129(n-1).

A077447 Numbers k such that (k^2 - 14)/2 is a square.

Original entry on oeis.org

4, 8, 16, 44, 92, 256, 536, 1492, 3124, 8696, 18208, 50684, 106124, 295408, 618536, 1721764, 3605092, 10035176, 21012016, 58489292, 122467004, 340900576, 713790008, 1986914164, 4160273044, 11580584408, 24247848256, 67496592284
Offset: 1

Views

Author

Gregory V. Richardson, Nov 09 2002

Keywords

Comments

The equation "(n^2 - 14)/2 is a square" is a version of the generalized Pell Equation x^2 - D*y^2 = C where x^2 - 2*y^2 = 14.

References

  • A. H. Beiler, "The Pellian." Ch. 22 in Recreations in the Theory of Numbers: The Queen of Mathematics Entertains. Dover, New York, New York, pp. 248-268, 1966.
  • L. E. Dickson, History of the Theory of Numbers, Vol. II, Diophantine Analysis. AMS Chelsea Publishing, Providence, Rhode Island, 1999, pp. 341-400.
  • Peter G. L. Dirichlet, Lectures on Number Theory (History of Mathematics Source Series, V. 16); American Mathematical Society, Providence, Rhode Island, 1999, pp. 139-147.

Crossrefs

Cf. A156649 (R1).

Programs

  • Mathematica
    LinearRecurrence[{0,6,0,-1},{4,8,16,44},40] (* Harvey P. Dale, Jul 22 2013 *)

Formula

Limit_{k -> oo} a(2*k+1)/a(2*k) = 2.09383632135605431360 = (9 + 4*sqrt(2))/7 = R1.
Limit_{k -> oo} a(2*k)/a(2*k-1) = 2.78361162489122432754 = (11 + 6*sqrt(2))/7 = R2.
Limit_{k -> oo} a(n)/a(n-2) = 3 + 2*sqrt(2) = RG (Grand Ratio); RG = R1*R2.
For n = 2*k-1, a(n) = [ 2*[(3+2*sqrt(2))^n + (3-2*sqrt(2))^n] - [(3+2*sqrt(2))^(n-1) + (3-2*sqrt(2))^(n-1)] + [(3+2*sqrt(2))^(n-2) + (3-2*sqrt(2))^(n-2)] ] / 4.
For n = 2*k, a(n) = [ 5*[(3+2*sqrt(2))^n + (3-2*sqrt(2))^n] + [(3+2*sqrt(2))^(n-1) + (3-2*sqrt(2))^(n-1)] ] / 4.
a(n) = 6*a(n-2) - a(n-4) = 4*A006452(n).
G.f.: -4*x*(x-1)*(x^2+3*x+1) / ( (x^2+2*x-1)*(x^2-2*x-1) ). - R. J. Mathar, Jul 03 2011

A078699 Primes p such that p^2-1 is a triangular number.

Original entry on oeis.org

2, 11, 23, 373, 12671, 901273, 19472752251611, 53072032161200090602953513048447623, 5027153581127740201460650182713355379768873, 11604855412241025458500993236724193227031777965785837784548351709747881343573
Offset: 1

Views

Author

Jason Earls, Dec 18 2002

Keywords

Comments

Equivalently, primes in A006452.
The sequence of corresponding triangular numbers begins 3, 120, 528, 139128, 160554240, 812293020528, 379188080252621270252095320, ... [Shreevatsa R, Jul 12 2013]

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n]=If[n<4, {1, 2, 4, 11}[[n+1]], 6a[n-2]-a[n-4]]; Select[a/@Range[200], ProvablePrimeQ] (* First do <
    				
  • PARI
    default(primelimit,10^7) istri(n) = t=floor(sqrt(2*n)); if(2*n==t*(t+1),1,0) forprime(p=2,5*10^6,if(istri(p^2-1),print1(p" ")))
    
  • PARI
    istriang(n)=issquare(8*n+1);
    forprime(p=2,10^10,if(istriang(p^2-1),print1(p,", ")));
    \\ Joerg Arndt, Jul 15 2013
    
  • PARI
    /* much more efficient: */
    N=1166; f=( 1+x-4*x^2-2*x^3 ) / ( (x^2+2*x-1)*(x^2-2*x-1) )+O(x^N);
    for(n=0,N-1,my(c=polcoeff(f,n)); if(isprime(c), print1(c,", ")));
    \\ Joerg Arndt, Jul 15 2013

Extensions

Edited by Dean Hickerson, Dec 19 2002

A156066 Numbers n with property that n^2 is a square arising in A154138.

Original entry on oeis.org

2, 3, 9, 16, 52, 93, 303, 542, 1766, 3159, 10293, 18412, 59992, 107313, 349659, 625466, 2037962, 3645483, 11878113, 21247432, 69230716, 123839109, 403506183, 721787222, 2351806382, 4206884223, 13707332109, 24519518116, 79892186272
Offset: 1

Views

Author

Zak Seidov, Oct 21 2009

Keywords

Comments

Except for the first term, positive values of x (or y) satisfying x^2 - 6xy + y^2 + 23 = 0. - Colin Barker, Feb 08 2014

Crossrefs

Cf. A154138.

Programs

  • GAP
    a:=[2,3,9,16];; for n in [5..30] do a[n]:=6*a[n-2]-a[n-4]; od; a; # Muniru A Asiru, Sep 28 2018
  • Magma
    I:=[2,3,9,16]; [n le 4 select I[n] else 6*Self(n-2)-Self(n-4): n in [1..30]]; // Vincenzo Librandi, Feb 11 2014
    
  • Maple
    seq(coeff(series(-x*(x-1)*(x+2)*(2*x+1)/((x^2-2*x-1)*(x^2+2*x-1)),x,n+1), x, n), n = 1..30); # Muniru A Asiru, Sep 28 2018
  • Mathematica
    a[1]=2;a[2]=3;a[3]=9;a[4]=16;a[n_]:=a[n]=6*a[n-2]-a[n-4];A1=Table[a[n],{n,25}]
    CoefficientList[Series[-(x - 1) (x + 2) (2 x + 1)/((x^2 - 2 x - 1) (x^2 + 2 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 11 2014 *)
  • PARI
    Vec(-x*(x-1)*(x+2)*(2*x+1)/((x^2-2*x-1)*(x^2+2*x-1)) + O(x^100)) \\ Colin Barker, Feb 08 2014
    

Formula

a(n) = sqrt((A154138(n)^2 + A154138(n) + 6)/2).
a(1..4) = (2,3,9,16); a(n>4) = 6*a(n-2) - a(n-4).
G.f.: -x*(x-1)*(x+2)*(2*x+1) / ((x^2-2*x-1)*(x^2+2*x-1)). - Colin Barker, Feb 08 2014
a(n) = A006452(n-1) - A006452(n) + A006452(n+1). - Carl Najafi, Sep 27 2018

A217975 Integers k such that 2*k^2 - 7 is a square.

Original entry on oeis.org

2, 4, 8, 22, 46, 128, 268, 746, 1562, 4348, 9104, 25342, 53062, 147704, 309268, 860882, 1802546, 5017588, 10506008, 29244646, 61233502, 170450288, 356895004, 993457082, 2080136522, 5790292204, 12123924128, 33748296142, 70663408246, 196699484648
Offset: 1

Views

Author

Sture Sjöstedt, Oct 16 2012

Keywords

Comments

a(n) gives y-values solving the Diophantine equation x^2 + 7 = 2*y^2. A077446(n) gives the x-values. - Sture Sjöstedt, Oct 16 2012
Positive values of x (or y) satisfying x^2 - 6xy + y^2 + 28 = 0. - Colin Barker, Feb 08 2014

Examples

			Since 2(4^2) - 7 = 25 = 5^2, and 4 is the second number with this property, a(2) = 4.
		

Crossrefs

Cf. A077442 (2*n^2 + 7 is a square).

Programs

  • Magma
    I:=[2, 4, 8, 22]; [n le 4 select I[n] else 6*Self(n-2)-Self(n-4): n in [1..31]]; // Vincenzo Librandi, Oct 16 2012
    
  • Mathematica
    LinearRecurrence[{0, 6, 0, -1}, {2, 4, 8, 22}, 50] (* Sture Sjöstedt, Oct 16 2012 *)
  • PARI
    Vec(2*x*(1-x)*(x^2+3*x+1)/(x^2-2*x-1)/(x^2+2*x-1)+O(x^99)) \\ Charles R Greathouse IV, Oct 24 2012

Formula

a(n) = 6*a(n - 2) - a(n - 4) with a(1)=2, a(2)=4, a(3)=8, a(4)=22. - Sture Sjöstedt, Oct 16 2012
a(n)*a(n+3)-a(n+1)*a(n+2) = 10-2*(-1)^n. - Bruno Berselli, Oct 25 2012
a(n) = 2*A006452(n). - R. J. Mathar, Oct 17 2012
G.f.: -2*x*(x - 1)*(x^2 + 3*x + 1)/((x^2 - 2*x - 1)*(x^2 + 2*x - 1)). - Colin Barker, Oct 24 2012
a(n) = a(-n+1) = ((4+sqrt(2))*(1-(-1)^n*sqrt(2))^(2*floor(n/2))+(4-sqrt(2))*(1+(-1)^n*sqrt(2))^(2*floor(n/2)))/4. - Bruno Berselli, Oct 25 2012
a(2n-1) = A078343(2n-1), a(2n) = A100525(n-1). - Bruno Berselli, Oct 25 2012
Previous Showing 11-20 of 25 results. Next