cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A329249 Starting from n: as long as the decimal representation starts with an odd number, multiply the largest such prefix by 2; a(n) corresponds to the final value.

Original entry on oeis.org

0, 2, 2, 6, 4, 20, 6, 24, 8, 28, 20, 22, 22, 26, 24, 60, 26, 64, 28, 68, 20, 42, 22, 46, 24, 200, 26, 204, 28, 208, 60, 62, 62, 66, 64, 240, 66, 244, 68, 248, 40, 82, 42, 86, 44, 280, 46, 284, 48, 288, 200, 202, 202, 206, 204, 220, 206, 224, 208, 228, 60, 222
Offset: 0

Views

Author

Rémy Sigrist, Nov 30 2019

Keywords

Comments

As long as we have a number whose decimal representation is the concatenation of odd number, say u, and a possibly empty string of even digits allowing leading zeros, say v, we replace this number with the concatenation of u*2 and v; eventually only even digits remain.

Examples

			For n = 127:
- 127 gives 127*2 = 254,
- 254 gives 25*2 followed by 4 = 504,
- 504 gives 5*2 followed by 04 = 1004,
- 1004 gives 1*2 followed by 004 = 2004,
- 2004 has only even digits, so a(127) = 2004.
		

Crossrefs

See A327539 for similar sequences.
Cf. A014263.

Programs

Formula

a(n) >= n with equality iff n belongs to A014263.
a(2*n+1) = a(4*n+2).
a(10*k + v) = 10*a(k) + v for any k >= 0 and v in {0, 2, 4, 6, 8}.
a(5^k) = 2*10^k for any k >= 0 (the ratio a(n)/n is unbounded).