What is the nth house number if house numbers cannot end in 3 or 4? Newer Taiwan house numbers cannot end in 4. In order to not have one side of the
street grow faster than the other, we must also throw away those ending in  e.g., 3.

Is there a algebraic function f(n) that would give

  n   f(n)
-------------
  1   1
  2   2
  3   5
  4   6
  5   7
  6   8
  7   9
  8  10
  9  11
 10  12
 11  15


or is the only way to determine what number we should give a given nth
house is to run through the whole list up to n? (perl:)

my $t;
for ( 1 .. $ARGV[0] ) {
    $t += 2 if ++$t % 10 == 3;
}
printf "%3d %3d\n", $_, $t for $ARGV[0];


(Perhaps actually a plot to reserve numbers for invading Martian's pillboxes?!)

One might think this sounds like octal numbers, but alas we are only talking about the final digit here.
Perhaps you can use the relationship $h(n+8)=h(n)+10$ where $h(n)$ denotes the house number of the $n$-th house.  This then generalizes to $h(n+8k)=h(n)+10k$.

So for example, $h(79)=h(7+8\cdot 9)=h(7)+10\cdot 9=9+90=99$.
You should use this function:

$$f(n) = \begin{cases} n + 2 + 2 \lfloor \frac { n - 3} 8 \rfloor, &amp; n \ge 3 \\
n, &amp; 0&lt;n&lt;3 \end{cases} .$$