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

A002061 Central polygonal numbers: a(n) = n^2 - n + 1.

Original entry on oeis.org

1, 1, 3, 7, 13, 21, 31, 43, 57, 73, 91, 111, 133, 157, 183, 211, 241, 273, 307, 343, 381, 421, 463, 507, 553, 601, 651, 703, 757, 813, 871, 931, 993, 1057, 1123, 1191, 1261, 1333, 1407, 1483, 1561, 1641, 1723, 1807, 1893, 1981, 2071, 2163, 2257, 2353, 2451, 2551, 2653
Offset: 0

Views

Author

Keywords

Comments

These are Hogben's central polygonal numbers denoted by the symbol
...2....
....P...
...2.n..
(P with three attachments).
Also the maximal number of 1's that an n X n invertible {0,1} matrix can have. (See Halmos for proof.) - Felix Goldberg (felixg(AT)tx.technion.ac.il), Jul 07 2001
Maximal number of interior regions formed by n intersecting circles, for n >= 1. - Amarnath Murthy, Jul 07 2001
The terms are the smallest of n consecutive odd numbers whose sum is n^3: 1, 3 + 5 = 8 = 2^3, 7 + 9 + 11 = 27 = 3^3, etc. - Amarnath Murthy, May 19 2001
(n*a(n+1)+1)/(n^2+1) is the smallest integer of the form (n*k+1)/(n^2+1). - Benoit Cloitre, May 02 2002
For n >= 3, a(n) is also the number of cycles in the wheel graph W(n) of order n. - Sharon Sela (sharonsela(AT)hotmail.com), May 17 2002
Let b(k) be defined as follows: b(1) = 1 and b(k+1) > b(k) is the smallest integer such that Sum_{i=b(k)..b(k+1)} 1/sqrt(i) > 2; then b(n) = a(n) for n > 0. - Benoit Cloitre, Aug 23 2002
Drop the first three terms. Then n*a(n) + 1 = (n+1)^3. E.g., 7*1 + 1 = 8 = 2^3, 13*2 + 1 = 27 = 3^3, 21*3 + 1 = 64 = 4^3, etc. - Amarnath Murthy, Oct 20 2002
Arithmetic mean of next 2n - 1 numbers. - Amarnath Murthy, Feb 16 2004
The n-th term of an arithmetic progression with first term 1 and common difference n: a(1) = 1 -> 1, 2, 3, 4, 5, ...; a(2) = 3 -> 1, 3, ...; a(3) = 7 -> 1, 4, 7, ...; a(4) = 13 -> 1, 5, 9, 13, ... - Amarnath Murthy, Mar 25 2004
Number of walks of length 3 between any two distinct vertices of the complete graph K_{n+1} (n >= 1). Example: a(2) = 3 because in the complete graph ABC we have the following walks of length 3 between A and B: ABAB, ACAB and ABCB. - Emeric Deutsch, Apr 01 2004
Narayana transform of [1, 2, 0, 0, 0, ...] = [1, 3, 7, 13, 21, ...]. Let M = the infinite lower triangular matrix of A001263 and let V = the Vector [1, 2, 0, 0, 0, ...]. Then A002061 starting (1, 3, 7, ...) = M * V. - Gary W. Adamson, Apr 25 2006
The sequence 3, 7, 13, 21, 31, 43, 57, 73, 91, 111, ... is the trajectory of 3 under repeated application of the map n -> n + 2 * square excess of n, cf. A094765.
Also n^3 mod (n^2+1). - Zak Seidov, Aug 31 2006
Also, omitting the first 1, the main diagonal of A081344. - Zak Seidov, Oct 05 2006
Ignoring the first ones, these are rectangular parallelepipeds with integer dimensions that have integer interior diagonals. Using Pythagoras: sqrt(a^2 + b^2 + c^2) = d, an integer; then this sequence: sqrt(n^2 + (n+1)^2 + (n(n+1))^2) = 2T_n + 1 is the first and most simple example. Problem: Are there any integer diagonals which do not satisfy the following general formula? sqrt((k*n)^2 + (k*(n+(2*m+1)))^2 + (k*(n*(n+(2*m+1)) + 4*T_m))^2) = k*d where m >= 0, k >= 1, and T is a triangular number. - Marco Matosic, Nov 10 2006
Numbers n such that a(n) is prime are listed in A055494. Prime a(n) are listed in A002383. All terms are odd. Prime factors of a(n) are listed in A007645. 3 divides a(3*k-1), 7 divides a(7*k-4) and a(7*k-2), 7^2 divides a(7^2*k-18) and a(7^2*k+19), 7^3 divides a(7^3*k-18) and a(7^3*k+19), 7^4 divides a(7^4*k+1048) and a(7^4*k-1047), 7^5 divides a(7^5*k+1354) and a(7^5*k-1353), 13 divides a(13*k-9) and a(13*k-3), 13^2 divides a(13^2*k+23) and a(13^2*k-22), 13^3 divides a(13^3*k+1037) and a(13^3*k-1036). - Alexander Adamchuk, Jan 25 2007
Complement of A135668. - Kieren MacMillan, Dec 16 2007
From William A. Tedeschi, Feb 29 2008: (Start)
Numbers (sorted) on the main diagonal of a 2n X 2n spiral. For example, when n=2:
.
7---8---9--10
| |
6 1---2 11
| | |
5---4---3 12
|
16--15--14--13
.
Cf. A137928. (End)
a(n) = AlexanderPolynomial[n] defined as Det[Transpose[S]-n S] where S is Seifert matrix {{-1, 1}, {0, -1}}. - Artur Jasinski, Mar 31 2008
Starting (1, 3, 7, 13, 21, ...) = binomial transform of [1, 2, 2, 0, 0, 0]; example: a(4) = 13 = (1, 3, 3, 1) dot (1, 2, 2, 0) = (1 + 6 + 6 + 0). - Gary W. Adamson, May 10 2008
Starting (1, 3, 7, 13, ...) = triangle A158821 * [1, 2, 3, ...]. - Gary W. Adamson, Mar 28 2009
Starting with offset 1 = triangle A128229 * [1,2,3,...]. - Gary W. Adamson, Mar 26 2009
a(n) = k such that floor((1/2)*(1 + sqrt(4*k-3))) + k = (n^2+1), that is A000037(a(n)) = A002522(n) = n^2 + 1, for n >= 1. - Jaroslav Krizek, Jun 21 2009
For n > 0: a(n) = A170950(A002522(n-1)), A170950(a(n)) = A174114(n), A170949(a(n)) = A002522(n-1). - Reinhard Zumkeller, Mar 08 2010
From Emeric Deutsch, Sep 23 2010: (Start)
a(n) is also the Wiener index of the fan graph F(n). The fan graph F(n) is defined as the graph obtained by joining each node of an n-node path graph with an additional node. The Wiener index of a connected graph is the sum of the distances between all unordered pairs of vertices in the graph. The Wiener polynomial of the graph F(n) is (1/2)t[(n-1)(n-2)t + 2(2n-1)]. Example: a(2)=3 because the corresponding fan graph is a cycle on 3 nodes (a triangle), having distances 1, 1, and 1.
(End)
For all elements k = n^2 - n + 1 of the sequence, sqrt(4*(k-1)+1) is an integer because 4*(k-1) + 1 = (2*n-1)^2 is a perfect square. Building the intersection of this sequence with A000225, k may in addition be of the form k = 2^x - 1, which happens only for k = 1, 3, 7, 31, and 8191. [Proof: Still 4*(k-1)+1 = 2^(x+2) - 7 must be a perfect square, which has the finite number of solutions provided by A060728: x = 1, 2, 3, 5, or 13.] In other words, the sequence A038198 defines all elements of the form 2^x - 1 in this sequence. For example k = 31 = 6*6 - 6 + 1; sqrt((31-1)*4+1) = sqrt(121) = 11 = A038198(4). - Alzhekeyev Ascar M, Jun 01 2011
a(n) such that A002522(n-1) * A002522(n) = A002522(a(n)) where A002522(n) = n^2 + 1. - Michel Lagneau, Feb 10 2012
Left edge of the triangle in A214661: a(n) = A214661(n, 1), for n > 0. - Reinhard Zumkeller, Jul 25 2012
a(n) = A215630(n, 1), for n > 0; a(n) = A215631(n-1, 1), for n > 1. - Reinhard Zumkeller, Nov 11 2012
Sum_{n > 0} arccot(a(n)) = Pi/2. - Franz Vrabec, Dec 02 2012
If you draw a triangle with one side of unit length and one side of length n, with an angle of Pi/3 radians between them, then the length of the third side of the triangle will be the square root of a(n). - Elliott Line, Jan 24 2013
a(n+1) is the number j such that j^2 = j + m + sqrt(j*m), with corresponding number m given by A100019(n). Also: sqrt(j*m) = A027444(n) = n * a(n+1). - Richard R. Forberg, Sep 03 2013
Let p(x) the interpolating polynomial of degree n-1 passing through the n points (n,n) and (1,1), (2,1), ..., (n-1,1). Then p(n+1) = a(n). - Giovanni Resta, Feb 09 2014
The number of square roots >= sqrt(n) and < n+1 (n >= 0) gives essentially the same sequence, 1, 3, 7, 13, 21, 31, 43, 57, 73, 91, 111, 133, 157, 183, 211, ... . - Michael G. Kaarhus, May 21 2014
For n > 1: a(n) is the maximum total number of queens that can coexist without attacking each other on an [n+1] X [n+1] chessboard. Specifically, this will be a lone queen of one color placed in any position on the perimeter of the board, facing an opponent's "army" of size a(n)-1 == A002378(n-1). - Bob Selcoe, Feb 07 2015
a(n+1) is, for n >= 1, the number of points as well as the number of lines of a finite projective plane of order n (cf. Hughes and Piper, 1973, Theorem 3.5., pp. 79-80). For n = 3, a(4) = 13, see the 'Finite example' in the Wikipedia link, section 2.3, for the point-line matrix. - Wolfdieter Lang, Nov 20 2015
Denominators of the solution to the generalization of the Feynman triangle problem. If each vertex of a triangle is joined to the point (1/p) along the opposite side (measured say clockwise), then the area of the inner triangle formed by these lines is equal to (p - 2)^2/(p^2 - p + 1) times the area of the original triangle, p > 2. For example, when p = 3, the ratio of the areas is 1/7. The numerators of the ratio of the areas is given by A000290 with an offset of 2. [Cook & Wood, 2004.] - Joe Marasco, Feb 20 2017
n^2 equal triangular tiles with side lengths 1 X 1 X 1 may be put together to form an n X n X n triangle. For n>=2 a(n-1) is the number of different 2 X 2 X 2 triangles being contained. - Heinrich Ludwig, Mar 13 2017
For n >= 0, the continued fraction [n, n+1, n+2] = (n^3 + 3n^2 + 4n + 2)/(n^2 + 3n + 3) = A034262(n+1)/a(n+2) = n + (n+2)/a(n+2); e.g., [2, 3, 4] = A034262(3)/a(4) = 30/13 = 2 + 4/13. - Rick L. Shepherd, Apr 06 2017
Starting with b(1) = 1 and not allowing the digit 0, let b(n) = smallest nonnegative integer not yet in the sequence such that the last digit of b(n-1) plus the first digit of b(n) is equal to k for k = 1, ..., 9. This defines 9 finite sequences, each of length equal to a(k), k = 1, ..., 9. (See A289283-A289287 for the cases k = 5..9.) For k = 10, the sequence is infinite (A289288). For example, for k = 4, b(n) = 1,3,11,31,32,2,21,33,12,22,23,13,14. These terms can be ordered in the following array of size k*(k-1)+1:
1 2 3
21 22 23
31 32 33
11 12 13 14
.
The sequence ends with the term 1k, which lies outside the rectangular array and gives the term +1 (see link).- Enrique Navarrete, Jul 02 2017
The central polygonal numbers are the delimiters (in parenthesis below) when you write the natural numbers in groups of odd size 2*n+1 starting with the group {2} of size 1: (1) 2 (3) 4,5,6 (7) 8,9,10,11,12 (13) 14,15,16,17,18,19,20 (21) 22,23,24,25,26,27,28,29,30 (31) 32,33,34,35,36,37,38,39,40,41,42 (43) ... - Enrique Navarrete, Jul 11 2017
Also the number of (non-null) connected induced subgraphs in the n-cycle graph. - Eric W. Weisstein, Aug 09 2017
Since (n+1)^2 - (n+1) + 1 = n^2 + n + 1 then from 7 onwards these are also exactly the numbers that are represented as 111 in all number bases: 111(2)=7, 111(3)=13, ... - Ron Knott, Nov 14 2017
Number of binary 2 X (n-1) matrices such that each row and column has at most one 1. - Dmitry Kamenetsky, Jan 20 2018
Observed to be the squares visited by bishop moves on a spirally numbered board and moving to the lowest available unvisited square at each step, beginning at the second term (cf. A316667). It should be noted that the bishop will only travel to squares along the first diagonal of the spiral. - Benjamin Knight, Jan 30 2019
From Ed Pegg Jr, May 16 2019: (Start)
Bound for n-subset coverings. Values in A138077 covered by difference sets.
C(7,3,2), {1,2,4}
C(13,4,2), {0,1,3,9}
C(21,5,2), {3,6,7,12,14}
C(31,6,2), {1,5,11,24,25,27}
C(43,7,2), existence unresolved
C(57,8,2), {0,1,6,15,22,26,45,55}
Next unresolved cases are C(111,11,2) and C(157,13,2). (End)
"In the range we explored carefully, the optimal packings were substantially irregular only for n of the form n = k(k+1)+1, k = 3, 4, 5, 6, 7, i.e., for n = 13, 21, 31, 43, and 57." (cited from Lubachevsky, Graham link, Introduction). - Rainer Rosenthal, May 27 2020
From Bernard Schott, Dec 31 2020: (Start)
For n >= 1, a(n) is the number of solutions x in the interval 1 <= x <= n of the equation x^2 - [x^2] = (x - [x])^2, where [x] = floor(x). For n = 3, the a(3) = 7 solutions in the interval [1, 3] are 1, 3/2, 2, 9/4, 5/2, 11/4 and 3.
This sequence is the answer to the 4th problem proposed during the 20th British Mathematical Olympiad in 1984 (see link B.M.O 1984. and Gardiner reference). (End)
Called "Hogben numbers" after the British zoologist, statistician and writer Lancelot Thomas Hogben (1895-1975). - Amiram Eldar, Jun 24 2021
Minimum Wiener index of 2-degenerate graphs with n+1 vertices (n>0). A maximal 2-degenerate graph can be constructed from a 2-clique by iteratively adding a new 2-leaf (vertex of degree 2) adjacent to two existing vertices. The extremal graphs are maximal 2-degenerate graphs with diameter at most 2. - Allan Bickle, Oct 14 2022
a(n) is the number of parking functions of size n avoiding the patterns 123, 213, and 312. - Lara Pudwell, Apr 10 2023
Repeated iteration of a(k) starting with k=2 produces Sylvester's sequence, i.e., A000058(n) = a^n(2), where a^n is the n-th iterate of a(k). - Curtis Bechtel, Apr 04 2024
a(n) is the maximum number of triangles that can be traversed by starting from a triangle and moving to adjacent triangles via an edge, without revisiting any triangle, in an n X n X n equilateral triangular grid made up of n^2 unit equilateral triangles. - Kiran Ananthpur Bacche, Jan 16 2025

