[Related](https://codegolf.stackexchange.com/questions/126172/create-a-binary-ruler), [related](https://codegolf.stackexchange.com/questions/71833/how-even-is-a-number)

Introduction
============

The [ruler sequence](https://oeis.org/A001511) is the sequence of the largest possible numbers \$a\_n\$ such that \$2^{a\_n}\mid n\$. It is so-called because its pin plot looks similar to a ruler's markings:

![Pin plot of ruler sequence](https://oeis.org/A001511/graph?png=1)

However, with a slight modification, we can also get a similar sequence. This sequence is \$\{a\_1,a\_2,a\_3,…\}\$ where \$a\_n\$ is the largest **power of 2** such that \$a\_n\mid n\$ ([relevant OEIS](http://oeis.org/A006519)).

The first 100 terms of this sequence are:

```
1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 16, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 32, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 16, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 64, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 16, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 32, 1, 2, 1, 4

```

Challenge
=========

Your challenge is to do one of these three things:

* Take a positive integer \$n\$ as input and return the \$n\$th term of this sequence.
* Take a positive integer \$n\$ as input and return the first \$n\$ terms of this sequence.
* Output the sequence infinitely.

Test Cases
==========

```
12 -> 4
64 -> 64
93 -> 1
8 -> 8
0 -> (undefined behavior)

```

Rules
=====

* You may output the sequence in any convenient format - e.g. as a list or some other iterable or separated by any non-digit separator, as long as it is constant between all terms.
* You may output the term(s) in any convenient format - e.g. as an integer, as an integer string, as a float with the decimal part consisting of only zeros, ditto but as a string, or as a Boolean (`True`) if and only if the term is `1`.
* You may choose to use either zero- or one-indexing.
* [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* Trailing whitespace is allowed.
* If possible, please link to an online interpreter (e.g. [TIO](https://tio.run)) to run your program on.
* Please explain your answer. This is not necessary, but it makes it easier for others to understand.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code in bytes wins!