[seqfan] Re: A sum visible in the 1st integer

M. F. Hasler oeis at hasler.fr
Fri Feb 5 02:27:32 CET 2016


I get the same terms as Jack.
But there is no need for any backtracking.
I think Eric's definition is equivalent to :
a(n+1) is the least term not used earlier such that
last_digit(a(n))+first_digit(a(n+1)) is a substring of a(n).

Let us call "admissible" any x which contains as substring at least one
among [1..9] + last_digit(x).

I find that the admissible numbers are the x = 10k+z, z=0..9, such that k
has a digit > z or it has a digit 1 followed by a digit < z:

isok(n)=vecmax(n=digits(n))>n[#n] || sum(i=1,#n-2, n[i]==1 && n[i+1]<n[#n])
select(isok,[1..999])
 = [10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62,
63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82,
83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136,
137, ...]

I conjecture* that the sequence contains exactly all  (i.e., is a
permutation of the) admissible numbers.
(*Actually I could prove it but this would be a bit tedious.)

The sequence can be calculated straightfowardly by always choosing the next
unused admissible number whose first digit is compatible with the preceding
term:

EA(n,a=List(10),u=[0])={ for(n=1,n-1,u=setunion(u,[a[n]]);
ok=setintersect(apply(t->t-a[n]%10,Set(concat(ok=digits(a[n]),vector(#ok-1,i,ok[i+1]+ok[i]*10)))),[1..9]);
for(k=u[1]+1,9e9, !setsearch(u,k) && isok(k) && setsearch(ok,digits(k)[1])
&& listput(a,k) && break)); Vec(a)}

A slightly optimized version can be found in oeis.org/draft/A268449/.

Maximilian


On Thu, Feb 4, 2016 at 2:46 PM, Jack Brennen <jfb at brennen.net> wrote:

> I get a sequence (not hand-computed):
>
> T = 10,100,101,90,91,80,81,70,71,60,61,50,51,40,41,30,31,20,21,102,
> 82,62,42,200,201,103,72,52,32,104,63,300,301,210,105,53,211,106,43,
> 107,302,108,220,221,109,110,112,92,73,400,401,310,113,83,54,114,74,
> (snip)

2084,4000,4001,3050,574,1036,4002,2085,3051,2086,2087,1037,3052,...
>
> It matches yours up to the point where you re-used 43.
>
> Seems fairly chaotic.
>
> - Jack
>
>
>
> On 2/4/2016 8:29 AM, Eric Angelini wrote:
>
>> Hello SqFans,
>> Same idea as my prior post (that got not a single reply -- sigh!)
>>
>> T = 10,100,101,90,91,80,81,70,71,60,61,50,51,40,41,30,31,20,21,102,
>> 82,62,42,200,201,103,72,52,32,104,63,300,301,210,105,53,211,106,43,
>> 107,302,108,220,221,109,110,112,92,73,43,113,83,54,114,74,310,115,
>> 64,230,231,116,500,501,400,401,302,117,402,232,...
>>
>> The rules for expanding T are:
>> # Say "a" and "b" are two consecutive terms of S;
>> # Add the last digit of "a" to the first digit of "b"
>> # The result must be a substring of "a"
>> # "b" cannot be a term already in S.
>>
>> We see here that
>> 0+1 = 1 which is visible in 10
>> 0+1 = 1 which is visible in 100
>> 1+9 = 10 which is visible in 101
>> 9+0 = 9 which is visible in 90
>> etc.
>> The term after 21 (end of first row) cannot be 10 (though 1+1 = 2
>> which is visible in 21) because 10 was already used before. So 102,
>> being the next available integer, has been selected.
>>
>> T is NOT a permutation of the integers > 0, of course.
>>
>> This is tricky to compute by hand. Needing a lot of backtracking.
>> Hope no typos were left.
>>
>> Best,
>> É.
>>
>



More information about the SeqFan mailing list