text: 0,3
  The Gullwing (or G-toothpick) sequence is a special type of toothpick sequence. It appears that this is a superstructure of A139250.
  We define a "G-toothpick" to consist of two arcs of length Pi/2 forming a "gullwing" whose total length is equal to Pi = 3.141592...
  A gullwing-shaped toothpick or G-toothpick or simply "gull" is formed by two Q-toothpicks (see A187210).
  A G-toothpick has a midpoint and two endpoints. An endpoint is said to be "exposed" if it is not the midpoint or endpoint of any other G-toothpick.
  The sequence gives the number of G-toothpicks in the structure after n stages. A187221 (the first differences) gives the number of G-toothpicks added at n-th stage.
  a(n) is also the diameter of a circle whose circumference equals the total length of all gulls in the gullwing structure after n stages.
  It appears that the gullwing pattern has a recursive, fractal-like structure. An animation will show the like-fractal behavior.
  Note that the structure contains many different types of geometrical figures, for example: circles, hearts, etc. All figures are formed by arcs.
  It appears that there are infinitely many types of circular shapes, which are related to the rectangles of the toothpick structure of A139250.
  It also appears that the structure contains a nice pattern formed by distinct modular substructures: one central cross surrounded by several asymmetrical crosses (or "hidden crosses") of distinct sizes, and also several "nuclei" of crosses. This pattern is essentially similar to the crosses of A139250 but here the structure is harder to see. For example, consider the nucleus of a cross; in the toothpick structure a nucleus is formed by two squares and two rectangles but here a nucleus is formed by two circles and two hearts.
  It appears furthermore that this structure has connections with the square-cross fractal and with the T-square fractal, just as in the case of the toothpick structure of A139250.
  For more information see A139250 and A187210.
  It appears this is also the connection between A147562 (the Ulam-Warburton cellular automaton) and the toothpick sequence A139250. The behavior of the function is similar to A147562 but here the structure is more complex. (see Plot 2 button: A147562 vs A187220). - Omar E. Pol, Mar 11 2011, Mar 13 2011
  From Omar E. Pol, Mar 25 2011: (Start)
  If we remove the first gull of the structure so we can see that there is a correspondence between the gullwing structure and the I-toothpick structure of A139250, for example: a pair of opposite gulls in horizontal position in the gullwing structure is equivalent to a vertical I-toothpick with length 4 in the I-toothpick structure, such that the midpoint of each horizontal gull coincides with the midpoint of each vertical toothpick of the I-toothpick. See A160164.
  Also, B-toothpick sequence. We define a "B-toothpick" to consist of four arcs of length Pi/2 forming a "bell" similar to the Gauss function. A Bell-shaped toothpick or B-toothpick or simply "bell" is formed by four Q-toothpicks (see A187210). A B-toothpick has length 2*Pi. The sequence gives the number of B-toothpicks in the structure after n stages.
  Also, if we remove the first bell of the structure, we can find a correspondence between this structure and the I-toothpick structure of A139250. In this case, for example, a pair of opposite bells in horizontal position is equivalent to a vertical I-toothpick with length 8 in the I-toothpick structure, such that the midpoint of each horizontal bell coincides with the midpoint of each vertical toothpick of the I-toothpick. See A160164.
  Also, for this sequence there is a third structure formed by isosceles right triangles since gulls or bells can be replaced by these triangles.
  Note that the size of the gulls, bells and triangles can be adjusted such that two or three of these structures can be overlaid.
  (End)
  Table of n, a(n) for n=0..50.
  David Applegate, The movie version
  David Applegate, Illustration for a(16) = 311 [Created from the movie version, see previous link]
  David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191
  Omar E. Pol, Illustration of initial terms
  N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
  a(n) = 1 + 2*A139250(n-1), for n >= 1.
  a(n) = 1 + A160164(n-1), for n >= 1. - [Suggested by Omar E. Pol, Mar 13 2011, proved by Nathaniel Johnston, Mar 22 2011]
  The formula involving A160164 can be seen by identifying a Gullwing in the n-th generation (n >= 2) with midpoint at (x,y) and endpoints at (x-1,y+1) and (x+1,y+1) with a toothpick in the (n-1)st generation with endpoints at (x,y-1) and (x,y+1) -- this toothpick from (x,y-1) to (x,y+1) should be considered as having length ONE (i.e., it is HALF of an I-toothpick). The formula involving A139250 follows as a result of the relationship between A139250 and A160164.
  a(n) = A147614(n-1) + A160124(n-1), n >= 2. - Omar E. Pol, Feb 15 2013
  a(n) = 7 + 8*A153000(n-3), n >= 3. - Omar E. Pol, Feb 16 2013
  On the infinite square grid we start at stage 0 with no G-toothpicks, so a(0) = 0.
  At stage 1 we place a G-toothpick:
  Midpoint : (0,-1)
  Endpoints: (-1,0) and (1,0)
  So a(1) = 1. There are two exposed endpoints.
  At stage 2 we place two G-toothpicks:
  Midpoint of the left G-toothpick : (-1,0)
  Endpoints of the left G-toothpick: (-2,1) and (-2,-1)
  Midpoint of the right G-toothpick : (1,0)
  Endpoints of the right G-toothpick: (2,1) and (2,-1)
  So a(2) = 1+2 = 3. There are four exposed endpoints.
  And so on...
  Join[{0, 1}, Rest[CoefficientList[Series[(2 x / ((1 - x) (1 + 2 x))) (1+2 x Product[1 + x^(2^k - 1) + 2 x^(2^k), {k, 0, 20}]), {x, 0, 53}], x] + 1 ]] (* Vincenzo Librandi, Jul 02 2017 *)
  (Python)
  def msb(n):
  t=0
  while n>>t>0: t+=1
  return 2**(t - 1)
  def a139250(n):
  k=(2*msb(n)**2 + 1)/3
  return 0 if n==0 else k if n==msb(n) else k + 2*a139250(n - msb(n)) + a139250(n - msb(n) + 1) - 1
  def a(n): return 0 if n==0 else 1 + 2*a139250(n - 1)
  print [a(n) for n in xrange(101)] # Indranil Ghosh, Jul 01 2017
  Cf. A002450, A139250, A147562, A160164, A187210, A187221, A187222.
  Sequence in context: A192122 A069119 A261413 * A067317 A141354 A181106
  Adjacent sequences: A187217 A187218 A187219 * A187221 A187222 A187223
  nonn
  Omar E. Pol, Mar 07 2011, Mar 10 2011
  approved