Re: Finding the position of the number
- From: David Hartley <me9@xxxxxxxxxxx>
- Date: Wed, 31 May 2006 02:23:03 +0100
In message <40ip72pnqb8mlvciufk57ujhm22ahv1vgr@xxxxxxx>, quasi <quasi@xxxxxxxx> writes
On Tue, 30 May 2006 23:22:39 +0100, David Hartley <me9@xxxxxxxxxxx>
wrote:
In message <ot9p729cj2s094908cqj6cu04qajj9np19@xxxxxxx>, quasi
<quasi@xxxxxxxx> writes
...
However for the _specific_ infinite string given above:
12345678910111213...
it's a reasonable to ask if there are formulas for
f(s) = the first location of a given substring s
c(s) = the canonical location of a given substring s
Thus, for example:
f(12)=2
Correction: f(12)=1
c(12)=14
If not a formula, then at least a procedure which is faster than brute
force search.
quasi
As a followup, here's a simple question ...
For the string 12345678910111213... and the functions f(s) and c(s)
specified above, characterize those substrings s for which f(s) =
c(s).
Note that c(s) is only defined if s has no leading zero digits,
whereas f(s) is defined for any digit string s.
Thus, a necessary condition for f(s) = c(s) is that s has no leading
zero digits. Clearly, this condition is not sufficient. For example
f(12) = 1 whereas c(12)=14.
There are lots of easy examples where it's obvious that f(s) = c(s).
For example, it's immediate that f(999) = c(999).
No it's not. f(999) = c(899) + 1
Ha. I missed that. You're right.
However, I think it's true (but I'm not sure) that the set of positive
integers n such that f(s) = c(s) is a set with density 1.
I haven't worked it out fully, but I think the number of k-digit numbers with this property is O(k^10). Since there are 9*10^(k-1) k-digit numbers, the proportion tends to 0 as k tends to oo.
--
David Hartley
.
- Follow-Ups:
- Re: Finding the position of the number
- From: quasi
- Re: Finding the position of the number
- References:
- Finding the position of the number
- From: Atrus
- Re: Finding the position of the number
- From: Pubkeybreaker
- Re: Finding the position of the number
- From: quasi
- Re: Finding the position of the number
- From: quasi
- Re: Finding the position of the number
- From: David Hartley
- Re: Finding the position of the number
- From: quasi
- Finding the position of the number
- Prev by Date: Re: Code to Compute Exponential Least Squares Fit?
- Next by Date: Re: Finding the position of the number
- Previous by thread: Re: Finding the position of the number
- Next by thread: Re: Finding the position of the number
- Index(es):
Relevant Pages
|