Finding a formula for a sequence with recurring digits

  • Thread starter Thread starter spiritzavior
  • Start date Start date
  • Tags Tags
    Formula Sequence
spiritzavior
Messages
10
Reaction score
0
how do i determine the formula for the sequence below?

1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4,4,4,4,...,n,n,n,n,n,...,n,...

need some instructions. thanks in advance
 
Physics news on Phys.org
Ok, there are subsequences of equal entries (increasing by one) in a row, and the numbers of equal entries in each of them form the following sequence:

2, 4, 5, 8, ...

I can't see any regularity. Sorry.
 
I can't see a pattern here: you have two 1s, four 2s, five 3s and eight 4s. Can you confirm that you've written it out correctly?
 
spiritzavior said:
how do i determine the formula for the sequence below?

1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4,4,4,4,...,n,n,n,n,n,...,n,...

need some instructions. thanks in advance
Seems like one too many 2's with n-1 repeated F(n+1) times for n = 2,3,4,5,... .
 
Last edited:
haruspex said:
I can't see a pattern here: you have two 1s, four 2s, five 3s and eight 4s. Can you confirm that you've written it out correctly?

sorry, I've typed it incorrectly, it should be:

1,1,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,...

two 1s, four 2s, six 3s, eight 4s,...
 
If you don't mind the use of [] (integer part of) it's [1/2 +√(n-3/4)]
 
So, there are 2 n n's. The total number of elements no smaller than n is:
<br /> \sum_{k = 1}^{n}{2 k} = n(n + 1)<br />

Thus, all the elements with an index k that satisfies:
<br /> (n - 1) n &lt; k \le n (n + 1)<br />
are equal to x_k = n (why?). Can you find n, given k from the above inequalities?
<br /> n^2 + n - k \ge 0 \Rightarrow n \ge -\frac{1}{2} + \sqrt{k + \frac{1}{4}}<br />
<br /> n^2 - n - k &lt; 0 \Rightarrow n &lt; \frac{1}{2} + \sqrt{k + \frac{1}{4}}<br />

If you know the [STRIKE]floor[/STRIKE] floor function, which is the same as integer part for positive integers, you should be able to deduce:
<br /> x_k = \mathrm{Ceiling} \left[ \sqrt{k + \frac{1}{4}} - \frac{1}{2}\right]<br />
 
Last edited:
a(n) = round(\sqrt{n}) seems to work, not that I could prove it.

This is where a(1) is the first entry in the sequence.
 
acabus said:
a(n) = round(\sqrt{n}) seems to work, not that I could prove it.

This is where a(1) is the first entry in the sequence.

Good intuition abacus...

A000194 n appears 2n times; also nearest integer to square root of n
http://oeis.org/A000194

If one desires that digits are repeated 2n - 1 times, that's an easy one: floor [sqrt n]
 
  • #10
The definition of ceiling and round functions is:
<br /> \mathrm{Ceiling}(x) \equiv n, \ n \le x &lt; n + 1<br />
<br /> \mathrm{Round}(x) \equiv m, \ \vert x - m \vert &lt; 1/2<br />
(the last definition is ambiguous if the argument is half-integer, but there can never happen for acabus's argument)

We want to know for what x, and y, \mathrm{Ceiling}(x) \stackrel{?}{=} \mathrm{Round}(y) = n. From the above definitions, this happens when:
<br /> n \le x &lt; n + 1, \ n - 1/2 &lt; y &lt; n + 1/2<br />
or, if we rewrite these inequalities for n, we get:
<br /> x - 1 &lt; n \le x, \ y - 1/2 &lt; n &lt; y + 1/2<br />
Then, a necessary and sufficient (why?) condition is:
<br /> x - 1 &lt; y + 1/2, \ y - 1/2 &lt; x<br />

In our case, x = \sqrt{k + 1/4} - 1/2, and y= \sqrt{k}, so we have:
<br /> \sqrt{k + 1/4} - 1/2 - 1 &lt; \sqrt{k} + 1/2 \Leftrightarrow \sqrt{k + 1/4} - \sqrt{k} &lt; 2<br />
<br /> \sqrt{k} - 1/2 &lt; \sqrt{k + 1/4} - 1/2 \Leftrightarrow \sqrt{k + 1/4} - \sqrt{k} &gt; 0<br />
The second inequality is surely true, but the first is proven as follows:
<br /> \begin{array}{l}<br /> \sqrt{k + 1/4} - \sqrt{k} \stackrel{?}{&lt;} 2 \\<br /> <br /> 0 &lt; \sqrt{k + 1/4} \stackrel{?}{&lt;} \sqrt{k} + 2 \\<br /> <br /> k + 1/4 \stackrel{?}{&lt;} k + 4 \sqrt{k} + 4 \\<br /> <br /> 0 \stackrel{\surd}{&lt;} \sqrt{k} + 15/16<br /> \end{array}<br />
This is surely true. Therefore, both the formulas give the same output for all positive integers.
 
  • #11
Thanks all for your responses.
 
Back
Top