# PHP, <s>47</s> 41 bytes inspired by [Xanderhall](https://codegolf.stackexchange.com/a/98462#98462), but the latest idea finally justifies an own answer. <!-- language: lang-php --> while(strstr($n+=$n=&$argn%3,51));echo$n; or <!-- language: lang-php --> while(strpbrk($n+=$n=&$argn%3,3));echo$n; This takes advantage from the fact that the input is also from the sequence: For `$n%3==1`, the new modulo is `2`. For `$n%3==2`, the new modulo is `4-3=1`. `$n%3==0` never happens. Run as pipe with `-R` or [try them online](http://sandbox.onlinephpfunctions.com/code/c94a70661b4b1a7f28d583f01ce72ecc287cafe4).