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

A080278 a(n) = (3^(v_3(n) + 1) - 1)/2, where v_3(n) = highest power of 3 dividing n = A007949(n).

Original entry on oeis.org

1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1, 40, 1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1, 40, 1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1, 121, 1, 1, 4, 1, 1, 4, 1, 1, 13, 1, 1, 4, 1, 1, 4, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2003

Keywords

Comments

Denominator of the quotient sigma(3*n)/sigma(n). - Labos Elemer, Nov 04 2003
a(n) = b/(3*(c+d)) where b, c, d are the sums of the divisors of 3*n that are congruent respectively to 0, 1 and 2 mod 3. - Michel Lagneau, Nov 05 2012
Sum of powers of 3 dividing n. - Amiram Eldar, Nov 27 2022

Examples

			a(6) = 4 because the divisors of 3*6 = 18 are {1, 2, 3, 6, 9, 18} => b = 3 + 6 + 9 + 18 = 36, c = 1, d = 2, hence a(6) = b/(3*(c+d)) = 36/(3*(1+2)) = 36/9 = 4. - _Michel Lagneau_, Nov 05 2012
		

Crossrefs

Cf. A000203, A001620, A007949, A080333, A088838 (numerator of sigma(3*n)/sigma(n)).

Programs

  • Maple
    A080278 := n->(3^(A007949(n)+1)-1)/2;
  • Mathematica
    Table[Denominator[DivisorSigma[1, 3*n]/DivisorSigma[1, n]], {n, 1, 128}]
    a[n_] := (3^(IntegerExponent[n, 3] + 1) - 1)/2; Array[a, 100] (* Amiram Eldar, Nov 27 2022 *)
  • PARI
    a(n) = denominator(sigma(3*n)/sigma(n)); \\ Michel Marcus, Dec 15 2019
    
  • PARI
    a(n) = (3^(valuation(n, 3) + 1) - 1)/2; \\ Amiram Eldar, Nov 27 2022

Formula

G.f.: Sum_{k>=0} 3^k*x^(3^k)/(1-x^(3^k)). - Ralf Stephan, Jun 15 2003
L.g.f.: -log(Product_{k>=0} (1 - x^(3^k))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Mar 15 2018
a(n) = sigma(n)/(sigma(3*n) - 3*sigma(n)), where sigma(n) = A000203(n). - Peter Bala, Jun 10 2022
From Amiram Eldar, Nov 27 2022: (Start)
Multiplicative with a(3^e) = (3^(e+1)-1)/2, and a(p^e) = 1 for p != 3.
Dirichlet g.f.: zeta(s) / (1 - 3^(1 - s)).
Sum_{k=1..n} a(k) ~ n*log_3(n) + (1/2 + (gamma - 1)/log(3))*n, where gamma is Euler's constant (A001620). (End)

A333979 Array read by antidiagonals, n >= 0, k >= 2: T(n,k) is the "digital derivative" of n in base k; if the base k representation of n is Sum_{j>=0} d_j*k^j, then T(n,k) = Sum_{j>=1} d_j*j*k^(j-1).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 1, 5, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 1, 1, 2, 12, 0, 0, 0, 0, 0, 0, 1, 1, 2, 12, 0, 0, 0, 0, 0, 0, 1, 1, 2, 6, 13, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 6, 13
Offset: 0

Views

Author

Pontus von Brömssen, Sep 04 2020

Keywords

Examples

			Array begins:
  n\k|  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
  ---|---------------------------------------------
   0 |  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   1 |  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   2 |  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   3 |  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0
   4 |  4  1  1  0  0  0  0  0  0  0  0  0  0  0  0
   5 |  4  1  1  1  0  0  0  0  0  0  0  0  0  0  0
   6 |  5  2  1  1  1  0  0  0  0  0  0  0  0  0  0
   7 |  5  2  1  1  1  1  0  0  0  0  0  0  0  0  0
   8 | 12  2  2  1  1  1  1  0  0  0  0  0  0  0  0
   9 | 12  6  2  1  1  1  1  1  0  0  0  0  0  0  0
  10 | 13  6  2  2  1  1  1  1  1  0  0  0  0  0  0
  11 | 13  6  2  2  1  1  1  1  1  1  0  0  0  0  0
  12 | 16  7  3  2  2  1  1  1  1  1  1  0  0  0  0
  13 | 16  7  3  2  2  1  1  1  1  1  1  1  0  0  0
  14 | 17  7  3  2  2  2  1  1  1  1  1  1  1  0  0
  15 | 17  8  3  3  2  2  1  1  1  1  1  1  1  1  0
  16 | 32  8  8  3  2  2  2  1  1  1  1  1  1  1  1
64 = 2*3^3 + 1*3^2 + 0*3^1 + 1*3^0, so T(64,3) = 2*3*3^2 + 1*2*3^1 + 0*1*3^0 = 60. Alternatively, using the formula T(n,k) = floor(n/k) + k*T(floor(n/k),k), we get T(64,3) = 21 + 3*T(21,3) = 21 + 3*(7 + 3*T(7,3)) = 42 + 9*(2 + 3*T(2,3)) = 60.
		

Crossrefs

Cf. A136013 (column k=2), A080277 (every second term of column k=2), A080333 (every third term of column k=3).

Programs

  • Python
    import sympy
    def A333979(n,k):
      d=sympy.ntheory.factor_.digits(n,k)
      return sum(j*d[-j-1]*k**(j-1) for j in range(1,len(d)-1))
    
  • Python
    # Second program (faster)
    def A333979(n,k):
      return n//k+k*A333979(n//k,k) if n>=k else 0

Formula

T(n,k) = floor(n/k) + k*T(floor(n/k),k). Proof: With n = Sum_{j>=0} d_j*k^j we have floor(n/k) + k*T(floor(n/k),k) = Sum_{j>=1} (d_j*k^(j-1) + k*d_j*(j-1)*k^(j-2)) = Sum_{j>=1} d_j*j*k^(j-1) = T(n,k).
T(n,k) = T(n-1,k) + A055129(A286561(n,k),k). Proof: Let n = Sum_{j>=0} d_j*k^j and pick v so that d_j = 0 for j < v and d_v > 0 (so v = A286561(n,k)). Then n - 1 = sum_{j>=0} e_j*k^j, where e_j = k - 1 for j < v, e_v = d_v - 1, and e_j = d_j for j > v. We get T(n,k) - T(n-1,k) = Sum_{j>=1} j*(d_j-e_j)*k^(j-1) = v*k^(v-1) - (k-1)*Sum_{1<=jA055129(A286561(n,k),k).
For fixed k, T(n,k) ~ n*log(n)/(k*log(k)). (The proof for k = 2 by Bannister et al. (p. 182) can be adapted to general k.)
T(n,k) = Sum_{j>=0} k^j*floor(n/k**(j+1)).
Showing 1-3 of 3 results.