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.

Showing 1-3 of 3 results.

A080277 Partial sums of A038712.

Original entry on oeis.org

1, 4, 5, 12, 13, 16, 17, 32, 33, 36, 37, 44, 45, 48, 49, 80, 81, 84, 85, 92, 93, 96, 97, 112, 113, 116, 117, 124, 125, 128, 129, 192, 193, 196, 197, 204, 205, 208, 209, 224, 225, 228, 229, 236, 237, 240, 241, 272, 273, 276, 277, 284, 285, 288, 289, 304, 305, 308
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2003

Keywords

Examples

			From _Omar E. Pol_, Sep 10 2019: (Start)
Illustration of initial terms:
a(n) is also the total area (or the total number of cells) in first n regions of an infinite diagram of compositions (ordered partitions) of the positive integers, where the length of the n-th horizontal line segment is equal to A001511(n), the length of the n-th vertical line segment is equal to A006519(n), and area of the n-th region is equal to A038712(n), as shown below (first eight regions):
-----------------------------------
n  A038712(n)  a(n)       Diagram
-----------------------------------
.                         _ _ _ _
1      1         1       |_| | | |
2      3         4       |_ _| | |
3      1         5       |_|   | |
4      7        12       |_ _ _| |
5      1        13       |_| |   |
6      3        16       |_ _|   |
7      1        17       |_|     |
8     15        32       |_ _ _ _|
.
The above diagram represents the eight compositions of 4: [1,1,1,1],[2,1,1],[1,2,1],[3,1],[1,1,2],[2,2],[1,3],[4].
(End)
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n=0, 0, a(n-1)+Bits[Xor](n, n-1))
        end:
    seq(a(n), n=1..58);  # Alois P. Heinz, Feb 14 2023
  • Mathematica
    Table[BitXor[n, n-1], {n, 1, 58}] // Accumulate (* Jean-François Alcover, Oct 24 2013 *)
  • PARI
    a(n) = fromdigits(Vec(Pol(binary(n<<1))'),2); \\ Kevin Ryde, Apr 29 2021

Formula

a(n) is conjectured to be asymptotic to n*log(n)/log(2). - Klaus Brockhaus, Mar 23 2003 [See Bannister et al., 2013. - N. J. A. Sloane, Nov 26 2013]
a(n) = Sum_{k=0..log_2(n)} 2^k*floor(n/2^k).
a(2^k) = (k+1)*2^k.
a(n) = n + 2*a(floor(n/2)). - Vladeta Jovovic, Aug 06 2003
From Ralf Stephan, Sep 07 2003: (Start)
a(1) = 1, a(2*n) = 2*a(n) + 2*n, a(2*n+1) = 2*a(n) + 2*n + 1.
G.f.: 1/(1-x) * Sum(k >= 0, 2^k*t/(1-t), t = x^2^k). (End)
Product_{n >= 1} (1 + x^(n*2^(n-1))) = (1 + x)*(1 + x^4)*(1 + x^12)*(1 + x^32)*... = 1 + Sum_{n >= 1} x^a(n) = 1 + x + x^4 + x^5 + x^12 + x^13 + .... Hence this sequence lists the numbers representable as a sum of distinct elements of A001787 = [1, 4, 12, ..., n*2^(n-1), ...]. Cf. A050292. See also A120385. - Peter Bala, Feb 02 2013
n log_2 n - 2n < a(n) <= n log_2 n + n [Bannister et al., 2013] - David Eppstein, Aug 31 2013
G.f. A(x) satisfies: A(x) = 2*A(x^2)*(1 + x) + x/(1 - x)^2. - Ilya Gutkovskiy, Oct 30 2019
a(n) = A136013(2n). - Pontus von Brömssen, Sep 06 2020

A136013 a(n) = floor(n/2) + 2*a(floor(n/2)), a(0) = 0.

Original entry on oeis.org

0, 0, 1, 1, 4, 4, 5, 5, 12, 12, 13, 13, 16, 16, 17, 17, 32, 32, 33, 33, 36, 36, 37, 37, 44, 44, 45, 45, 48, 48, 49, 49, 80, 80, 81, 81, 84, 84, 85, 85, 92, 92, 93, 93, 96, 96, 97, 97, 112, 112, 113, 113, 116, 116, 117, 117, 124, 124, 125, 125, 128
Offset: 0

Views

Author

Jack Preston (jpreston(AT)earthlink.net), Mar 20 2008

Keywords

Comments

A recursive sequence that seems to be related to the ruler function.
It seems that a(2n) = a(2n+1) = A080277(n). - Emeric Deutsch, Mar 31 2008
It appears that if the binary expansion of n is n = Sum b_i*2^i (b_i=0 or 1), then a(n) = Sum i*b_i*2^(i-1). - Marc LeBrun, Sep 07 2015
The observations in the preceding two comments (by Emeric Deutsch and Marc LeBrun) follow from the formulas in A333979. - Pontus von Brömssen, Sep 06 2020
This sequence is a variant of the arithmetic derivative (A003415) based on powers of two instead of primes, because the relation a(m*n) = m*a(n) + n*a(m) holds. If we define the polynomial P(2) = bit0*2^0 + bit1*2^1 + bit2*2^2 + ... = n, and P'(2) is the derivative of P(2), then we will observe P'(2) = a(n). - Thomas Scheuerle, Aug 02 2022

Crossrefs

Cf. A080277, A003415, A333979, A135481 (first differences).

Programs

  • Maple
    a:=proc(n) if n=0 then 0 else floor((1/2)*n)+2*a(floor((1/2)*n)) end if end proc: seq(a(n),n=0..60); # Emeric Deutsch, Mar 31 2008
  • Mathematica
    a = {0}; Do[AppendTo[a, Floor[n/2] + 2*a[[Floor[n/2] + 1]]], {n, 1, 100}]; a (* Stefan Steinerberger, Mar 24 2008 *)
    Table[Sum[2^(k-1)*Floor[n*2^-k], {k, 1, Log[2, n]}], {n, 0, 100}] (* Federico Provvedi, Aug 17 2013 *)
  • PARI
    a(n) = fromdigits(Vec(Pol(binary(n))'),2); \\ Kevin Ryde, Apr 29 2021
    
  • Python
    def A136013(n): return sum(map(lambda x:(x[0]+1)*(1<Chai Wah Wu, Jul 06 2022

Formula

a(n) = A333979(n,2). - Pontus von Brömssen, Sep 06 2020

Extensions

More terms from Stefan Steinerberger and Emeric Deutsch, Mar 24 2008
Spelling corrected by Jason G. Wurtzel, Aug 30 2010

A080333 Partial sums of A080278.

Original entry on oeis.org

1, 2, 6, 7, 8, 12, 13, 14, 27, 28, 29, 33, 34, 35, 39, 40, 41, 54, 55, 56, 60, 61, 62, 66, 67, 68, 108, 109, 110, 114, 115, 116, 120, 121, 122, 135, 136, 137, 141, 142, 143, 147, 148, 149, 162, 163, 164, 168, 169, 170, 174, 175, 176, 216, 217, 218, 222, 223, 224, 228, 229
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2003

Keywords

Crossrefs

Programs

  • PARI
    a(n) = fromdigits(Vec(Pol(digits(3*n,3))'),3); \\ Kevin Ryde, Apr 29 2021

Formula

a(n) = Sum_{k=0..log_3(n)} 3^k*floor(n/3^k).
a(3^k) = (k+1)*3^k.
a(n) is conjectured to be asymptotic to n*log(n)/log(3). - Klaus Brockhaus, Mar 23 2003 [This follows from the asymptotics of A333979. - Pontus von Brömssen, Sep 06 2020]
a(n) = n + 3*a(floor(n/3)), a(0)=0. - Vladeta Jovovic, Aug 06 2003
G.f.: (1/(1 - x))*Sum_{k>=0} 3^k*x^(3^k)/(1 - x^(3^k)). - Ilya Gutkovskiy, Mar 15 2018
a(n) = A333979(3*n,3). - Pontus von Brömssen, Sep 06 2020
Showing 1-3 of 3 results.