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.

A340619 n appears A006519(n) times.

This page as a plain text file.
%I A340619 #48 Jan 24 2021 05:53:36
%S A340619 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,
%T A340619 14,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,18,18,19,20,
%U A340619 20,20,20,21,22,22,23,24,24,24,24,24,24,24,24,25,26,26
%N A340619 n appears A006519(n) times.
%C A340619 This sequence has similarities with the Cantor staircase function.
%C A340619 This sequence can be seen as an irregular table where the n-th row contains A006519(n) times the value n.
%C A340619 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:
%C A340619       a(n)
%C A340619        ^
%C A340619        |           *
%C A340619        |         **
%C A340619        |        *
%C A340619        |    ****
%C A340619        |   *
%C A340619        | **
%C A340619        |*
%C A340619        +-------------> n
%H A340619 Rémy Sigrist, <a href="/A340619/b340619.txt">Table of n, a(n) for n = 1..11264</a>
%H A340619 Wikipedia, <a href="https://en.wikipedia.org/wiki/Cantor_function">Cantor function</a>
%F A340619 a(A006520(n)) = n.
%F A340619 a(A006520(n)+1) = n+1.
%F A340619 a(n) + a(A006520(2^k-1) + 1 - n) = 2^k for any k > 0 and n = 1..A006520(2^k-1).
%F A340619 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
%e A340619 The first rows, alongside A006519(n), are:
%e A340619     n | n-th row               | A006519(n)
%e A340619    ---+------------------------+-----------
%e A340619     1 | 1                      |          1
%e A340619     2 | 2, 2                   |          2
%e A340619     3 | 3                      |          1
%e A340619     4 | 4, 4, 4, 4             |          4
%e A340619     5 | 5                      |          1
%e A340619     6 | 6, 6                   |          2
%e A340619     7 | 7                      |          1
%e A340619     8 | 8, 8, 8, 8, 8, 8, 8, 8 |          8
%e A340619     9 | 9                      |          1
%e A340619    10 | 10, 10                 |          2
%t A340619 A340619[n_] := Array[n &, Table[BitAnd[BitNot[i - 1], i], {i, 1, n}][[n]]];
%t A340619 Table[A340619[n], {n, 1, 26}] // Flatten (* _Robert P. P. McKone_, Jan 19 2021 *)
%o A340619 (PARI) concat(apply(v -> vector(2^valuation(v,2), k, v), [1..26]))
%o A340619 (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
%Y A340619 See A061392 and A340500 for similar sequences.
%Y A340619 Cf. A006519, A006520, A046699.
%K A340619 nonn,easy,tabf
%O A340619 1,2
%A A340619 _Rémy Sigrist_, Jan 13 2021