[seqfan] Re: Is there a better way to find the terms of this sequence (other than trial and error)? Correction

Ali Sada pemd70 at yahoo.com
Sun Nov 10 20:07:17 CET 2019


 Thank you very much Dr. Hasler for your response. I really appreciate it. 

First, I am sorry for the huge blunder at a(9.) Sometimes I automatically exclude n+1. 
I used the word "all" so that we include the all the distinct digits of n+1 And n+2. Otherwise, we could use only the digits of n+1 (and that would be just the natural numbers.) For example, for n=34, the digits of a(n) should include 3,5, and 6. We can repeat any digit as many times as we like.
For a(18)=1122229, we can argue that there is a digit 0 at the far left of the number. However, if we insist on having it "inside" the number then a(18)=10122229.
What I meant in my question was to have an analytical way to find the terms of the sequence. For example, between n=x and n=y the values of a(n) could be found by the function f(x,y.)  

I guess an obvious question about this sequence is: Can we prove that this sequence has values for all natural numbers?
Best,
Ali



    On Sunday, November 10, 2019, 10:57:45 AM EST, M. F. Hasler <oeis at hasler.fr> wrote:  
 
 On Sun, Nov 10, 2019 at 2:54 AM Ali Sada wrote:

> a(n)=m+1, where m is the least multiple of n such that a(n) digits consist
> only of all the distinct digits of n+1 and n+2.
>

It depends what you call "better" and what you call "trial and error".
You can indeed write a program the avoids testing "all" multiples.
For example, if the first digit is not in the allowed set, you can skip
increasingly many multiples.

There are certainly "even more intelligent" (lol) approaches.
But most probably the programs get much longer. I think that testing
leading digits and skipping contiguous ranges where a given digit excludes
success will maybe a good length/efficiency compromise.

For example, 209 is the least multiple of 19 where m (209+1=210) consists
> only of the distinct digits of 20 and 21.

23, 43, 445,65, 76, 787, 988, 1009, 1111111111, 21, 1321, 11413, 4551, 561,
> 11176, 8817, 9181,1122229, 210, 221, 232, 243, 254, 265, 276, 287, 298,
> 22093, 1103, 3211, 32, 34433,3334


I get different values.
I notice that you say "only all the digits of n+1 and n+2",
but on one hand, 445 has twice the digit of 4, idem for 1009,
so I am not sure whether you really don't want to allow a(9) = 10 = 9+1
which has all and only digits of 10 and 11 -- or maybe that would be OK ?
Also, your a(18) does not contain the 0 of 20, several other following
values are smaller than yours:

apply(
{a(n,d=eval(Set(Vec(Str(n+1,n+2)))))=forstep(m=n,oo,n,Set(digits(m+1))==d&&return(m+1))},
[1..20])
% = [23, 43, 445, 65, 76, 787, 988, 1009, 10, 21, 1123, 11341, 1145, 561,
11176, 817, 9181, 10122229, 210, 21]

For a(9) and a(20), I'm not sure whether you mean "multiple of n larger
than n":
If so, "m=n" must be replaced by "m=2*n" in my code which then gives
a(9) = 100 = 9*11 + 1 (still much smaller than 11...11), and
a(20) = 121 = 20*6 + 1, having only and all digits of 21 and 22, but
also smaller than your 221.

- Maximilian

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



More information about the SeqFan mailing list