Displaying 1-8 of 8 results found.
page
1
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
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
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) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. - Harvey P. Dale, Oct 10 2011
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) = binomial(2*n, 2) + 2*n^2.
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
MATHEMATICA
LinearRecurrence[{3, -3, 1}, {0, 3, 14}, 50] (* Harvey P. Dale, Oct 10 2011 *)
CROSSREFS
Cf. A074378, A014848, A152743, A028994, A000326, A001105, A005476, A014635, A016742, A049452, A118729.
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
COMMENTS
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.
Equals A132774 * [1, 2, 3, ...]; = binomial transform of [1, 7, 8, 0, 0, 0, ...]. - Gary W. Adamson, Aug 28 2007
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
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
MATHEMATICA
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)
CROSSREFS
Sequences from spirals: A001107, A002939, A007742, A033951, A033952, A033953, A033954, A033989, A033990, A033991, A002943, A033996, A033988.
AUTHOR
Olivier Gorin (gorin(AT)roazhon.inra.fr)
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
COMMENTS
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
Also: append its negated last bit to n-1. - M. F. Hasler, Oct 17 2022
FORMULA
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]
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = (4*n - 3 - (-1)^n)/2. (End)
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
MATHEMATICA
Select[Range[109], Or[Mod[#, 4] == 1, Mod[#, 4] == 2] &] (* Ant King, Nov 17 2010 *)
CoefficientList[Series[(1 + x + 2 x^2)/((-1 + x)^2 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
PROG
(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]]
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
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.
EXAMPLE
83 is an isolated prime as the adjacent numbers in lattice 50, 51, 81, 82, 84, 123, 124, 125 are not primes.
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. A001107, A002939, A007742, A033951- A033954, A033989, A033990, A033991, A002943, A033996, A033988, A014848.
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
COMMENTS
Number of edges in "median" graph - gives positions of largest entries in rows of table in A054924.
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
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
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 + ...
MATHEMATICA
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]))+", ");
(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
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
FORMULA
G.f.: 2*x*(1+x+2*x^2)/((1+x)*(1-x)^2).
a(n) = 4*n-(-1)^n-3.
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
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
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).
T(n, k) = n - (1 - (-1)^(n+k))/2 = n - (n+k mod 2).
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
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
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.
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 | | |
+---+ +---+
Search completed in 0.013 seconds
|