A341817 If a(n) is odd, add to a(n) its odd digits and iterate; if a(n) is even, add to a(n) its even digits and iterate; if an iteration reproduces a term already in the sequence, don't do this iteration and extend the sequence with the smallest integer not yet present in the sequence.
1, 2, 4, 8, 16, 22, 26, 34, 38, 46, 56, 62, 70, 3, 6, 12, 14, 18, 5, 10, 7, 9, 11, 13, 17, 25, 30, 15, 21, 19, 29, 20, 23, 24, 27, 28, 31, 35, 43, 32, 33, 39, 51, 57, 69, 78, 86, 100, 36, 42, 48, 60, 66, 37, 47, 54, 58, 40, 44, 52, 41, 45, 50, 49, 53, 61, 55, 65, 59, 73, 83, 63, 64, 74, 67, 68, 82, 92
Offset: 1
Examples
a(1) = 1, odd, a(2) is thus 1 + 1 = 2; a(2) = 2, even, thus a(3) = 2 + 2 = 4; a(3) = 4, even, thus a(4) = 4 + 4 = 8; a(4) = 8, even, thus a(5) = 8 + 8 = 16; a(5) = 16, even, thus a(6) = 16 + 6 = 22; a(6) = 22, even, thus a(7) = 22 + 2 + 2 = 26; ... a(13) = 70, even, thus a(14) = 70 + 0 = 70 (already in the sequence, thus a(14) = 3 instead, the smallest integer not yet present in the sequence); a(14) = 3, odd, thus a(15) = 3 + 3 = 6; a(15) = 6, even, thus a(16) = 6 + 6 = 12; a(16) = 12, even, thus a(17) = 12 + 2 = 14; a(17) = 14, even, thus a(18) = 14 + 4 = 18; a(18) = 18, even, thus a(19) = 18 + 6 = 26 (already in the sequence, thus a(19) = 5 instead, the smallest integer not yet present in the sequence); a(19) = 5, odd, thus a(20) = 5 + 5 = 10; etc.
Links
- Carole Dubois, Table of n, a(n) for n = 1..5000
Crossrefs
Cf. A004207 (sum of digits of all previous terms).
Comments