Olympic Rings Sequence

Retina, 70 68 62 bytes

.+
10**
.
$.>`
~(`.+
6*$+*
)`.(.+)
L`.{$.1}
%,-6`.

,2,9`.
*
_

Try it online!

Explanation

Let's call the input n, and we'll use 3 as an example.

.+
10**

The 10** is short for 10*$&*_ which replaces the input with a string of 10n underscores.

.
$.>`

Now we replace each underscore with the length of the string up to and including that underscore. So this just results in the number from 1 to 10n all concatenated together (10n is always enough to fill up two lines of the required length).

~(`.+
6*$+*

Eval! This and the next stage will generate the source code of another program, which is then run against that string of concatenated integers.

To generate that program, this stage first replaces the integers with a string of 6n underscores ($+ refers to the program's original input).

)`.(.+)
L`.{$.1}

Then replace those underscores with L`.{…}, where is 6n-1 (the length of the lines we're looking at). So we've generated a regex, whose quantifier depends on the original input.

When this program gets eval'ed it matches chunks of length 6n-1, of which there will be at least two. For our example input 3, we end up with:

12345678910111213
14151617181920212
22324252627282930

Now we just need to extract the relevant digits.

%,-6`.

First, on each line (%) we remove all but the last five digits (,-6). That gives us

11213
20212
82930

Finally:

,2,9`.
*

We expand every other digit (2) in the first ten (9, this is 0-based) in unary. Those happen to be those in the Olympic Rings positions.

_

And we count the number of resulting underscores, to sum them and convert the result to decimal.


Husk, 16 bytes

ΣĊ2ṁ↑_5↑2CṁdN←*6

Try it online!

-3 bytes thanks to H.PWiz.

(Rushed) explanation:

ΣĊ2ṁ↑_5↑2CṁdN←*6⁰
Σ                 Sum
 Ċ2                Drop every second element
   ṁ↑_5             Map "take last 5 elements", then concatenate
       ↑2            Take first 2 elements
         C            Cut x into sublists of length y
          ṁdN          [1,2,3,4,5,6,7,8,9,1,0,1,1,1,2,1,3,...] (x)
             ←         Decrement (y)
              *6        Multiply with 6
                ⁰        First argument

Japt, 33 32 30 29 28 27 bytes

Oh, this is not pretty!

Outputs the nth term, 1-indexed.

*6É
*2 õ ¬òU mt5n)¬¬ë2 ¯5 x

Try it


Explanation

                         :Implicit input of integer U           :e.g., 3
*6É    
*6                       :Input times 6                         :18
  É                      :Subtract 1                            :17
   \n                    :Assign the above to variable U

*2 õ ¬òU mt5n)¬¬ë2 ¯5 x
*2 õ                     :[1,U*2]                               :[1,2,3,...,33,34]
     ¬                   :Join to a string                      :"123...3334"
      òU                 :Partitions of length U                :["123...13","1415...212","22324...30","31323334"]
         m               :Map
          t5n)           :  Get last 5 characters               :["11213","20212","82930","23334"]
              ¬          :Join to a string                      :"11213202128293023334"
               ¬         :Split to an array                     :["1","1","2","1","3","2","0","2","1","2","8","2","9","3","0"],["2","3","3","3","4"]]
                ë2       :Get every second element              :["1","2","3","0","1","8","9","0","3","3"]
                   ¯5    :Get first 5 elements                  :["1","2","3","0","1"]
                      x  :Reduce by addition                    :7
                         :Implicit output of result