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.
%I A123663 #60 Mar 08 2024 09:45:13 %S A123663 0,1,2,4,5,7,8,10,12,13,15,17,18,20,22,24,25,27,29,31,32,34,36,38,40, %T A123663 41,43,45,47,49,50,52,54,56,58,60,61,63,65,67,69,71,72,74,76,78,80,82, %U A123663 84,85,87,89,91,93,95,97,98,100,102,104,106,108,110,112,113,115,117,119 %N A123663 Number of shared edges in a spiral of n unit squares. %C A123663 If one constructs a square (square 1) and then draws another square of identical size beside it (square 2), the squares share 1 edge. If one then places an identical square above square 2 (instead of continuing in a straight path), there are now 2 shared edges. Continuing this pattern in an outward spiral, one finds that the number of shared edges is 4, 5, 7, ... %C A123663 Numbers a(n) such that a(n+1) = a(n) + 1 are (except for the leading zero) A074148. Otherwise a(n+1) = a(n) + 2. - _Franklin T. Adams-Watters_, Oct 17 2014. %C A123663 This sequence is also the maximal number of shared edges among all polyominoes with n square cells. This is the result of Harary and Harborth cited in the references. Once this is known the formula 2n - ceiling(2*sqrt(n)) comes from geometrical considerations and A027709. Namely, the 4n sides of the n squares making up the polyomino form the perimeter and come together in pairs along shared edges. Hence, 4n = perimeter + 2*shared edges. Maximizing shared edges minimizes perimeter and so maximum shared edges = (4n - minimum perimeter)/2 = (4n - 2ceiling(2*sqrt(n)))/2 = 2n - ceiling(2*sqrt(n)). This interpretation is important to landscape ecologists and is called the aggregation index in the GIS program FRAGSTATS. - _Julian F. Fleron_, Nov 29 2016 %C A123663 a(n) is also the maximum degree of the cover graphs of lattice quotients of lattice congruences of the weak order on the symmetric group S_n. See Table 1 in the Hoang/Mütze reference in the Links section. - _Torsten Muetze_, Nov 28 2019 %C A123663 a(n) is also the number of pixels in H_{n-1}, where H_n (a pixelated piece of hyperbola x*y = n) is the set of the (x, y), ordered pairs of positive integers, such that x*y = n or (x*y < n and ((x+1)*y > n or x*(y+1) > n)). - _Luc Rousseau_, Dec 28 2019 %D A123663 F. Harary and H. Harborth, Extremal Animals, Journal of Combinatorics, Information & System Sciences, Vol. 1, No 1, 1-8 (1976). %H A123663 Peter Kagey, <a href="/A123663/b123663.txt">Table of n, a(n) for n = 1..10000</a> %H A123663 Richard A. Brualdi and Geir Dahl, <a href="https://doi.org/10.1016/j.disc.2024.113951">Frobenius-König theorem for classes of (0,+/-1)-matrices</a>, Disc. Math. (2024) Vol. 347, Issue 6, 113951. %H A123663 Hung Phuc Hoang and Torsten Mütze, <a href="https://arxiv.org/abs/1911.12078">Combinatorial generation via permutation languages. II. Lattice congruences</a>, arXiv:1911.12078 [math.CO], 2019. %F A123663 a(n) = 2n - ceiling(2*sqrt(n)). - _Julian F. Fleron_, Nov 29 2016 %F A123663 a(n) = a(n-1) + 2 - [n-1 is a square or a pronic number], where [] stands for the Iverson bracket. - _Luc Rousseau_, Dec 28 2019 %p A123663 A[1]:= 0: %p A123663 for n from 2 to 100 do %p A123663 if issqr(2*A[n-1]+1) or issqr(2*A[n-1]+2) then A[n]:= A[n-1]+1 %p A123663 else A[n]:= A[n-1]+2 %p A123663 fi %p A123663 od: %p A123663 seq(A[n],n=1..100); # _Robert Israel_, Oct 21 2014 %t A123663 FoldList[Plus, 0, t = Table[2, {72}]; t[[ Table[ Ceiling[n/2] Floor[n/2], {n, 2, 16}] ]]--; t] (* _Robert G. Wilson v_, Jan 19 2007 *) %o A123663 (Ruby) a123663 = [0]; k = 0; a_n = 0; (1..N).to_a.each{ |i| 2.times{ k.times{ a_n += 2; a123663 << a_n }; a_n += 1; a123663 << a_n; }; k += 1} %o A123663 (PARI) a(n)=2*n - sqrtint(4*n-1) - 1 \\ _Charles R Greathouse IV_, Nov 29 2016 %o A123663 (Python) %o A123663 from math import isqrt %o A123663 def A123663(n): return (m:=n<<1)-1-isqrt((m<<1)-1) # _Chai Wah Wu_, Jul 28 2022 %Y A123663 Cf. A002620. %K A123663 easy,nonn %O A123663 1,3 %A A123663 _Zacariaz Martinez_, Nov 15 2006 %E A123663 Extended by _Robert G. Wilson v_, Jan 19 2007