# How Can I Reform This Sequence?

One of my friend asked me for help with this floorly sequence, but I also can't figured out for the solution what he wants. There is the sequence formed with four floor function which looks very unusual. I asked him for the sequence's meaning but he'll divulge it later when I found the solution. Without more preamble, he asked me to reform below two variable sequence to one variable sequence and also listed by value's size. $$\phi _{k,n}=8+3\left \lfloor \frac{n}{2} \right \rfloor+7\left \lfloor \frac{n-1}{2} \right \rfloor+(2n+1)\left \lfloor \frac{k}{2} \right \rfloor+\left \{ 4n+2-(-1)^n \right \}\left \lfloor \frac{k-1}{2} \right \rfloor$$ some values of the sequence are

$\phi _{k,1}=\left \{ 8, 11, 18, 21, 28, 31, \cdots \right \}$

$\phi _{k,2}=\left \{ 11, 16, 25, 30, 39, 44, \cdots \right \}$

$\phi _{k,3}=\left \{ 18, 25, 40, 47, 62, 69, \cdots \right \}$

$\phi _{k,4}=\left \{ 21, 30, 47, 56, 73, 82, \cdots \right \}$

$\phi _{k,5}=\left \{ 28, 39, 62, 73, 96, 107, \cdots \right \}$

$\phi _{k,6}=\left \{ 31, 44, 69, 82, 107, 120, \cdots \right \}$

and reformed sequence's values should be

$\Phi _{n}=\left \{ 8, 11, 16, 18, 21, 25, 28, 30, 31, \cdots \right \}$

On $\phi _{k,n}$, I tried to find the pattern of $k,n$ which correspondence with $\Phi _{n}$'s value, but I can't figured out it and I doubt there is general term of $k,n$ for my idea. More precisely, let $\alpha_m$ be the sequence of $\phi _{k,n}$'s $k$, and $\beta_m$ be the sequence of $\phi _{k,n}$'s $n$ which correspondence with $\Phi_n$'s value. If there is the general term of $\alpha_m$ and $\beta_m$, $\Phi_{m}$'s general term will be the formula below. $$\Phi_{m}=8+3\left \lfloor \frac{\beta_m}{2} \right \rfloor+7\left \lfloor \frac{\beta_m-1}{2} \right \rfloor+(2\beta_m+1)\left \lfloor \frac{\alpha_m}{2} \right \rfloor+\left \{ 4\beta_m+2-(-1)^{\beta_{m}} \right \}\left \lfloor \frac{\alpha_m-1}{2} \right \rfloor$$ But as you know, I can't get the general term of $\alpha_m$ and $\beta_m$. I need your help..also the solution.. Any new Idea and hint will be appreciated.

-
You might try splitting into four cases on whether $n$ is even or odd and whether $k$ is even or odd - that allows you to get rid of the floor functions and the $(-1)^n$ and maybe you'll be able to see what's going on in the formula. –  Gerry Myerson Oct 20 '11 at 11:48
@Gerry Myerson: for $n$, odd is $10n-2+(4n-1)\left \lfloor \frac{k}{2} \right \rfloor+(8n-1)\left \lfloor \frac{k-1}{2} \right \rfloor$ and even is $10n+1+(4n+1)\left \lfloor \frac{k}{2} \right \rfloor+(8n+1)\left \lfloor \frac{k-1}{2} \right \rfloor$. –  4545454545SI Oct 20 '11 at 12:39
Gerry meant you to split both of those by whether $k$ is odd or even. So odd $n$, odd $k$ is $2n-1+6nk-k$ –  Ross Millikan Oct 20 '11 at 12:58
I note that $\phi_{k,n}=\phi_{n,k}$, which is not obvious from the definition. –  Ross Millikan Oct 20 '11 at 12:59
Yes, I get $4n-1+6nk-k$ if $n,k$ are both odd. –  Ross Millikan Oct 20 '11 at 13:18

You can simplify the sequence in the following way, but I am not sure what kind of expression your are seeking:

\begin{align}\phi _{k,n}&=8+3(n-1)+4\left \lfloor \frac{n-1}{2} \right \rfloor+(2n+1)(k-1) + ( 4n+2-(-1)^n -2n-1)\left \lfloor \frac{k-1}{2} \right \rfloor\\ &= 5+3n+4\left \lfloor \frac{n-1}{2} \right \rfloor+(2n-2)(k-1)+3(k-1) + 4\left \lfloor \frac{k-1}{2} \right \rfloor+( 2n-3-(-1)^n)\left \lfloor \frac{k-1}{2} \right \rfloor\\ &= 2+3n+3k+4\left \lfloor \frac{n-1}{2} \right \rfloor+2(n-1)(k-1) +4\left \lfloor \frac{k-1}{2} \right \rfloor+4\left \lfloor \frac{n-1}{2} \right\rfloor \left \lfloor \frac{k-1}{2} \right \rfloor\\ &= n+k+2nk+4\left \lfloor \frac{n+1}{2} \right\rfloor \left \lfloor \frac{k+1}{2} \right \rfloor \end{align}