Examples

			G.f. = 1 + x + 3*x^2 + 7*x^3 + 13*x^4 + 21*x^5 + 31*x^6 + 43*x^7 + ...
		

References

  • Archimedeans Problems Drive, Eureka, 22 (1959), 15.
  • Steve Dinh, The Hard Mathematical Olympiad Problems And Their Solutions, AuthorHouse, 2011, Problem 1 of the British Mathematical Olympiad 2007, page 160.
  • Anthony Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Problem 4 pp. 64 and 173 (1984).
  • Paul R. Halmos, Linear Algebra Problem Book, MAA, 1995, pp. 75-6, 242-4.
  • Ross Honsberger, Ingenuity in Mathematics, Random House, 1970, p. 87.
  • Daniel R. Hughes and Frederick Charles Piper, Projective Planes, Springer, 1973.
  • 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

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. A010000 (minimum Weiner index of 3-degenerate graphs).

Programs

  • GAP
    List([0..50], n->n^2-n+1); # Muniru A Asiru, May 27 2018
  • Haskell
    a002061 n = n * (n - 1) + 1  -- Reinhard Zumkeller, Dec 18 2013
    
  • Magma
    [ n^2 - n + 1 : n in [0..50] ]; // Wesley Ivan Hurt, Jun 12 2014
    
  • Maple
    A002061 := proc(n)
        numtheory[cyclotomic](6,n) ;
    end proc:
    seq(A002061(n), n=0..20); # R. J. Mathar, Feb 07 2014
  • Mathematica
    FoldList[#1 + #2 &, 1, 2 Range[0, 50]] (* Robert G. Wilson v, Feb 02 2011 *)
    LinearRecurrence[{3, -3, 1}, {1, 1, 3}, 60] (* Harvey P. Dale, May 25 2011 *)
    Table[n^2 - n + 1, {n, 0, 50}] (* Wesley Ivan Hurt, Jun 12 2014 *)
    CoefficientList[Series[(1 - 2x + 3x^2)/(1 - x)^3, {x, 0, 52}], x] (* Robert G. Wilson v, Feb 18 2018 *)
    Cyclotomic[6, Range[0, 100]] (* Paolo Xausa, Feb 09 2024 *)
  • Maxima
    makelist(n^2 - n + 1,n,0,55); /* Martin Ettl, Oct 16 2012 */
    
  • PARI
    a(n) = n^2 - n + 1
    

Formula

G.f.: (1 - 2*x + 3*x^2)/(1-x)^3. - Simon Plouffe in his 1992 dissertation
a(n) = -(n-5)*a(n-1) + (n-2)*a(n-2).
a(n) = Phi_6(n) = Phi_3(n-1), where Phi_k is the k-th cyclotomic polynomial.
a(1-n) = a(n). - Michael Somos, Sep 04 2006
a(n) = a(n-1) + 2*(n-1) = 2*a(n-1) - a(n-2) + 2 = 1+A002378(n-1) = 2*A000124(n-1) - 1. - Henry Bottomley, Oct 02 2000 [Corrected by N. J. A. Sloane, Jul 18 2010]
a(n) = A000217(n) + A000217(n-2) (sum of two triangular numbers).
From Paul Barry, Mar 13 2003: (Start)
x*(1+x^2)/(1-x)^3 is g.f. for 0, 1, 3, 7, 13, ...
a(n) = 2*C(n, 2) + C(n-1, 0).
E.g.f.: (1+x^2)*exp(x). (End)
a(n) = ceiling((n-1/2)^2). - Benoit Cloitre, Apr 16 2003. [Hence the terms are about midway between successive squares and so (except for 1) are not squares. - N. J. A. Sloane, Nov 01 2005]
a(n) = 1 + Sum_{j=0..n-1} (2*j). - Xavier Acloque, Oct 08 2003
a(n) = floor(t(n^2)/t(n)), where t(n) = A000217(n). - Jon Perry, Feb 14 2004
a(n) = leftmost term in M^(n-1) * [1 1 1], where M = the 3 X 3 matrix [1 1 1 / 0 1 2 / 0 0 1]. E.g., a(6) = 31 since M^5 * [1 1 1] = [31 11 1]. - Gary W. Adamson, Nov 11 2004
a(n+1) = n^2 + n + 1. a(n+1)*a(n) = (n^6-1)/(n^2-1) = n^4 + n^2 + 1 = a(n^2+1) (a product of two consecutive numbers from this sequence belongs to this sequence). (a(n+1) + a(n))/2 = n^2 + 1. (a(n+1) - a(n))/2 = n. a((a(n+1) + a(n))/2) = a(n+1)*a(n). - Alexander Adamchuk, Apr 13 2006
a(n+1) is the numerator of ((n + 1)! + (n - 1)!)/ n!. - Artur Jasinski, Jan 09 2007
a(n) = A132111(n-1, 1), for n > 1. - Reinhard Zumkeller, Aug 10 2007
a(n) = Det[Transpose[{{-1, 1}, {0, -1}}] - n {{-1, 1}, {0, -1}}]. - Artur Jasinski, Mar 31 2008
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3), n >= 3. - Jaume Oliver Lafont, Dec 02 2008
a(n) = A176271(n,1) for n > 0. - Reinhard Zumkeller, Apr 13 2010
a(n) == 3 (mod n+1). - Bruno Berselli, Jun 03 2010
a(n) = (n-1)^2 + (n-1) + 1 = 111 read in base n-1 (for n > 2). - Jason Kimberley, Oct 18 2011
a(n) = A228643(n, 1), for n > 0. - Reinhard Zumkeller, Aug 29 2013
a(n) = sqrt(A058031(n)). - Richard R. Forberg, Sep 03 2013
G.f.: 1 / (1 - x / (1 - 2*x / (1 + x / (1 - 2*x / (1 + x))))). - Michael Somos, Apr 03 2014
a(n) = A243201(n - 1) / A003215(n - 1), n > 0. - Mathew Englander, Jun 03 2014
For n >= 2, a(n) = ceiling(4/(Sum_{k = A000217(n-1)..A000217(n) - 1}, 1/k)). - Richard R. Forberg, Aug 17 2014
A256188(a(n)) = 1. - Reinhard Zumkeller, Mar 26 2015
Sum_{n>=0} 1/a(n) = 1 + Pi*tanh(Pi*sqrt(3)/2)/sqrt(3) = 2.79814728056269018... . - Vaclav Kotesovec, Apr 10 2016
a(n) = A101321(2,n-1). - R. J. Mathar, Jul 28 2016
a(n) = A000217(n-1) + A000124(n-1), n > 0. - Torlach Rush, Aug 06 2018
Sum_{n>=1} arctan(1/a(n)) = Pi/2. - Amiram Eldar, Nov 01 2020
Sum_{n=1..M} arctan(1/a(n)) = arctan(M). - Lee A. Newberg, May 08 2024
From Amiram Eldar, Jan 20 2021: (Start)
Product_{n>=1} (1 + 1/a(n)) = cosh(sqrt(7)*Pi/2)*sech(sqrt(3)*Pi/2).
Product_{n>=2} (1 - 1/a(n)) = Pi*sech(sqrt(3)*Pi/2). (End)
For n > 1, sqrt(a(n)+sqrt(a(n)-sqrt(a(n)+sqrt(a(n)- ...)))) = n. - Diego Rattaggi, Apr 17 2021
a(n) = (1 + (n-1)^4 + n^4) / (1 + (n-1)^2 + n^2) [see link B.M.O. 2007 and Steve Dinh reference]. - Bernard Schott, Dec 27 2021

