[seqfan] Re: 2-3 sequence puzzle

Vladimir Reshetnikov v.reshetnikov at gmail.com
Wed Mar 18 21:34:15 CET 2015


Yes, you are right!

I'm trying to write a program that can generate n-th term of this sequence.
Here is my attempt (in Mathematica syntax):

ClearAll[prepend, a];
prepend[d_, n_] := d * 10^Ceiling[Log10[n]] + n;

a[1] = 2; a[2] = 3; a[3] = 22; a[4] = 23; a[5] = 32; a[6] = 222;
a[7] = 33; a[8] = 322; a[9] = 223; a[10] = 232; a[11] = 323; a[12] = 332;

a[n_ /; OddQ[n]] := a[n] = prepend[2, a[(n - 1)/2]];
a[n_ /; EvenQ[n]] := a[n] = prepend[3, a[(n - 2)/2]];

Array[a, 100]


I do not yet have a rigorous proof that this program is correct. Can
anybody suggest such a proof?

--
Thanks
Vladimir

On Wed, Mar 18, 2015 at 7:49 AM, Bob Selcoe <rselcoe at entouchonline.net>
wrote:

> Hi Vladimir, Reinhard and Seqfans,
>
> More specifically than simply a permutation of 2-3 numbers, isn't this the
> sequence of power towers in ascending order using all permutations of 2s
> and 3s?
>
> 2
> 3
> 2^2 = 4
> 2^3 = 8
> 3^2 = 9
> 2^(2^2) = 16
> 3^3= 27
> 3^(2^2) = 81
> 2^(2^3) = 256
> 2^(3^2) = 512
> ...
>
> This would make a nice OEIS entry (it's not already there!).
>
> Best,
> Bob Selcoe
>
> --------------------------------------------------
> From: "Reinhard Zumkeller" <reinhard.zumkeller at gmail.com>
> Sent: Wednesday, March 18, 2015 6:11 AM
> To: "Sequence Fanatics Discussion list" <seqfan at list.seqfan.eu>
> Cc: <seqfan at seqfan.eu>
> Subject: [seqfan] Re: 2-3 sequence puzzle
>
>
>  Dear Vladimir,
>>
>> thanks for this nice challenge!
>>
>> My solution: it's a permutation of 2-3 numbers based on your
>> https://oeis.org/A185969
>>
>> Please have a look at draft https://oeis.org/draft/A248907 and add some
>> substance and a more explicit definition; the provisional definition
>> should
>> be just a comment.
>>
>> Best regards
>> Reinhard
>>
>>
>> 2015-03-18 0:11 GMT+01:00 Vladimir Reshetnikov <v.reshetnikov at gmail.com>:
>>
>>  Dear Seqfans,
>>>
>>> Here is a sequence consisting of all non-empty finite strings of digits 2
>>> and 3 without any duplicates. It begins as:
>>>
>>> 2, 3, 22, 23, 32, 222, 33, 322, 223, 232, 323, 332, 2222, 3222, 233, 333,
>>> 2322, 3322, 2223, 3223, 2232, 3232, 2323, 3323, 2332, 3332, 22222, 32222,
>>> 23222, 33222, 2233, 3233, 2333, 3333, 22322, 32322, 23322, 33322, 22223,
>>> 32223, 23223, 33223, 22232, 32232, 23232, 33232, 22323, 32323, 23323,
>>> 33323, 22332, 32332, 23332, 33332, 222222, 322222, 232222, 332222,
>>> 223222,
>>> 323222, 233222, 333222, 22233, 32233, 23233, 33233, 22333, 32333, 23333,
>>> 33333, 222322, ...
>>>
>>> Can you guess the order in what they appear?
>>>
>>> --
>>> Vladimir
>>>
>>> _______________________________________________
>>>
>>> Seqfan Mailing list - http://list.seqfan.eu/
>>>
>>>
>> _______________________________________________
>>
>> Seqfan Mailing list - http://list.seqfan.eu/
>>
>>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list