login
A305410
a(1) = 1, and for any n > 0, a(2*n) = a(n) + k(n) and a(2*n+1) = a(n) + 2 * k(n) where k(n) is the least positive integer not leading to a duplicate term.
4
1, 2, 3, 4, 6, 5, 7, 8, 12, 10, 14, 9, 13, 11, 15, 16, 24, 17, 22, 18, 26, 21, 28, 19, 29, 20, 27, 23, 35, 30, 45, 25, 34, 31, 38, 32, 47, 33, 44, 36, 54, 37, 48, 39, 57, 40, 52, 41, 63, 42, 55, 43, 66, 46, 65, 49, 75, 51, 67, 50, 70, 53, 61, 56, 87, 58, 82
OFFSET
1,2
COMMENTS
Apparently, every positive integer appears in the sequence.
FORMULA
a(n) = 2*a(2*n) - a(2*n + 1).
EXAMPLE
The first terms, alongside k(n) and associate children, are:
n a(n) k(n) a(2*n) a(2*n+1)
-- ---- ---- ------ --------
1 1 1 2 3
2 2 2 4 6
3 3 2 5 7
4 4 4 8 12
5 6 4 10 14
6 5 4 9 13
7 7 4 11 15
8 8 8 16 24
9 12 5 17 22
10 10 8 18 26
PROG
(PARI) lista(nn) = my (a=[1], s=2^a[1]); for (n=1, ceil(nn/2), for (k=1, oo, if (!bittest(s, a[n]+k) && !bittest(s, a[n]+2*k), a=concat(a, [a[n]+k
, a[n]+2*k]); s+=2^(a[n]+k) + 2^(a[n]+2*k); break))); a[1..nn]
CROSSREFS
This sequence is a variant of A322510.
Sequence in context: A306869 A139708 A333776 * A059893 A331274 A269365
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Dec 16 2018
EXTENSIONS
Name corrected by Rémy Sigrist, Apr 26 2020
STATUS
approved