Extensions

Partially edited by Joerg Arndt, Mar 11 2010
Partially edited by Bruno Berselli, Dec 19 2013

A107920 Lucas and Lehmer numbers with parameters (1 +- sqrt(-7))/2.

Original entry on oeis.org

0, 1, 1, -1, -3, -1, 5, 7, -3, -17, -11, 23, 45, -1, -91, -89, 93, 271, 85, -457, -627, 287, 1541, 967, -2115, -4049, 181, 8279, 7917, -8641, -24475, -7193, 41757, 56143, -27371, -139657, -84915, 194399, 364229, -24569, -753027, -703889, 802165, 2209943, 605613, -3814273
Offset: 0

Views

Author

Michael Somos, May 28 2005

Keywords

Comments

The sequences A001607, A077020, A107920, A167433, A169998 are all essentially the same except for signs.
This is an example of a sequence of Lehmer numbers. In this case, the two parameters, alpha and beta, are (1 +- i*sqrt(7))/2. Bilu, Hanrot, Voutier and Mignotte show that all terms of a Lehmer sequence a(n) have a primitive factor for n > 30. Note that for this sequence, a(30) = 24475 = 5*5*11*89 has no primitive factors. - T. D. Noe, Oct 29 2003
Row sums of Riordan array (1/(1+2*x^2), x/(1+2*x^2)). - Paul Barry, Sep 10 2005
Pisano period lengths: 1, 1, 8, 2, 24, 8, 21, 2, 24, 24, 10, 8, 168, 21, 24, 4, 144, 24, 360, 24, ... - R. J. Mathar, Aug 10 2012
This is the Lucas Sequence U_n(P, Q) = U_n(1, 2). V_n(1, 2) = A002249(n). - Raphie Frank, Dec 25 2013
Note that (A002249(n)/2)^2 + 7*(a(n)/2)^2 = 2^n for all n in N. This is a specific case of the Lucas sequence identity (V_n/2)^2 - D*(U_n/2)^2 = Q^n where V_n = (a^n + b^n), U_n = (a^n - b^n)/(a - b), Q = (a*b) = 2 and D = (a - b)^2 = -7; a = (1 + sqrt(-7))/2 and b = (1 - sqrt(-7))/2. - Raphie Frank, Nov 26 2015
For the special case where |a(n)| = 1, true for n if and only if n is in {1, 2, 3, 5, 13} = {A215795(n) + 1} = {A060728(n) - 2}, then, additionally, by the Lucas sequence identity (U_2n = U_n*V_n), we have (a(2n)/2)^2 + 7*(a(n)/2)^2 = 2^n. - Raphie Frank, Nov 26 2015

