Pseudo-deterministic number generator Task

Write a function/full program that will be able to produce two different sequences of integers in [0, ..., 9]. You will take an input seed to decide whether to output your specific sequence or the common one. For that matter, you must choose one non-negative integer, let us call it k. When the input seed is equal to k, you will be dealing with your specific sequence s; when the input seed is anything else, you will be dealing with your common sequence c.

Both sequences should be such that the relative frequencies with which each digit appears tend to \$10\%\$. Be prepared to prove this if needed. Said another way, the running fraction of that digit's appearances needs to have a defined limit that equals \$0.1\$. Formally, this means that for every \$d \in \{0,...,9\}\$,

$$\lim_{n\rightarrow \infty}\dfrac{\left|\{i : i \in \{1\dots n\}, s_i=d\}\right|}{n} = 0.1$$

Adapted from What an Odd Function

There should be one extra restriction your sequences should satisfy: when zipped together* to form a sequence a of terms in [0, ..., 99], the relative frequency of each number should converge to 0.01 via a limit like the formula above.

*That is, the \$n\$th term of the sequence a is the two-digit number built this way: the digit in the tens place is the \$n\$th term of the sequence c and the digit in the units place is the \$n\$th term of the sequence s.

Input

A non-negative integer representing the "seed", which you use to decide whether to output the common sequence or the specific one.

Output

Your output may be one of the following:


an infinite stream with the sequence (and you take no additional input);
output the nth term of the sequence (by taking an additional input n that is 0- or 1-indexed);
output the first n terms of the sequence (by taking an additional positive input n).


Example pseudo-algorithm

Assuming I have defined seed as an integer, and for these choices I made for s and c:

input_seed ← input()
n ← input()
if input_seed = seed: print (n mod 10) # this is my sequence s
else: print ((integer div of n by 10) mod 10) # this is my sequence c


Both sequences output numbers in [0, ..., 9] and the frequency with which each digit appears tends to 0.1 as n → infinity. Similarly, zipping c and s together gives n mod 100 so it is also true that as n → infinity we have that the relative frequency with which each number in [0, ..., 99] shows up goes to 0.01.
Python 2, 23 22 bytes

Thanks @xnor for figuring out a really cool way to convert the seed to -1 or -2, which saved 1 byte.


lambda s,n:`n+9`[2/~s]


Try it online!

Input: The seed s (non-negative) and an index n (positive).
Output: The element at the nth index (the sequence is one-indexed)

If the seed is positive, the sequence is 0123456789 repeated infinitely.
If the seed is 0, the sequence is: 1111111111 2222222222 ... 9999999999 0000000000 (where each digit repeats 10 times) repeated infinitely.

How


`n+9` creates a string from a number that has at least 2 digits.
2/~s evaluates to -2 if s is 0, or -1 if s is positive
Thus `n+9`[2/~s] takes the last digit (unit digit) of \$n+9\$ if s is positive, or the second to last digit (ten digit) if s is 0.