[seqfan] Re: Distinct strings

Lars Blomberg larsl.blomberg at comhem.se
Fri Apr 5 19:38:20 CEST 2019


I agree with Maximilian and then
S(43)=10235678, n(43)=49.

/Lars

-----Ursprungligt meddelande-----
Från: SeqFan <seqfan-bounces at list.seqfan.eu> För M. F. Hasler
Skickat: den 5 april 2019 14:42
Till: Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
Ämne: [seqfan] Re: Distinct strings

On Tue, Apr 2, 2019, 11:10 Éric Angelini  wrote:

> Hello SeqFans,
> Could someone check and compute perhaps a few more terms (if this is 
> of interest)?
> S = 1, 2, 222, 22, 2222, 3, 120, 10, 234, 24, 103, 112, 122, 100, 
> 2345, 25, 1130, 102, 1345, 111, 2340, 1000,...
>

I confirm this and according to my (quite primitive) program, the next term should be
S(23) = 111213 with n(23) = 26+1 = 27 distinct numeric substrings when appended to S(22).
Then I think n(24)=28 isn't possible and S(24)=11 with a new "jump" of +2, as for S(20), for the number of distinct "substring-numbers", n(24)=29.
Then S(25) = 112340 with n(25)=30.
Then S(26) = 13 with n(26)=31.
Then S(27) = 111240 with n(27)=32.
Then S(28) = 124 with n(28)=33.
Then S(29) = 11350 with n(29)=34.
Then S(30) = 1202 with n(30)=35.
Then S(31) = 13456 with n(31)=36.
Then again I think a jump of +2 is required in the sequence of n's, and S = ..., 1111, 23450, 1167, 11230, 10134, 11215, 10003, 1112456, 245, 1011236, 1004, ...

- Maximilian

The rules:
> Lexico-first seq of distinct terms;
> Extend S with the smallest integer such that the new concatenation 
> beats the previous one by the smallest possible margin (in terms of 
> strings quantity). [ignoring leading zeros]
>

(PARI)
a_upto(N=99,a=List(1),U=[],L=2,step=[5,5,19,23,31])={
my(n(s)=#Set(concat(vector(#s=Vecsmall(s),L,vector(#s-L+1,j,
if(s[j]>48,s[j..j+L-1]))))));
while(#a<N,print1(a[#a]","); U=setunion(U,[a[#a]]); while(#U>1&&U[2]==U[1]+1,U=U[^1]); L+=#select(t->t==#a,step)+1; for(k=U[1]+1,oo,!setsearch(U,k)&& n(Str(a[#a],k))==L&& listput(a,k)&& break)); Vec(a)}

--
Seqfan Mailing list - http://list.seqfan.eu/




More information about the SeqFan mailing list