Examples

			G.f. = x + x^2 - x^3 - 3*x^4 - x^5 + 5*x^6 + 7*x^7 - 3*x^8 - 17*x^9 - 11*x^10 + ...
		

Crossrefs

Programs

  • Magma
    [0] cat [n le 2 select 1 else Self(n-1)-2*Self(n-2): n in [1..45]]; // Vincenzo Librandi, Nov 27 2015
  • Maple
    a:= n-> (Matrix([[1,1],[ -2,0]])^n)[1,2]: seq(a(n), n=0..45); # Alois P. Heinz, Sep 03 2008
  • Mathematica
    LinearRecurrence[{1, -2}, {0, 1}, 50] (* Vincenzo Librandi, Nov 27 2015 *)
    a[ n_] := Im[ ((1 + Sqrt[-7]) / 2)^n // FullSimplify] 2 / Sqrt[7]; (* Michael Somos, Jan 19 2017 *)
    a[n_] := If[n < 2, n, Hypergeometric2F1[1 - n/2, (1 - n)/2, 1 - n, 8]];
    Table[a[n], {n, 0, 45}] (* Peter Luschny, Feb 23 2018 *)
  • PARI
    {a(n) = imag(quadgen(-7)^n)};
    
  • PARI
    my(x='x+O('x^100)); concat(0, Vec(x/(1-x+2*x^2))) \\ Altug Alkan, Dec 04 2015
    
  • Sage
    [lucas_number1(n,1,2) for n in range(0, 46)] # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x / (1 - x + 2*x^2).