-
What’s wanted is apparently a function $\Phi:\mathbb{Z}^+\to\mathbb{Z}^+$ that enumerates $\bigcup\limits_{k,n}\operatorname{ran}\phi_{k,n}$. –  Brian M. Scott Oct 20 '11 at 23:47

Building on Brian M. Scott's answer, we can further rearrange the set of sequences as follows: \begin{align*} a_{ij} &= 2(6ij + i + j) \\ b_{ij} &= 2(6ij - i - j) \\ c_{ij} &= 2(6ij + i - j) -1 \end{align*} where $i,j = 1,2,3,\ldots$. The first sequence results from $n, k$ both even, the second from $n, k$ both odd, and the last when $n, k$ have opposite parity; we obtain these by substituting $n=2i$ (resp. $n=2i-1$) when $n$ is even (resp. odd).

Poking around in OEIS, we find that $a_{ij}$ corresponds to 2*A070043 and $b_{ij}$ corresponds to 2*A070799. Together, they combine to form 2*A046954, twice the sequence of numbers $n$ such that $6n+1$ is composite. These correspond to the even elements of $\Phi_i$.

The OEIS entry is a little less fleshed out, but it looks like $c_{ij}$ corresponds to 2*A046953-1, one less than twice the sequence of numbers $n$ such that $6n-1$ is composite. These correspond to the odd elements of $\Phi_i$.

I'm not sure how to combine these into a single sequence nor what it might signify. I will observe that OEIS does not list a closed (single-variable) form of any of the sequences I've linked to.

-

It's closed form must be exists. We know ϕk,n's closed form. and I think, Φn should be log increasing. Just intuition.

It is linearly increasing not log increasing. It follows from your definition that $\Phi_{i+1}$ is at least 1 more than $\Phi_{i}$. And $\phi(k, 1)$ consists of exactly the positive integers $\ge 8$ congruent to $1$ or $8$ modulo $10$. Therefore $\Phi_{i+1} - \Phi_{i}$ is in {1,...,7} for every $i$ so the function is bounded between a line with slope $1$ and a line with slope $7$.

It could be more interesting to ask questions like whether there exists $M, c$ such that $M \lt i$ implies $\Phi_i = i + c$.

-
@ks the gap never goes below 1 –  Unknown Oct 22 '11 at 9:56
I know. What about the random gap 112112231121611232? –  4545454545SI Oct 22 '11 at 10:04
@ks if those are the gaps then the function is mostly linear –  Unknown Oct 22 '11 at 10:08

This is not an answer, but it may save someone some trouble:

\begin{align*} \phi _{k,n}&=8+3\left \lfloor \frac{n}{2} \right \rfloor+7\left \lfloor \frac{n-1}{2} \right \rfloor+(2n+1)\left \lfloor \frac{k}{2} \right \rfloor+\left \{ 4n+2-(-1)^n \right \}\left \lfloor \frac{k-1}{2} \right \rfloor\\\\ &=\begin{cases} n+(3n+1)k,&k,n\text{ even}\\ n+(3n+2)k,&k\text{ even, }n\text{ odd}\\ 2n+(3n+1)k,&k\text{ odd, }n\text{ even}\\ 1+2n+(3n+2)k,&k,n\text{ odd} \end{cases}\\\\\\ &=n+k+3kn+\begin{cases} 0,&k,n\text{ even}\\ k,&k\text{ even, }n\text{ odd}\\ n,&k\text{ odd, }n\text{ even}\\ n+k+1,&k,n\text{ odd}\\ \end{cases}\\\\\\ &=n+k+3kn+[k\text{ odd}]n+[n\text{ odd}]k+[k,n\text{ odd}]\;,\\ \end{align*} where the square brackets in the last version are Iverson brackets.

Added: A little more stray information that may perhaps be useful, though I don’t hold out much hope:

For each $n\in\mathbb{Z}^+$, $A_n = \{\phi_{k,n}:k\in\mathbb{Z}^+\}$ is the union of (the ranges of) two interlaced arithmetic progressions with the same constant difference. In particular, the members of $A_{2n-1}$ are generated by the progressions $$\langle 10n-2+(12n-2)k:k\ge 0\rangle\text{ and }\langle 14n-3+(12n-2)k:k\ge 0\rangle,$$ and those of $A_{2n}$ by $$\langle 10n+1+(12n+2)k:k\ge 0\rangle\text{ and }\langle 14n+2+(12n+2)k:k\ge 0\rangle.$$

-
Your formula for both odd disagrees with what Ross got in the comments. Someone needs to recalculate. –  Gerry Myerson Oct 21 '11 at 0:02
@Gerry: It agrees with Phira’s calculation, and a few spot checks agree with the OP’s posted values. –  Brian M. Scott Oct 21 '11 at 0:04