# corrected sequence A071761

Alonso Del Arte alonso.delarte at gmail.com
Mon Dec 6 23:29:14 CET 2004

I think it would be better for this sequence's name field to give an
awkward description (from a literature viewpoint) that is
mathematically correct and explicit, or if that's too awkward, how
about "Bulgarian solitaire sequence"? Because as it stands right now
the pattern is not self-evident to me either. I also wonder if this
sequence should have the base keyword on it.

Alonso

P.S. What does a BASIC prt statement do?

On Mon, 06 Dec 2004 18:45:55 +0100, Jeremy Gardiner
<jeremy.gardiner at btinternet.com> wrote:
> ID Number: A071761
> Sequence:  0,1,2,21,31,32,321,421,431,432,4321,5321,5421,5431,5432,
>          54321,64321,65321,65421,65431,65432,654321,754321,764321,
>          765321,765421,765432,7654321,8654321,8754321,8764321,
>          8765321,8765421,8765431,8765432
> Name:      Pattern is self-evident.
> Comments:  Arises in analysis of Bulgarian solitaire.
>
> I calculate the following corrected sequence:
>
> 0,1,2,21,31,32,321,421,431,432,4321,5321,5421,5431,5432,54321,64321,65321,65
> 421,65431,65432,654321,754321,764321,765321,765421,765431,765432,7654321,865
> 4321,8754321,8764321,8765321,8765421,8765431,8765432,
>
> I believe the error occurs at 765432.
>
> Maybe the pattern is not so self-evident after all ;-)
>
> 100 rem BASIC program for Bulgarian solitaire (A071761)
> 110 a\$ = "21"
> 120 for k = 1 to 10
> 130 prt()
> 140 for i = 1 to len(a\$)
> 150 mid\$(a\$,i,1) = str\$(val(mid\$(a\$,i,1))+1)
> 160 prt()
> 170 next i
> 180 a\$ = a\$+"1"
> 190 next k
> 200 print
> 210 function prt()
> 220 for j = 1 to len(a\$)
> 230 print mid\$(a\$,j,1);
> 240 next j
> 250 print ",";
> 260 return
>
>