a(n) = a(n-1) - 2*a(n-2).
a(n) = -(-1)^n*A001607(n).
From Paul Barry, Sep 10 2005: (Start)
a(n+1) = Sum_{k=0..n} C((n+k)/2, k)*(-2)^((n-k)/2)*(1+(-1)^(n-k))/2.
a(n+1) = Sum_{k=0..floor(n/2)} C(n-k, k)*(-2)^k. (End)
a(n+1) = Sum_{k=0..n} A109466(n,k)*2^(n-k). - Philippe Deléham, Oct 26 2008
a(n) = ((1 - i*sqrt(7))^n - (1 + i*sqrt(7))^n)*i/(2^n*sqrt(7)), where i=sqrt(-1). - Bruno Berselli, Jul 01 2011
(a(2*(A060728(n)) - 4))^2 = (A002249(A060728(n) - 2))^2 = 2^(A060728(n)) - 7 = A227078(n), the Ramanujan-Nagell squares. - Raphie Frank, Dec 25 2013
a(n) = -a(-n) * 2^n for all n in Z. - Michael Somos, Jan 19 2017
G.f.: x / (1 - x / (1 + 2*x / (1 - 2*x))). - Michael Somos, Jan 19 2017
a(n) = S(n-1, 1/sqrt(2))*(sqrt(2))^(n-1), n >= 0, with the Chebyshev S polynomials (coefficients in A049310), and S(-1, x) = 0. - Wolfdieter Lang, Feb 22 2018
a(n) = hypergeom([1-n/2, (1-n)/2], [1-n], 8) for n >= 2. - Peter Luschny, Feb 23 2018

A002249 a(n) = a(n-1) - 2*a(n-2) with a(0) = 2, a(1) = 1.

Original entry on oeis.org

2, 1, -3, -5, 1, 11, 9, -13, -31, -5, 57, 67, -47, -181, -87, 275, 449, -101, -999, -797, 1201, 2795, 393, -5197, -5983, 4411, 16377, 7555, -25199, -40309, 10089, 90707, 70529, -110885, -251943, -30173, 473713, 534059, -413367, -1481485
Offset: 0

