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.

A033991 a(n) = n*(4*n-1).

This page as a plain text file.
%I A033991 #99 Feb 16 2025 08:32:36
%S A033991 0,3,14,33,60,95,138,189,248,315,390,473,564,663,770,885,1008,1139,
%T A033991 1278,1425,1580,1743,1914,2093,2280,2475,2678,2889,3108,3335,3570,
%U A033991 3813,4064,4323,4590,4865,5148,5439,5738,6045,6360,6683,7014,7353,7700,8055,8418
%N A033991 a(n) = n*(4*n-1).
%C A033991 Write 0,1,2,... in a clockwise spiral; sequence gives numbers on negative x axis. (See illustration in Example.)
%C A033991 This sequence is the number of expressions x generated for a given modulus n in finite arithmetic. For example, n=1 (modulus 1) generates 3 expressions: 0+0=0(mod 1), 0-0=0(mod 1), 0*0=0(mod 1). By subtracting n from 4n^2, we eliminate the counting of those expressions that would include division by zero, which would be, of course, undefined. - _David Quentin Dauthier_, Nov 04 2007
%C A033991 From _Emeric Deutsch_, Sep 21 2010: (Start)
%C A033991 a(n) is also the Wiener index of the windmill graph D(3,n).
%C A033991 The windmill graph D(m,n) is the graph obtained by taking n copies of the complete graph K_m with a vertex in common (i.e., a bouquet of n pieces of K_m graphs). The Wiener index of a connected graph is the sum of the distances between all unordered pairs of vertices in the graph.
%C A033991 Example: a(2)=14; indeed if the triangles are OAB and OCD, then, denoting distance by d, we have d(O,A)=d(O,B)=d(A,B)=d(O,C)=d(O,D)=d(C,D)=1 and d(A,C)=d(A,D)=d(B,C)=d(B,D)=2. The Wiener index of D(m,n) is (1/2)n(m-1)[(m-1)(2n-1)+1]. For the Wiener indices of D(4,n), D(5,n), and D(6,n) see A152743, A028994, and A180577, respectively. (End)
%C A033991 Even hexagonal numbers divided by 2. - _Omar E. Pol_, Aug 18 2011
%C A033991 For n > 0, a(n) equals the number of length 3*n binary words having exactly two 0's with the n first bits having at most one 0. For example a(2) = 14. Words are 010111, 011011, 011101, 011110, 100111, 101011, 101101, 101110, 110011, 110101, 110110, 111001, 111010, 111100. - _Franck Maminirina Ramaharo_, Mar 09 2018
%C A033991 For n >= 1, the continued fraction expansion of sqrt(a(n)) is [2n-1; {1, 2, 1, 4n-2}]. For n=1, this collapses to [1; {1, 2}]. - _Magus K. Chu_, Sep 06 2022
%D A033991 S. M. Ellerstein, The square spiral, J. Recreational Mathematics 29 (#3, 1998) 188; 30 (#4, 1999-2000), 246-250.
%D A033991 R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 2nd ed., 1994, p. 99.
%H A033991 Harvey P. Dale, <a href="/A033991/b033991.txt">Table of n, a(n) for n = 0..1000</a>
%H A033991 Emilio Apricena, <a href="/A035608/a035608.png">A version of the Ulam spiral</a>.
%H A033991 Eric W. Weisstein, <a href="https://mathworld.wolfram.com/WindmillGraph.html">Windmill Graph</a>.
%H A033991 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).
%F A033991 a(n) = A007742(-n) = A074378(2n-1) = A014848(2n).
%F A033991 G.f.: x*(3+5*x)/(1-x)^3. - _Michael Somos_, Mar 03 2003
%F A033991 a(n) = A014635(n)/2. - _Zerinvary Lajos_, Jan 16 2007
%F A033991 From _Zerinvary Lajos_, Jun 12 2007: (Start)
%F A033991 a(n) = A000326(n) + A005476(n).
%F A033991 a(n) = A049452(n) - A001105(n). (End)
%F A033991 a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. - _Harvey P. Dale_, Oct 10 2011
%F A033991 a(n) = A118729(8n+2). - _Philippe Deléham_, Mar 26 2013
%F A033991 From _Ilya Gutkovskiy_, Dec 04 2016: (Start)
%F A033991 E.g.f.: x*(3 + 4*x)*exp(x).
%F A033991 Sum_{n>=1} 1/a(n) = 3*log(2) - Pi/2 = 0.50864521488... (End)
%F A033991 a(n) = Sum_{i=n..3n-1} i. - _Wesley Ivan Hurt_, Dec 04 2016
%F A033991 From _Franck Maminirina Ramaharo_, Mar 09 2018: (Start)
%F A033991 a(n) = binomial(2*n, 2) + 2*n^2.
%F A033991 a(n) = A054556(n+1) - 1. (End)
%F A033991 Sum_{n>=1} (-1)^(n+1)/a(n) = (Pi + log(3-2*sqrt(2)))/sqrt(2) - log(2). - _Amiram Eldar_, Mar 20 2022
%e A033991 Clockwise spiral (with sequence terms parenthesized) begins
%e A033991    16--17--18--19
%e A033991     |
%e A033991    15   4---5---6
%e A033991     |   |       |
%e A033991   (14) (3) (0)  7
%e A033991     |   |   |   |
%e A033991    13   2---1   8
%e A033991     |           |
%e A033991    12--11--10---9
%p A033991 [seq(binomial(4*n, 2)/2, n=0..45)]; # _Zerinvary Lajos_, Jan 16 2007
%t A033991 Table[n*(4*n - 1), {n, 0, 100}] (* _Vladimir Joseph Stephan Orlovsky_, Jul 06 2011 *)
%t A033991 LinearRecurrence[{3,-3,1},{0,3,14},50] (* _Harvey P. Dale_, Oct 10 2011 *)
%o A033991 (PARI) a(n)=4*n^2-n;
%Y A033991 Sequences from spirals: A001107, A002939, A007742, A033951-A033954, A033989-A033991, A002943, A033996, A033988.
%Y A033991 Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
%Y A033991 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.
%Y A033991 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.
%Y A033991 Cf. A074378, A014848, A152743, A028994, A000326, A001105, A005476, A014635, A016742, A049452, A118729.
%K A033991 nonn,easy,nice
%O A033991 0,2
%A A033991 _N. J. A. Sloane_
%E A033991 Two remarks combined into one by _Emeric Deutsch_, Oct 03 2010