login
A340619
n appears A006519(n) times.
1
1, 2, 2, 3, 4, 4, 4, 4, 5, 6, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 10, 11, 12, 12, 12, 12, 13, 14, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 18, 19, 20, 20, 20, 20, 21, 22, 22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 26, 26
OFFSET
1,2
COMMENTS
This sequence has similarities with the Cantor staircase function.
This sequence can be seen as an irregular table where the n-th row contains A006519(n) times the value n.
For any k > 1, the set of points { (n, a(n)), n = 1..A006520(2^k-1) } is symmetric; for example, for k = 3, we have the following configuration:
a(n)
^
| *
| **
| *
| ****
| *
| **
|*
+-------------> n
LINKS
FORMULA
a(A006520(n)) = n.
a(A006520(n)+1) = n+1.
a(n) + a(A006520(2^k-1) + 1 - n) = 2^k for any k > 0 and n = 1..A006520(2^k-1).
a(n) = 2^k + (a(r) if r>0), where k such that k*2^(k-1) < n <= (k+1)*2^k and r = n - (k+2)*2^(k-1). - Kevin Ryde, Jan 18 2021
EXAMPLE
The first rows, alongside A006519(n), are:
n | n-th row | A006519(n)
---+------------------------+-----------
1 | 1 | 1
2 | 2, 2 | 2
3 | 3 | 1
4 | 4, 4, 4, 4 | 4
5 | 5 | 1
6 | 6, 6 | 2
7 | 7 | 1
8 | 8, 8, 8, 8, 8, 8, 8, 8 | 8
9 | 9 | 1
10 | 10, 10 | 2
MATHEMATICA
A340619[n_] := Array[n &, Table[BitAnd[BitNot[i - 1], i], {i, 1, n}][[n]]];
Table[A340619[n], {n, 1, 26}] // Flatten (* Robert P. P. McKone, Jan 19 2021 *)
PROG
(PARI) concat(apply(v -> vector(2^valuation(v, 2), k, v), [1..26]))
(PARI) a(n) = my(ret=0); forstep(k=logint(n, 2), 0, -1, if(n > k<<(k-1), ret+=1<<k; n-=(k+2)<<(k-1))); ret; \\ Kevin Ryde, Jan 18 2021
CROSSREFS
See A061392 and A340500 for similar sequences.
Sequence in context: A087180 A029121 A161205 * A334800 A228942 A164531
KEYWORD
nonn,easy,tabf
AUTHOR
Rémy Sigrist, Jan 13 2021
STATUS
approved