Views

Author

Keywords

Comments

4*2^n = A002249(n)^2 + 7*A001607(n)^2. See A077020, A077021.
Among presented initial elements of the sequence a(n), the maximal increasing or decreasing subsequences have length either 3 or 4. - Roman Witula, Aug 21 2012
This is the Lucas Sequence V_n(P, Q) = V_n(1, 2). U_n(1, 2) = A107920(n). - Raphie Frank, Dec 25 2013
The only numbers that occur more than once are 1=a(1)=a(4) and -5=a(3)=a(9). See Noam D. Elkies's posting in the Mathematics Stack Exchange link. - Robert Israel, Dec 21 2016

Examples

			We have a(2)-a(7) = a(5)-a(4) = a(6)+a(4) = a(11)-a(10) = a(12)+a(10)=10. Further the following relations: ((1+i*sqrt(7))/2)^4 + ((1-i*sqrt(7))/2)^4 = 1 and ((1+i*sqrt(7))/2)^8 + ((1-i*sqrt(7))/2)^8 = -31. - _Roman Witula_, Aug 21 2012
G.f. = 2 + x - 3*x^2 - 5*x^3 + x^4 + 11*x^5 + 9*x^6 - 13*x^7 - 31*x^8 + ...
From _Raphie Frank_, Dec 05 2015: (Start)
V_n(1, 2) = a(1*n) = ((a(1) + sqrt(-7))/2)^n + ((a(1) - sqrt(-7))/2)^n; a(1) = 1.
V_n(-3, 4) = a(2*n) = ((a(2) + sqrt(-7))/2)^n + ((a(2) - sqrt(-7))/2)^n; a(2) = -3.
V_n(-5, 8) = a(3*n) = ((a(3) + sqrt(-7))/2)^n + ((a(3) - sqrt(-7))/2)^n; a(3) = -5.
V_n(11, 32) = a(5*n) = ((a(5) + sqrt(-7))/2)^n + ((a(5) - sqrt(-7))/2)^n; a(5) = 11.
V_n(-181, 8192) = a(13*n) = ((a(13) + sqrt(-7))/2)^n + ((a(13) - sqrt(-7))/2)^n; a(13) = -181.
(End)
		

Crossrefs

