Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 4500 articles have referenced us, often saying "we would not have discovered this result without the OEIS".
A125097
a(n) is k such that k*(2n+1) mod 1000 = 123, or 2n+1 if no such k exists.