[seqfan] Re: confused about toothpick sequence A139250!

Maximilian Hasler maximilian.hasler at gmail.com
Tue Apr 14 02:42:27 CEST 2009


On Mon, Apr 13, 2009 at 5:37 PM, N. J. A. Sloane <njas at research.att.com> wrote:
> I was thinking the new toothpicks would have to touch the midpoints
> of old toothpicks, not their endpoints (otherwise we could add 4
> at the first step)

I think this is correct.
For me the values are reproducible. Below a PARI program which prints
the following:

0,1,3,7,11,15,23,35,43,47,55,67,79,95,123,155,171,175,183,195,207,223,251,283,303,
319,347,383,423,483,571,651,683,687,695,707,719,735,763,795,815,831,859,895,935,
995,1083,1163,1199,1215,1243,1279,1319,1379,1467,1551,1607,1667,1759,1871,
2011,229,2475,2667,2731,2735,2743,2755,2767,2783,2811,2843,2863,2879,2907,
2943,2983,3043,3131,3211,3247,3263,3291,3327,3367,3427,3515,3599,3655,3715,
3807,3919,4059,4267,4523,4715,4783,4799,4827,4863,4903,

p=Set(0); /* The set of "used" points. Points are written as complex
numbers, c=x+iy.
To avoid fractions, I take the toothpicks of length 2. */
ne=[[1,1],[-1,-1]]; /* the [new] list of (exposed) endpoints. Exposed
endpoints are listed as [c,d] where c=x+iy is the position of the
endpoint, and d=a+ib is the direction. */
print1("0,"cnt=1);
{for(n=1,99,
  ee=eval(Set(ne)); /* set of exposed endpoints [use set for sorting] */
  /* remove those which actually are not exposed */
  forstep( k=#ee, 2, -1, ee[k][1]==ee[k-1][1] | next;
ee=vecextract(ee,Str("^",k-1,".."k)); k--);
  print1(","cnt+=#ee);  /* for each exposed endpoint, a toothpick will
be added in this move */
  ne=Set(Mat(ee~)[,1]); /* discard directions */
  p=setunion(p, ne);  /* add endpoints from last move to "used" points */
  ne=[]; /* new (exposed) endpoints */
  for( k=1, #ee,  /* add exposed endpoints of new toothpicks */ ep=ee[k];
    !setsearch(p, ep[1]+I*ep[2]) & ne=concat(ne,[[ep[1]+I*ep[2],I*ep[2]]]);
    !setsearch(p, ep[1]-I*ep[2]) & ne=concat(ne, [[ep[1]-I*ep[2],-I*ep[2]]]);
) )}

Maximilian




More information about the SeqFan mailing list