Programs

  • Magma
    I:=[2,1]; [n le 2 select I[n] else Self(n-1)-2*Self(n-2): n in [1..50]]; // Vincenzo Librandi, Nov 29 2015
    
  • Maple
    A002249 := proc(n) option remember; >if n = 1 then 1 elif n = 2 then -3 else A002249(n-1>)-2*A002249(n-2); fi; end;
  • Mathematica
    LinearRecurrence[{1,-2}, {2,1}, 50] (* Roman Witula, Aug 21 2012 *)
    a[ n_] := 2^(n/2) ChebyshevT[ n, 8^(-1/2)] 2; (* Michael Somos, Jun 02 2014 *)
    a[ n_] := 2^Min[0, n] SeriesCoefficient[ (2 - x) / (1 - x + 2 x^2), {x, 0, Abs @ n}]; (* Michael Somos, Jun 02 2014 *)
    Table[2 Re[((1 + I Sqrt[7])/2)^n], {n, 0, 40}] (* Jean-François Alcover, Jun 02 2017 *)
  • PARI
    {a(n) = if( n<0, 2^n * a(-n), polsym(2 - x + x^2, n)[n+1])}; /* Michael Somos, Jun 02 2014 */
    
  • PARI
    {a(n) = 2 * real( ((1 + quadgen(-28)) / 2)^n )}; /* Michael Somos, Jun 02 2014 */
    
  • PARI
    x='x+O('x^100); Vec((2-x)/(1-x+2*x^2)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import sqrt, re, I
    def a(n): return 2*re(((1 + I*sqrt(7))/2)**n)
    print([a(n) for n in range(40)]) # Indranil Ghosh, Jun 02 2017
  • Sage
    [lucas_number2(n,1,2) for n in range(0, 40)] # Zerinvary Lajos, Apr 30 2009
    

Formula

G.f.: (2-x)/(1-x+2x^2). - Michael Somos, Oct 18 2002
a(n) = trace(A^n) for the square matrix A=[1, -2; 1, 0]. - Paul Barry, Sep 05 2003
a(n) = 2^((n+2)/2)*cos(-n*acot(sqrt(7)/7)). - Paul Barry, Sep 06 2003
a(n) = (-1)^n*(2*A110512(n) - A001607(n)) = ((1 + i*sqrt(7))/2)^n + ((1 - i*sqrt(7))/2)^n. - Roman Witula, Aug 21 2012
G.f.: G(0), where G(k) = 1 + 1/(1 - x*(7*k+1)/(x*(7*k+8) + 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 03 2013
(a(A060728(n) - 2))^2 = (A107920(2*(A060728(n)) - 4))^2 = 2^(A060728(n)) - 7 = A227078(n), the Ramanujan-Nagell squares. - Raphie Frank, Dec 25 2013
a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x - 7*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
a(n) = (A107920(n+1) + 2*A107920(n+2) - A107920(n+3))/2. - Raphie Frank, Nov 28 2015
V_n(P,Q) = a(k*n) = ((a(k) + sqrt(-7))/2)^n + ((a(k) - sqrt(-7))/2)^n for k is in {1, 2, 3, 5, 13} = (A060728(n) - 2), P is in {1, -3, -5, 11, -181} = a(k), and Q is in {2, 4, 8, 32, 8192} = 2^k = (2*A076046(n) + 2) = (A227078(n) - 7)/4. P^2 - 4*Q = -7. - Raphie Frank, Dec 05 2015
From Peter Bala, Nov 16 2022: (Start)
The Gauss congruences hold: a(n*p^k) == a(n*p^(k-1)) (mod p^k) for all positive integers n and k and all primes p.
A268924(n) == a(3^n) (mod 3^n). (End)

A038198 Numbers n such that n^2 + 7 is a power of 2.

Original entry on oeis.org

1, 3, 5, 11, 181
Offset: 1

Views

Author

Keywords

Comments

The exponents of the corresponding powers of 2 are 3, 4, 5, 7, 15 (see Ramanujan). - N. J. A. Sloane, Jun 01 2014
The terms lead to identities resembling Machin's Pi/4 = arctan(1/1) = 4*arctan(1/5) - arctan(1/239), for example, arctan(sqrt(7)/1) = 5*arctan(sqrt(7)/11) + 2*arctan(sqrt(7)/181), which can also be expressed as arcsin(sqrt(7/2^3)) = 5*arcsin(sqrt(7/2^7)) + 2*arcsin(sqrt(7/2^15)) (cf. A168229). - Joerg Arndt, Nov 09 2012

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 181, p. 56, Ellipses, Paris 2008.
  • L. J. Mordell, Diophantine Equations, Academic Press, NY, 1969, p. 205.
  • S. Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. See Question 464, p. 327. - N. J. A. Sloane, Jun 01 2014

Crossrefs

Programs

  • Mathematica
    ok[n_] := Reduce[k>0 && n^2 + 7 == 2^k, k, Integers] =!= False; Select[Range[1000], ok] (* Jean-François Alcover, Sep 21 2011 *)
  • PARI
    [x | n<-[0..99], issquare(2^n-7,&x)] \\ M. F. Hasler, Mar 11 2024

A076046 Ramanujan-Nagell numbers: the triangular numbers (of the form a*(a+1)/2) which are also of the form 2^b - 1.

Original entry on oeis.org

0, 1, 3, 15, 4095
Offset: 1

Views

Author

Burt Totaro (b.totaro(AT)dpmms.cam.ac.uk), Oct 29 2002

Keywords

Comments

Ramanujan conjectured and Nagell proved, that the given numbers are the only ones. This sequence is equivalent to A060728, the list of numbers n such that x^2 + 7 = 2^n is soluble, by changing from n to 2^(n-3)-1.
These 5 numbers are therefore the only ones which appear in column k=2 and also in the first subdiagonal of the Stirling2 Sheffer matrix S(n,k) = A048993(n,k). These entries are 0 = S(0, 2) = S(1, 2) = S(1, 0), 1 = S(2, 2) = S(2, 1), 3 = S(3, 2) (intersection of the column k=2 with the first subdiagonal), 15 = S(5, 2) = S(6, 5) and 4095 = S(13, 2) = S(91, 90). The motivation to look into this came from a comment of R. J. Cano on A247024. - Wolfdieter Lang, Oct 16 2014
Named after the Indian mathematician Srinivasa Ramanujan (1887-1920) and the Norwegian mathematician Trygve Nagell (1895-1988). - Amiram Eldar, Jun 22 2021

Examples

			4095 can be written as 90*(90+1)/2, but also as 2^12 - 1.
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, 3rd, 1999. See Chapter 6.
  • T. Nagell. The Diophantine equation x^2 + 7 = 2^n. Nordisk Mat. Tidskr., Vol. 30 (1948), pp. 62-64; Ark. Math., Vol. 4 (1960), pp. 185-187.

Crossrefs

Programs

  • Mathematica
    Reap[For[b = 0, b <= 12, b++, If[IntegerQ[(Sqrt[2^(b + 3) - 7] - 1)/2], Sow[2^b - 1]]]][[2, 1]] (* Jean-François Alcover, Jul 05 2017 *)
    Select[Accumulate[Range[0,200]],IntegerQ[Log[2,#+1]]&] (* Harvey P. Dale, Aug 27 2019 *)

A077021 a(n) is the unique odd positive solution y of 2^n = 7x^2 + y^2.

Original entry on oeis.org

1, 3, 5, 1, 11, 9, 13, 31, 5, 57, 67, 47, 181, 87, 275, 449, 101, 999, 797, 1201, 2795, 393, 5197, 5983, 4411, 16377, 7555, 25199, 40309, 10089, 90707, 70529, 110885, 251943, 30173, 473713, 534059, 413367, 1481485, 654751, 2308219, 3617721
Offset: 3

Views

Author

Ed Pegg Jr, Oct 17 2002

Keywords

Comments

Restate the formula and divide both sides by 4, then y^2 - (-7)*x^2 = 2^n and (y/2)^2 - (-7)*(x/2)^2 = 2^(n-2). Let y = V_n, x = U_n, -7 = D, and 2^(n-2) = Q^n. We then have this sequence as the absolute values for V_n = A002249(n)(excluding a(0) = 2) in relation to the Lucas sequence identity: (V_n/2)^2 - D*(U_n/2)^2 = Q^n with V_n = (a^n + b^n), U_n = (a^n - b^n)/(a - b), D = (a - b)^2 = P^2 - 4*Q = -7, Q = (a*b) = 2; a = (1 + sqrt(-7))/2, b = (1 - sqrt(-7))/2, P = 1. By the Ramanujan-Nagell Theorem, iff y is in +- {1, 3, 5, 11, 181} = +-A038198, then |x| = 1 and we are left with 2^n = 7 + y^2. See A060728 and note that a(A060728(n) - 3) = A038198(n). - Raphie Frank, Dec 05 2015

References

  • A. Engel, Problem-Solving Strategies, p. 126.

Crossrefs

Cf. A077020 (x).

Programs

  • Mathematica
    a = {}; Do[k = Expand[((1 + I Sqrt[7])/2)^n + ((1 - I Sqrt[7])/2)^n]; AppendTo[a, Abs[k]], {n, 1, 50}]; a (* Artur Jasinski, Oct 05 2008 *)

Formula

a(n+2) = abs(A002249(n)). - Artur Jasinski, Oct 05 2008 [With correction by Jianing Song, Nov 21 2018]

A215795 Numbers n such that 2^n-1 is a triangular number (A000217).

Original entry on oeis.org

0, 1, 2, 4, 12
Offset: 1

Views

Author

V. Raman, Aug 23 2012

Keywords

Comments

Aside from a(2), all terms are even. Probably complete; no more terms up to 10^6. - Charles R Greathouse IV, Sep 07 2012
This sequence maps to the Ramanujan-Nagell squares (8*(2^n - 1) + 1) and is therefore complete. - Raphie Frank, Sep 10 2012
Define equivalence classes on a specified real interval with respect to the symmetric transitive closure of R(x,y) = "x is an integer multiple of y". If any equivalence class is finite (the conditions for which are given in A328129), then a smallest equivalence class has cardinality 1, 2, 4 or 12. - Peter Munn, Jun 02 2021

Crossrefs

Cf. A076046 (triangular numbers of the form 2^n - 1).
Cf. A060728 (a(n) + 3).
Cf. A038198 (sqrt(8*(2^n - 1)+1)).
Cf. A215797 ((sqrt(8*(2^n - 1)+1) - 1)/2).
Cf. A328129.

Programs

  • Mathematica
    Select[Range[0,15],OddQ[Sqrt[8(2^#-1)+1]]&] (* Harvey P. Dale, Dec 13 2024 *)
  • PARI
    is(n)=issquare(8<Charles R Greathouse IV, Sep 07 2012

Extensions

Four cross-references to the Ramanujan-Nagell problem added by Raphie Frank, Sep 10 2012

A227078 The Ramanujan-Nagell squares: A038198(n)^2.

Original entry on oeis.org

1, 9, 25, 121, 32761
Offset: 0

Views

Author

Raphie Frank, Jun 30 2013

Keywords

Comments

a(n) = (2*x - 1)^2 = (sqrt(2)*sqrt(sqrt(6*y^2 - 5) + 1) - 1)^2 = 2^(z + 3) - 7 for x, y, z are the solutions to two Diophantine equations noted by R. K. Guy: 2*x^2*(x^2 - 1) = 3*(y^2 - 1) & x*(x - 1)/2 = 2^z - 1 (see A180445). x = {1, 2, 3, 6, 91} = A180445(n), y = {1, 3, 7, 29, 6761} = A227077(n), and z = {0, 1, 2, 4, 12} = A215795(n).

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 181, p. 56, Ellipses, Paris 2008.
  • L. J. Mordell, Diophantine Equations, Academic Press, NY, 1969, p. 205.

Crossrefs

Formula

a(n) + 7 = 2^A060728(n).
(a(n) - 1)/8 = A076046(n).

A180445 All positive solutions, x, for each of two Diophantine equations noted by Richard K. Guy.

Original entry on oeis.org

1, 2, 3, 6, 91
Offset: 1

Views

Author

Jonathan Vos Post, Sep 05 2010

Keywords

Comments

2*(x^2)*((x^2)-1) = 3*((y^2)-1) has only these five positive solutions.
x*(x-1)/2 = (2^z)-1 has only these five positive solutions.
Richard K. Guy notes, as Example 29: "True, but why the coincidence?"
Algebraically, y solutions = {1, 3, 7, 29, 6761} can be derived from x solutions as follows: y = sqrt(((2*x^2 - 1)^2 + 5)/6). From this relationship it becomes clear that the form (((2*x^2 - 1)^2 + 5)/6) can only be an integer square for x is in {1, 2, 3, 6, 91}. Thus, x and y solutions are also unique integer solutions to the following equivalency: (2x^2 - 1)^2 = 6y^2 - 5. From this relationship the following statement naturally follows: ((sqrt(6*y^2 - 5) + 1)/2 - sqrt((sqrt(6*(y^2) - 5) + 1)/2))/2 = (2^z - 1) = {0, 1, 3, 15, 4095} = A076046(n), the Ramanujan-Nagell triangular numbers; z = {0, 1, 2, 4, 12} = (A060728(n) - 3). - Raphie Frank, Jun 26 2013

Crossrefs

Formula

x = sqrt((sqrt(6*(y^2) - 5) + 1)/2) = (sqrt(2^(z + 3) - 7) + 1)/2; y = {1, 3, 7, 29, 6761} and z = (A060728(n) - 3) = A215795(n) = {0, 1, 2, 4, 12}. - Raphie Frank, Jun 23 2013

A215797 Numbers k such that k*(k+1)/2 + 1 is a power of 2.

Original entry on oeis.org

0, 1, 2, 5, 90
Offset: 1

Views

Author

V. Raman, Aug 23 2012

Keywords

Comments

No other terms < 10^6. - T. D. Noe, Aug 25 2012
This sequence maps to the Ramanujan-Nagell squares (8*(k*(k+1)/2)+1) and is therefore complete. - Raphie Frank, Aug 26 2012
All terms in this sequence follow form floor[2^((2*x - 1)/2)]; x = {0, 1, 2, 3, 7}. - Raphie Frank, Mar 03 2013

Crossrefs

Cf. A060728, A038198 (two references to the Ramanujan-Nagell problem).

Programs

  • Mathematica
    Select[Range[0,1000], IntegerQ[Log[2, 1 + #(#+1)/2]]&] (* T. D. Noe, Aug 25 2012 *)
  • PARI
    for(n=0,100,if(ispolygonal(2^n-1,3),print1(sqrtint(2*2^n-2)", "))) \\ Charles R Greathouse IV, Mar 04 2013

Formula

a(n) = -1 + ceiling[sqrt(2^(A060728(n) - 2) - 1)]. - Raphie Frank, Mar 31 2013
a(n) = (|(((1+i*sqrt(7))/2)^(A060728(n) - 2) + ((1-i*sqrt(7))/2)^(A060728(n) - 2))| - 1)/2. - Raphie Frank, Dec 25 2013
Showing 1-10 of 16 results. Next