[go: up one dir, main page]

login
Search: a014848 -id:a014848
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) = n*(4*n-1).
+10
69
0, 3, 14, 33, 60, 95, 138, 189, 248, 315, 390, 473, 564, 663, 770, 885, 1008, 1139, 1278, 1425, 1580, 1743, 1914, 2093, 2280, 2475, 2678, 2889, 3108, 3335, 3570, 3813, 4064, 4323, 4590, 4865, 5148, 5439, 5738, 6045, 6360, 6683, 7014, 7353, 7700, 8055, 8418
OFFSET
0,2
COMMENTS
Write 0,1,2,... in a clockwise spiral; sequence gives numbers on negative x axis. (See illustration in Example.)
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
From Emeric Deutsch, Sep 21 2010: (Start)
a(n) is also the Wiener index of the windmill graph D(3,n).
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.
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)
Even hexagonal numbers divided by 2. - Omar E. Pol, Aug 18 2011
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
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
REFERENCES
S. M. Ellerstein, The square spiral, J. Recreational Mathematics 29 (#3, 1998) 188; 30 (#4, 1999-2000), 246-250.
R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 2nd ed., 1994, p. 99.
FORMULA
a(n) = A007742(-n) = A074378(2n-1) = A014848(2n).
G.f.: x*(3+5*x)/(1-x)^3. - Michael Somos, Mar 03 2003
a(n) = A014635(n)/2. - Zerinvary Lajos, Jan 16 2007
From Zerinvary Lajos, Jun 12 2007: (Start)
a(n) = A000326(n) + A005476(n).
a(n) = A049452(n) - A001105(n). (End)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. - Harvey P. Dale, Oct 10 2011
a(n) = A118729(8n+2). - Philippe Deléham, Mar 26 2013
From Ilya Gutkovskiy, Dec 04 2016: (Start)
E.g.f.: x*(3 + 4*x)*exp(x).
Sum_{n>=1} 1/a(n) = 3*log(2) - Pi/2 = 0.50864521488... (End)
a(n) = Sum_{i=n..3n-1} i. - Wesley Ivan Hurt, Dec 04 2016
From Franck Maminirina Ramaharo, Mar 09 2018: (Start)
a(n) = binomial(2*n, 2) + 2*n^2.
a(n) = A054556(n+1) - 1. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (Pi + log(3-2*sqrt(2)))/sqrt(2) - log(2). - Amiram Eldar, Mar 20 2022
EXAMPLE
Clockwise spiral (with sequence terms parenthesized) begins
16--17--18--19
|
15 4---5---6
| | |
(14) (3) (0) 7
| | | |
13 2---1 8
| |
12--11--10---9
MAPLE
[seq(binomial(4*n, 2)/2, n=0..45)]; # Zerinvary Lajos, Jan 16 2007
MATHEMATICA
Table[n*(4*n - 1), {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, Jul 06 2011 *)
LinearRecurrence[{3, -3, 1}, {0, 3, 14}, 50] (* Harvey P. Dale, Oct 10 2011 *)
PROG
(PARI) a(n)=4*n^2-n;
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.
KEYWORD
nonn,easy,nice
EXTENSIONS
Two remarks combined into one by Emeric Deutsch, Oct 03 2010
STATUS
approved
Write 1,2,... in a clockwise spiral; sequence gives numbers on positive x axis.
+10
57
1, 8, 23, 46, 77, 116, 163, 218, 281, 352, 431, 518, 613, 716, 827, 946, 1073, 1208, 1351, 1502, 1661, 1828, 2003, 2186, 2377, 2576, 2783, 2998, 3221, 3452, 3691, 3938, 4193, 4456, 4727, 5006, 5293, 5588, 5891, 6202, 6521, 6848, 7183, 7526, 7877, 8236, 8603, 8978
OFFSET
0,2
COMMENTS
Ulam's spiral (S spoke of A054552). - Robert G. Wilson v, Oct 31 2011
a(n) is the first term in a sum of 2*n + 1 consecutive integers that equals (2*n + 1)^3. - Patrick J. McNab, Dec 24 2016
FORMULA
a(n) = 4*n^2 + 3*n + 1.
G.f.: (1 + 5*x + 2*x^2)/(1-x)^3.
A014848(2n+1) = a(n).
Equals A132774 * [1, 2, 3, ...]; = binomial transform of [1, 7, 8, 0, 0, 0, ...]. - Gary W. Adamson, Aug 28 2007
a(n) = A016754(n) - n. - Reinhard Zumkeller, May 17 2009
a(n) = a(n-1) + 8*n-1 (with a(0)=1). - Vincenzo Librandi, Nov 17 2010
a(0)=1, a(1)=8, a(2)=23, a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Harvey P. Dale, Feb 07 2015
E.g.f.: exp(x)*(1 + 7*x + 4*x^2). - Stefano Spezia, Apr 24 2024
EXAMPLE
Spiral begins:
.
65--66--67--68--69--70--71--72--73
| |
64 37--38--39--40--41--42--43 74
| | | |
63 36 17--18--19--20--21 44 75
| | | | | |
62 35 16 5---6---7 22 45 76
| | | | | | | |
61 34 15 4 1 8 23 46 77
| | | | | | | |
60 33 14 3---2 9 24 47
| | | | | |
59 32 13--12--11--10 25 48
| | | |
58 31--30--29--28--27--26 49
| |
57--56--55--54--53--52--51--50
MAPLE
A033951:=n->4*n^2 + 3*n + 1: seq(A033951(n), n=0..100); # Wesley Ivan Hurt, Feb 11 2017
MATHEMATICA
lst={}; Do[p=4*n^2+3*n+1; AppendTo[lst, p], {n, 1, 6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Sep 01 2008 *)
LinearRecurrence[{3, -3, 1}, {1, 8, 23}, 60] (* Harvey P. Dale, Feb 07 2015 *)
CoefficientList[Series[(1 + 5 x + 2 x^2)/(1 - x)^3, {x, 0, 45}], x] (* Michael De Vlieger, Feb 12 2017 *)
PROG
(PARI) a(n)=4*n^2+3*n+1
(Python)
[4*n**2 + 3*n + 1 for n in range(46)] # Michael S. Branicky, Jan 08 2021
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.
KEYWORD
nonn,easy,nice
AUTHOR
Olivier Gorin (gorin(AT)roazhon.inra.fr)
EXTENSIONS
Extended (with formula) by Erich Friedman
STATUS
approved
Numbers congruent to 1 or 2 mod 4.
+10
54
1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 25, 26, 29, 30, 33, 34, 37, 38, 41, 42, 45, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66, 69, 70, 73, 74, 77, 78, 81, 82, 85, 86, 89, 90, 93, 94, 97, 98, 101, 102, 105, 106, 109, 110, 113, 114, 117, 118, 121, 122, 125, 126, 129, 130, 133, 134, 137, 138
OFFSET
1,2
COMMENTS
Complement of A014601. - Reinhard Zumkeller, Oct 04 2004
Let S(x) = (1, 2, 2, 2, ...). Then A042963 = ((S(x)^2 + S(x^2))/2 = ((1, 4, 8, 12, 16, 20, ...) + (1, 0, 2, 0, 2, 0, 2, ...))/2 = (1, 2, 5, 6, 9, 10, ...). - Gary W. Adamson, Jan 03 2011
(a(n)*(a(n) + 1 + 4*k))/2 is odd, for k >= 0. - Gionata Neri, Jul 19 2015
Equivalent to the following variation on Fermat's Diophantine m-tuple: 1 + the product of any two distinct terms is not a square; this sequence, which we'll call sequence S, is produced by the following algorithm. At the start, S is initially empty. At stage n, starting at n = 1, the algorithm checks whether there exists a number m already in the sequence, such that mn+1 is a perfect square. If such a number m is found, then n is not added to the sequence; otherwise, n is added. Then n is incremented to n + 1, and we repeat the procedure. Proof by Clark R. Lyons: We prove by strong induction that n is in the sequence S if and only if n == 1 (mod 4) or n == 2 (mod 4). Suppose now that this holds for all k < n. In case 1, either n == 1 (mod 4) or n == 2 (mod 4), and we wish to show that n does indeed enter the sequence S. That is, we wish to show that there does not exist m < n, already in the sequence at this point such that mn+1 is a square. By the inductive hypothesis m == 1 (mod 4) or m == 2 (mod 4). This means that both m and n are one of 1, 2, 5, or 6 mod 8. Using a multiplication table mod 8, we see that this implies mn+1 is congruent to one of 2, 3, 5, 6, or 7 mod 8. But we also see that mod 8, a perfect square is congruent to 0, 1, or 4. Thus mn+1 is not a perfect square, so n is added to the sequence. In case 2, n == 0 (mod 4) or n == 3 (mod 4), and we wish to show that n is not added to the sequence. That is, we wish to show that there exists m < n already in the sequence such that mn+1 is a perfect square. For this we let m = n - 2, which is positive since n >= 3. By the inductive hypothesis, since m == 1 (mod 4) or m == 2 (mod 4) and m < n, m is already in the sequence. And we have m*n + 1 = (n - 2)*n + 1 = n^2 - 2*n + 1 = (n - 1)^2, so mn+1 is indeed a perfect square, and so n is not added to the sequence. Thus n is added to the sequence if and only if n == 1 (mod 4) or n == 2 (mod 4). This completes the proof. - Robert C. Lyons, Jun 30 2016
Also the number of maximal cliques in the (n + 1) X (n + 1) black bishop graph. - Eric W. Weisstein, Dec 01 2017
Lexicographically earliest sequence of distinct positive integers such that the average of any two or more consecutive terms is never an integer. (For opposite property see A005408.) - Ivan Neretin, Dec 21 2017
Numbers whose binary reflected Gray code (A014550) ends with 1. - Amiram Eldar, May 17 2021
Also: append its negated last bit to n-1. - M. F. Hasler, Oct 17 2022
LINKS
David Lovler, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
Eric Weisstein's World of Mathematics, Black Bishop Graph.
Eric Weisstein's World of Mathematics, Maximal Clique.
FORMULA
a(n) = 1 + A042948(n-1). [Corrected by Jianing Song, Oct 06 2018]
From Michael Somos, Jan 12 2000: (Start)
G.f.: x*(1 + x + 2*x^2)/((1 - x)^2*(1 + x)).
a(n) = a(n-1) + 2 + (-1)^n, a(0) = 1. (End) [This uses offset 0. - Jianing Song, Oct 06 2018]
A014493(n) = A000217(a(n)). - Reinhard Zumkeller, Oct 04 2004, Feb 14 2012
a(n) = Sum_{k=0..n} (A001045(k) mod 4). - Paul Barry, Mar 12 2004
A145768(a(n)) is odd. - Reinhard Zumkeller, Jun 05 2012
a(n) = A005843(n-1) + A059841(n-1). - Philippe Deléham, Mar 31 2009 [Corrected by Jianing Song, Oct 06 2018]
a(n) = 4*n - a(n-1) - 5 for n > 1. [Corrected by Jerzy R Borysowicz, Jun 09 2023]
From Ant King, Nov 17 2010: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = (4*n - 3 - (-1)^n)/2. (End)
a(n) = (n mod 2) + 2*n - 2. - Wesley Ivan Hurt, Oct 10 2013
A163575(a(n)) = n - 1. - Reinhard Zumkeller, Jul 22 2014
E.g.f.: 2 + (2*x - 1)*sinh(x) + 2*(x - 1)*cosh(x). - Ilya Gutkovskiy, Jun 30 2016
E.g.f.: 2 + (2*x - 1)*exp(x) - cosh(x). - David Lovler, Jul 19 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 + log(2)/4. - Amiram Eldar, Dec 05 2021
MAPLE
A046923:=n->(n mod 2) + 2n - 2; seq(A046923(n), n=1..100); # Wesley Ivan Hurt, Oct 10 2013
MATHEMATICA
Select[Range[109], Or[Mod[#, 4] == 1, Mod[#, 4] == 2] &] (* Ant King, Nov 17 2010 *)
Table[(4 n - 3 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Dec 01 2017 *)
LinearRecurrence[{1, 1, -1}, {1, 2, 5}, 20] (* Eric W. Weisstein, Dec 01 2017 *)
CoefficientList[Series[(1 + x + 2 x^2)/((-1 + x)^2 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
PROG
(PARI) a(n)=2*n-1-(n-1)%2 \\ Jianing Song, Oct 06 2018; adapted to offset by Michel Marcus, Sep 09 2022
(PARI) apply( A042963(n)=n*2-2+n%2, [1..99]) \\ M. F. Hasler, Oct 17 2022
(Magma) [ n : n in [1..165] | n mod 4 eq 1 or n mod 4 eq 2 ] // Vincenzo Librandi, Jan 25 2011
(Haskell)
a042963 n = a042963_list !! (n-1)
a042963_list = [x | x <- [0..], mod x 4 `elem` [1, 2]]
-- Reinhard Zumkeller, Feb 14 2012
CROSSREFS
Cf. A153284 (first differences), A014848 (partial sums).
Cf. A014550, A046712 (subsequence).
Union of A016813 and A016825.
KEYWORD
nonn,easy
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Feb 14 2012
More terms by David Lovler, Jul 19 2022
STATUS
approved
Isolated primes in Ulam's lattice (1, 2, ... in spiral).
+10
15
83, 101, 127, 137, 163, 199, 233, 311, 373, 443, 463, 491, 541, 587, 613, 631, 641, 659, 673, 683, 691, 733, 757, 797, 859, 881, 911, 919, 953, 971, 991, 1013, 1051, 1061, 1103, 1109, 1117, 1193, 1201, 1213, 1249, 1307, 1319, 1409, 1433, 1459, 1483, 1487
OFFSET
1,1
COMMENTS
Isolated prime numbers have no adjacent primes in a lattice generated by writing consecutive integers starting from 1 in a spiral distribution. If n0 is the number of isolated primes and p the number of primes less than N, the ratio n0/p approaches 1 as N increases. If n1, n2, n3, n4 denote the number of primes with respectively 1, 2, 3, 4 adjacent primes in the lattice, the ratios n1/n0, n2/n1, n3/n2, n4/n3 approach 0 as N increases. The limits stand for any 2D lattice of integers generated by a priori criteria (i.e., not knowing distributions of primes) as Ulam's lattice.
REFERENCES
G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 22.
LINKS
Eric Weisstein's World of Mathematics, Prime Spiral.
EXAMPLE
83 is an isolated prime as the adjacent numbers in lattice 50, 51, 81, 82, 84, 123, 124, 125 are not primes.
From Michael De Vlieger, Dec 22 2015: (Start)
Spiral including n <= 17^2 showing only primes, with the isolated primes in parentheses (redrawn by Jon E. Schoenfield, Aug 06 2017):
257 . . . . . 251 . . . . . . . . . 241
. 197 . . . 193 . 191 . . . . . . . . .
. . . . . . . . 139 .(137). . . . . 239
.(199).(101). . . 97 . . . . . . . 181 .
. . . . . . . . 61 . 59 . . . 131 . .
. . . 103 . 37 . . . . . 31 . 89 . 179 .
263 . 149 . 67 . 17 . . . 13 . . . . . .
. . . . . . . 5 . 3 . 29 . . . . .
. . 151 . . . 19 . . 2 11 . 53 .(127).(233)
. . . 107 . 41 . 7 . . . . . . . . .
. . . . 71 . . . 23 . . . . . . . .
. . . 109 . 43 . . . 47 . . .(83) . 173 .
269 . . . 73 . . . . . 79 . . . . . 229
. . . . . 113 . . . . . . . . . . .
271 . 157 . . . . .(163). . . 167 . . . 227
. 211 . . . . . . . . . . . 223 . . .
. . . . 277 . . . 281 . 283 . . . . . .
MAPLE
# A is Ulam's lattice
if (isprime(A[x, y])and(not(isprime(A[x+1, y]) or isprime(A[x-1, y])or isprime(A[x, y+1])or isprime(A[x, y-1])or isprime(A[x-1, y-1])or isprime(A[x+1, y+1])or isprime(A[x+1, y-1])or isprime(A[x-1, y+1])))) then print (A[x, y]) ; fi;
MATHEMATICA
spiral[n_] := Block[{o = 2 n - 1, t, w}, t = Table[0, {o}, {o}]; t = ReplacePart[t, {n, n} -> 1]; Do[w = Partition[Range[(2 (# - 1) - 1)^2 + 1, (2 # - 1)^2], 2 (# - 1)] &@ k; Do[t = ReplacePart[t, {(n + k) - (j + 1), n + (k - 1)} -> #[[1, j]]]; t = ReplacePart[t, {n - (k - 1), (n + k) - (j + 1)} -> #[[2, j]]]; t = ReplacePart[t, {(n - k) + (j + 1), n - (k - 1)} -> #[[3, j]]]; t = ReplacePart[t, {n + (k - 1), (n - k) + (j + 1)} -> #[[4, j]]], {j, 2 (k - 1)}] &@ w, {k, 2, n}]; t]; f[w_] := Block[{d = Dimensions@ w, t, g}, t = Reap[Do[Sow@ Take[#[[k]], {2, First@ d - 1}], {k, 2, Last@ d - 1}]][[-1, 1]] &@ w; g[n_] := If[n != 0, Total@ Join[Take[w[[Last@ # - 1]], {First@ # - 1, First@ # + 1}], {First@ #, Last@ #} &@ Take[w[[Last@ #]], {First@ # - 1, First@ # + 1}], Take[w[[Last@ # + 1]], {First@ # - 1, First@# + 1}]] &@(Reverse@ First@ Position[t, n] + {1, 1}) == 0, False]; Select[Union@ Flatten@ t, g@ # &]]; f[spiral@ 21 /. n_ /; CompositeQ@ n -> 0] (* Michael De Vlieger, Dec 22 2015, Version 10 *)
CROSSREFS
Cf. A113688 (isolated semiprimes in the semiprime spiral), A156859.
KEYWORD
nonn
AUTHOR
STATUS
approved
a(n) = ceiling(n*(n-1)/4).
+10
12
0, 0, 1, 2, 3, 5, 8, 11, 14, 18, 23, 28, 33, 39, 46, 53, 60, 68, 77, 86, 95, 105, 116, 127, 138, 150, 163, 176, 189, 203, 218, 233, 248, 264, 281, 298, 315, 333, 352, 371, 390, 410, 431, 452, 473, 495, 518, 541, 564, 588, 613, 638, 663, 689, 716, 743, 770, 798
OFFSET
0,4
COMMENTS
Number of edges in "median" graph - gives positions of largest entries in rows of table in A054924.
Form the clockwise spiral starting 0,1,2,....; then A054925(n+1) interleaves 2 horizontal (A033951, A033991) and 2 vertical (A007742, A054552) branches. A bisection is A014848. - Paul Barry, Oct 08 2007
Consider the standard 4-dimensional Euclidean lattice. We take 1 step along the positive x-axis, 2 along the positive y-axis, 3 along the positive z-axis, 4 along the positive t-axis, and then back round to the x-axis. This sequence gives the floor of the Euclidean distance to the origin after n steps. - Jon Perry, Apr 16 2013
Jon Perry's JavaScript code is explained by A238604. - Michael Somos, Mar 01 2014
Ceiling of the area under the polygon connecting the lattice points (n, floor(n/2)) from 0..n. - Wesley Ivan Hurt, Jun 09 2014
Ceiling of one-half of each triangular number. - Harvey P. Dale, Oct 03 2016
For n > 2, also the edge cover number of the (n-1)-triangular honeycomb queen graph. - Eric W. Weisstein, Jul 14 2017
FORMULA
Euler transform of length 6 sequence [ 2, 0, 1, 1, 0, -1]. - Michael Somos, Sep 02 2006
G.f.: x^2 * (x^2 - x + 1) / ((1 - x)^3 * (1 + x^2)) = x^2 * (1 - x^6) / ((1 - x)^2 * (1 - x^3) * (1 - x^4)). a(1-n) = a(n). A011848(n) = a(-n). - Michael Somos, Feb 11 2004
a(n + 4) = a(n) + 2*n + 3. - Michael Somos, Mar 01 2014
a(n+1) = floor( sqrt( A238604(n))). - Michael Somos, Mar 01 2014
a(n) = A011848(n) + A133872(n+2). - Wesley Ivan Hurt, Jun 09 2014
EXAMPLE
a(6) = 8; ceiling(6*(6-1)/4) = ceiling(30/4) = 8.
G.f. = x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 8*x^6 + 11*x^7 + 14*x^8 + 18*x^9 + 23*x^10 + ...
MAPLE
seq(ceil(binomial(n, 2)/2), n=0..57); # Zerinvary Lajos, Jan 12 2009
MATHEMATICA
Table[Ceiling[(n^2 - n)/4], {n, 0, 20}] (* Wesley Ivan Hurt, Nov 01 2013 *)
LinearRecurrence[{3, -4, 4, -3, 1}, {0, 0, 1, 2, 3}, 60] (* Vincenzo Librandi, Jul 14 2015 *)
Join[{0}, Ceiling[#/2]&/@Accumulate[Range[0, 60]]] (* Harvey P. Dale, Oct 03 2016 *)
PROG
(PARI) {a(n) = ceil( n * (n-1)/4)}; /* Michael Somos, Feb 11 2004 */
(Sage) [ceil(binomial(n, 2)/2) for n in range(0, 58)] # Zerinvary Lajos, Dec 01 2009
(JavaScript)
p=new Array(0, 0, 0, 0);
for (a=0; a<100; a++) {
p[a%4]+=a;
document.write(Math.floor(Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]+p[3]*p[3]))+", ");
} /* Jon Perry, Apr 16 2013 */
(Magma) [ Ceiling(n*(n-1)/4) : n in [0..50] ]; // Wesley Ivan Hurt, Jun 09 2014
(Magma) I:=[0, 0, 1, 2, 3]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jul 14 2015
CROSSREFS
Cf. A054924, A054925 + A011848 = C(n, 2).
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 24 2000
STATUS
approved
Numbers that are congruent to {2, 4} mod 8.
+10
9
2, 4, 10, 12, 18, 20, 26, 28, 34, 36, 42, 44, 50, 52, 58, 60, 66, 68, 74, 76, 82, 84, 90, 92, 98, 100, 106, 108, 114, 116, 122, 124, 130, 132, 138, 140, 146, 148, 154, 156, 162, 164, 170, 172, 178, 180, 186, 188, 194, 196, 202, 204, 210, 212, 218, 220, 226, 228, 234
OFFSET
1,1
COMMENTS
First differences in A010696.
FORMULA
a(n) = 8*n - a(n-1) - 10, with a(1)=2. - Vincenzo Librandi, Aug 06 2010
From Bruno Berselli, May 11 2011: (Start)
G.f.: 2*x*(1+x+2*x^2)/((1+x)*(1-x)^2).
a(n) = 4*n-(-1)^n-3.
Sum_{i=1..n} a(i) = 2*A014848(n).
a(n) = 2*A042963(n-1). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/16 + log(2)/8. - Amiram Eldar, Dec 18 2021
MATHEMATICA
Select[Range[250], MemberQ[{2, 4}, Mod[#, 8]] &] (* Amiram Eldar, Dec 18 2021 *)
PROG
(Magma) [ n: n in [2..234 by 2] | n mod 8 in [2, 4] ]; // Bruno Berselli, May 11 2011
CROSSREFS
Union of A017089 and A017113.
Cf. A014848.
KEYWORD
nonn
EXTENSIONS
More terms from Vincenzo Librandi, Aug 06 2010
STATUS
approved
Triangle T(n, k) = A128064(unsigned) * A128174, read by rows.
+10
2
1, 1, 2, 3, 2, 3, 3, 4, 3, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 7, 7, 8, 7, 8, 7, 8, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 11, 12, 11, 12, 11, 12, 11, 12, 11, 12, 11, 12
OFFSET
1,3
FORMULA
T(n, k) = abs(A128064(n,k) * A128174(n, k), as infinite lower triangular matrices.
Sum_{k=1..n} T(n, k) = A014848(n) (row sums).
From G. C. Greubel, Mar 14 2024: (Start)
T(n, k) = n - (1 - (-1)^(n+k))/2 = n - (n+k mod 2).
T(n, 1) = A109613(n+1).
T(n, n) = A000027(n).
T(2*n-1, n) = A042963(n).
T(3*n-1, n) = A016777(n+1).
T(4*n-3, n) = A047461(n).
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = A319556(n).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A000326(floor((n+1)/2)).
Sum_{k=1..floor((n+1)/2)} (-1)^(k-1)*T(n-k+1, k) = A123684(floor((n+1)/2)). (End)
EXAMPLE
First few rows of the triangle are:
1;
1, 2;
3, 2, 3;
3, 4, 3, 4;
5, 4, 5, 4, 5;
5, 6, 5, 6, 5, 6;
7, 6, 7, 6, 7, 6, 7;
...
MATHEMATICA
Table[n - Mod[n+k, 2], {n, 16}, {k, n}]//Flatten (* G. C. Greubel, Mar 14 2024 *)
PROG
(Magma) [n - ((n+k) mod 2): k in [1..n], n in [1..16]]; // G. C. Greubel, Mar 14 2024
(SageMath) flatten([[n - ((n+k)%2) for k in range(1, n+1)] for n in range(1, 16)]) # G. C. Greubel, Mar 14 2024
CROSSREFS
Cf. A000326 (diagonal sums), A014848 (row sums), A319556 (alternating row sums).
KEYWORD
nonn,tabl,easy
AUTHOR
Gary W. Adamson, Mar 14 2007
EXTENSIONS
More terms added by G. C. Greubel, Mar 14 2024
STATUS
approved
The number of ways of 2-coloring the diagram for the n-th centered square number up to rotation and reflection of the square.
+10
0
2, 12, 1236, 4215840, 274888655360, 288230395747516416, 4835703278617945885900800, 1298074214633711825063417305104384, 5575186299632655786027352001453113896599552, 383123885216472214589587083913232677066440014825521152
OFFSET
0,1
COMMENTS
The centered square numbers are given by A001844. The diagram for the n-th centered square number is the set of integer pairs (x,y) such that |x| + |y| <= n.
LINKS
Eric Weisstein's World of Mathematics, Centered Square Number.
FORMULA
a(n) = 1/8*(2^A001844(n) + 2*2^((n+1)^2) + 2*2^A000124(n) + 2^A002061(n+1) + 2*2^A014848(n+1)).
EXAMPLE
For n=1 the a(1) = 12 inequivalent colorings are:
0 1 1 0 1 1
0 0 0, 0 0 0, 1 0 0, 1 0 1, 1 0 1, and 1 0 1,
0 0 0 0 0 1
along with
1 0 0 1 0 0
1 1 1, 1 1 1, 0 1 1, 0 1 0, 0 1 0, and 0 1 0.
1 1 1 1 1 0
For n = 2, the corresponding diagram has A001844(2) = 13 boxes and a(2) = 1236 inequivalent colorings. For instance, the following two colorings are considered equivalent, because one can be transformed to the other by a reflection.
+---+ +---+
| 1 | | 1 |
+---+---+---+ +---+---+---+
| 1 | 1 | | | 1 | | 1 |
+---+---+---+---+---+ +---+---+---+---+---+
| 1 | | | 1 | | | 1 | 1 | | | 1 |
+---+---+---+---+---+ +---+---+---+---+---+
| 1 | | | | | 1 | |
+---+---+---+ +---+---+---+
| 1 | | |
+---+ +---+
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Apr 21 2024
STATUS
approved

Search completed in 0.013 seconds