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-10 of 87 results. Next

A120444 First differences of A004125.

Original entry on oeis.org

0, 1, 0, 3, -1, 5, 0, 4, 1, 9, -5, 11, 3, 5, 0, 15, -4, 17, -3, 9, 7, 21, -13, 18, 9, 13, -1, 27, -13, 29, 0, 17, 13, 21, -20, 35, 15, 21, -11, 39, -13, 41, 3, 11, 19, 45, -29, 40, 6, 29, 5, 51, -13, 37, -9, 33, 25, 57, -49, 59, 27, 21, 0, 45, -13, 65, 9, 41, -5, 69, -52, 71, 33, 25, 11, 57, -13, 77, -27, 40, 37, 81, -57, 61, 39, 53, -5
Offset: 1

Views

Author

John W. Layman, Jul 19 2006

Keywords

Comments

It appears that (1) a(n)=0 if and only if n is a power of 2 and (2) a(n)=n-1 if and only if n+1 is a prime. (This has been verified for the first 2000 terms.)

Crossrefs

Programs

  • Haskell
    a120444 n = a120444_list !! (n-1)
    a120444_list = zipWith (-) (tail a004125_list) a004125_list
    -- Reinhard Zumkeller, May 30 2015
  • Mathematica
    Table[2*m - 1 - DivisorSigma[1, m], {m, 2, 100}] (* Paolo Xausa, Dec 09 2024 *)

Formula

a(n) = A005408(n) - A000203(n+1). - Omar E. Pol, Jan 24 2014

A123327 a(n) = A000203(n) + A004125(n).

Original entry on oeis.org

1, 3, 5, 8, 10, 15, 16, 23, 25, 31, 34, 45, 42, 55, 60, 67, 69, 86, 84, 103, 102, 113, 122, 145, 134, 154, 165, 180, 181, 210, 199, 230, 232, 251, 266, 289, 271, 308, 325, 348, 339, 380, 369, 412, 417, 430, 451, 498, 471, 513, 521, 552, 559, 612, 601, 640, 633
Offset: 1

Views

Author

Paolo P. Lava and Giorgio Balzarotti, Sep 26 2006; Juri-Stepan Gerasimov, Jul 02 2009

Keywords

Comments

Another definition for this sequence: Let M be the matrix defined in A111490. Sequence gives M(1,1), M(1,2) + M(2,2), M(1,3) + M(2,3) + M(3,3), etc., i.e. a(n)= Sum_{i=1..n} M(i,n).
Proof from Hartmut F. W. Hoft, Feb 02 2014 that the two definitions agree: (Start)
For all n>=1 the following simplifications hold for the partial sums of the two sequences:
sum[1..n] a(k) = sum[1..n] A000203(k) + sum[1..n] A004125(k)
= A024916(n) + sum[1..n] A004125(k)
= n^2 + sum[1..n-1] A004125(k)
= sum[1..n] A123327(k).
An inductive argument then shows that the two definitions agree.
(End)

Examples

			1(=1+0), 3(=3+0), 5(=4+1), 8(=7+1), 10(=6+4), 15(=12+3), 16(=8+8), etc.
		

Crossrefs

Programs

  • Mathematica
    Lim=57;s2=Table[Sum[Mod[n, k], {k, 2, n-1}], {n, Lim}];Table[DivisorSigma[1, n]+s2[[n]],{n,Lim}] (* James C. McMahon, Nov 20 2024 *)
  • Python
    from math import isqrt
    def A123327(n): return n**2+((s:=isqrt(n-1))**2*(s+1)-sum((q:=(n-1)//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) # Chai Wah Wu, Oct 22 2023

Formula

a(n) = A000290(n) - A024916(n-1), n > 1. - Omar E. Pol, Jan 29 2014

Extensions

Corrected (83 replaced by 103) by R. J. Mathar, May 21 2010
Edited by N. J. A. Sloane, Feb 02 2014, merging A162383 from Juri-Stepan Gerasimov with the present sequence. Thanks to Omar E. Pol for noticing the duplication.

A055064 a(n) = A004125(2^n) = A004125(2^n-1).

Original entry on oeis.org

0, 1, 8, 36, 167, 693, 2849, 11459, 46244, 185622, 743759, 2974937, 11907026, 47643438, 190606963, 762449101, 3049917900, 12199777048, 48799551822, 195198666492, 780796575104, 3123189865122, 12492766610068, 49971069327602, 199884317492186, 799537344955292
Offset: 1

Views

Author

David W. Wilson, Jun 12 2000

Keywords

Crossrefs

Programs

  • Python
    from math import isqrt
    def A055064(n): return ((m:=1<>1) # Chai Wah Wu, Oct 22 2023

Formula

a(n) >= A006516(n-1). - R. J. Mathar, Apr 04 2012

A162362 a(n) = A066186(n) - A004125(n).

Original entry on oeis.org

1, 4, 8, 19, 31, 63, 97, 168, 258, 407, 594, 907, 1285, 1859, 2604, 3660, 4998, 6883, 9246, 12479, 16562, 21967, 28767, 37715, 48847, 63224, 81145, 103980, 132234, 167982, 211935, 267001, 334535, 418343, 520687, 646974, 800336, 988322
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 02 2009

Keywords

Examples

			1(=1-0), 4(=4-0), 8(=9-1), 19(=20-1), 31(=35-4), 63(=66-3), 97(=105-8), etc.
		

Crossrefs

Programs

  • Python
    from math import isqrt
    from sympy import npartitions
    def A162362(n): return n*(npartitions(n)-n)-((s:=isqrt(n))**2*(s+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) # Chai Wah Wu, Oct 22 2023

Extensions

Entries checked by R. J. Mathar, May 21 2010

A294885 a(n) = A004125(n) mod n = [Sum_{i=1..n} (n mod i)] mod n.

Original entry on oeis.org

0, 0, 1, 1, 4, 3, 1, 0, 3, 3, 0, 5, 2, 3, 6, 4, 0, 11, 7, 1, 7, 11, 6, 13, 3, 8, 17, 12, 6, 18, 12, 7, 19, 27, 8, 18, 11, 20, 35, 18, 10, 32, 24, 20, 24, 36, 27, 38, 22, 20, 41, 38, 28, 6, 34, 16, 40, 56, 45, 46, 35, 52, 0, 53, 23, 65, 53, 51, 12, 65, 52, 60, 47, 68, 6, 4, 48, 22, 7, 46, 73, 15, 82, 11, 58, 83, 35, 15, 87, 17, 71, 71
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2017

Keywords

Crossrefs

Cf. A004125.
Cf. A056550 (positions of zeros).

Programs

  • Mathematica
    Table[Mod[Sum[Mod[n,i],{i,n}],n],{n,100}] (* Harvey P. Dale, Jul 10 2024 *)
  • PARI
    A294885(n) = (sum(k=2, n, n%k)%n);

Formula

a(n) = [Sum_{i=1..n} (n mod i)] mod n.

A236109 Triangle read by rows: another version of A048158, only here the representation of A004125 is symmetric, as in the representation of A024916 and A000203.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 2, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 2, 3, 3, 0, 0, 0, 0, 0, 2, 3, 3, 0, 0, 0, 0, 0, 2, 2, 4, 4, 0, 0, 0, 0, 0, 0, 2, 3, 4, 4, 0, 0, 0, 0, 0, 0, 3, 4, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 5, 5, 0, 0, 0, 0, 0, 0, 0, 3
Offset: 1

Views

Author

Omar E. Pol, Jan 26 2014

Keywords

Comments

Row sums give A004125.
For more information see A236104, A237591, A237593, A237270.

Examples

			Triangle begins:
0;
0, 0;
0, 0, 1;
0, 0, 0, 1;
0, 0, 0, 2, 2;
0, 0, 0, 0, 1, 2;
0, 0, 0, 0, 2, 3, 3;
0, 0, 0, 0, 0, 2, 3, 3;
0, 0, 0, 0, 0, 2, 2, 4, 4;
0, 0, 0, 0, 0, 0, 2, 3, 4, 4;
0, 0, 0, 0, 0, 0, 3, 4, 5, 5, 5;
0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 5, 5;
...
For the symmetric representation of A000203, A024916, A004125 in the fourth quadrant using a diagram which arises from the sequence A236104 see below:
--------------------------------------------------
n     A000203  A024916            Diagram
--------------------------------------------------
.                         _ _ _ _ _ _ _ _ _ _ _ _
1        1        1      |_| | | | | | | | | | | |
2        3        4      |_ _|_| | | | | | | | | |
3        4        8      |_ _|  _|_| | | | | | | |
4        7       15      |_ _ _|    _|_| | | | | |
5        6       21      |_ _ _|  _|  _ _|_| | | |
6       12       33      |_ _ _ _|  _| |  _ _|_| |
7        8       41      |_ _ _ _| |_ _|_|    _ _|
8       15       56      |_ _ _ _ _|  _|     |* *
9       13       69      |_ _ _ _ _| |      _|* *
10      18       87      |_ _ _ _ _ _|  _ _|* * *
11      12       99      |_ _ _ _ _ _| |* * * * *
12      28      127      |_ _ _ _ _ _ _|* * * * *
.
The 12th row is ........ 0,0,0,0,0,0,0,2,2,3,5,5
.
The total number of cells in the first n set of symmetric regions of the diagram equals A024916(n). It appears that the total number of cells in the n-th set of symmetric regions of the diagram equals sigma(n) = A000203(n). Example: for n = 12 the 12th row of triangle is 144, 25, 9, 1, hence the alternating sums is 144 - 25 + 9 - 1 = 127. On the other hand we have that A000290(12) - A004125(12) = 144 - 17 = A024916(12) = 127, equaling the total number of cells in the diagram after 12 stages. The number of cells in the 12th set of symmetric regions of the diagram is sigma(12) = A000203(12) = 28. Note that in this case there is only one region. The number of "*"'s is A004125(12) = 17.
		

Crossrefs

A237270 Triangle read by rows in which row n lists the parts of the symmetric representation of sigma(n).

Original entry on oeis.org

1, 3, 2, 2, 7, 3, 3, 12, 4, 4, 15, 5, 3, 5, 9, 9, 6, 6, 28, 7, 7, 12, 12, 8, 8, 8, 31, 9, 9, 39, 10, 10, 42, 11, 5, 5, 11, 18, 18, 12, 12, 60, 13, 5, 13, 21, 21, 14, 6, 6, 14, 56, 15, 15, 72, 16, 16, 63, 17, 7, 7, 17, 27, 27, 18, 12, 18, 91, 19, 19, 30, 30, 20, 8, 8, 20, 90
Offset: 1

Views

Author

Omar E. Pol, Feb 19 2014

Keywords

Comments

T(n,k) is the number of cells in the k-th region of the n-th set of regions in a diagram of the symmetry of sigma(n), see example.
Row n is a palindromic composition of sigma(n).
Row sums give A000203.
Row n has length A237271(n).
In the row 2n-1 of triangle both the first term and the last term are equal to n.
If n is an odd prime then row n is [m, m], where m = (1 + n)/2.
The connection with A196020 is as follows: A196020 --> A236104 --> A235791 --> A237591 --> A237593 --> A239660 --> this sequence.
For the boundary segments in an octant see A237591.
For the boundary segments in a quadrant see A237593.
For the boundary segments in the spiral see also A239660.
For the parts in every quadrant of the spiral see A239931, A239932, A239933, A239934.
We can find the spiral on the terraces of the stepped pyramid described in A244050. - Omar E. Pol, Dec 07 2016
T(n,k) is also the area of the k-th terrace, from left to right, at the n-th level, starting from the top, of the stepped pyramid described in A245092 (see Links section). - Omar E. Pol, Aug 14 2018

Examples

			Illustration of the first 27 terms as regions (or parts) of a spiral constructed with the first 15.5 rows of A239660:
.
.                  _ _ _ _ _ _ _ _
.                 |  _ _ _ _ _ _ _|_ _ _ _ _ _ _ 7
.                 | |             |_ _ _ _ _ _ _|
.             12 _| |                           |
.               |_ _|  _ _ _ _ _ _              |_ _
.         12 _ _|     |  _ _ _ _ _|_ _ _ _ _ 5      |_
.      _ _ _| |    9 _| |         |_ _ _ _ _|         |
.     |  _ _ _|  9 _|_ _|                   |_ _ 3    |_ _ _ 7
.     | |      _ _| |      _ _ _ _          |_  |         | |
.     | |     |  _ _| 12 _|  _ _ _|_ _ _ 3    |_|_ _ 5    | |
.     | |     | |      _|   |     |_ _ _|         | |     | |
.     | |     | |     |  _ _|           |_ _ 3    | |     | |
.     | |     | |     | |    3 _ _        | |     | |     | |
.     | |     | |     | |     |  _|_ 1    | |     | |     | |
.    _|_|    _|_|    _|_|    _|_| |_|    _|_|    _|_|    _|_|    _
.   | |     | |     | |     | |         | |     | |     | |     | |
.   | |     | |     | |     |_|_ _     _| |     | |     | |     | |
.   | |     | |     | |    2  |_ _|_ _|  _|     | |     | |     | |
.   | |     | |     |_|_     2    |_ _ _|7   _ _| |     | |     | |
.   | |     | |    4    |_                 _|  _ _|     | |     | |
.   | |     |_|_ _        |_ _ _ _        |  _|    _ _ _| |     | |
.   | |    6      |_      |_ _ _ _|_ _ _ _| | 15 _|    _ _|     | |
.   |_|_ _ _        |_   4        |_ _ _ _ _|  _|     |    _ _ _| |
.  8      | |_ _      |                       |      _|   |  _ _ _|
.         |_    |     |_ _ _ _ _ _            |  _ _|28  _| |
.           |_  |_    |_ _ _ _ _ _|_ _ _ _ _ _| |      _|  _|
.          8  |_ _|  6            |_ _ _ _ _ _ _|  _ _|  _|
.                 |                               |  _ _|  31
.                 |_ _ _ _ _ _ _ _                | |
.                 |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _| |
.                8                |_ _ _ _ _ _ _ _ _|
.
.
[For two other drawings of the spiral see the links. - _N. J. A. Sloane_, Nov 16 2020]
If the sequence does not contain negative terms then its terms can be represented in a quadrant. For the construction of the diagram we use the symmetric Dyck paths of A237593 as shown below:
---------------------------------------------------------------
Triangle         Diagram of the symmetry of sigma (n = 1..24)
---------------------------------------------------------------
.              _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1;            |_| | | | | | | | | | | | | | | | | | | | | | | |
3;            |_ _|_| | | | | | | | | | | | | | | | | | | | | |
2, 2;         |_ _|  _|_| | | | | | | | | | | | | | | | | | | |
7;            |_ _ _|    _|_| | | | | | | | | | | | | | | | | |
3, 3;         |_ _ _|  _|  _ _|_| | | | | | | | | | | | | | | |
12;           |_ _ _ _|  _| |  _ _|_| | | | | | | | | | | | | |
4, 4;         |_ _ _ _| |_ _|_|    _ _|_| | | | | | | | | | | |
15;           |_ _ _ _ _|  _|     |  _ _ _|_| | | | | | | | | |
5, 3, 5;      |_ _ _ _ _| |      _|_| |  _ _ _|_| | | | | | | |
9, 9;         |_ _ _ _ _ _|  _ _|    _| |    _ _ _|_| | | | | |
6, 6;         |_ _ _ _ _ _| |  _|  _|  _|   |  _ _ _ _|_| | | |
28;           |_ _ _ _ _ _ _| |_ _|  _|  _ _| | |  _ _ _ _|_| |
7, 7;         |_ _ _ _ _ _ _| |  _ _|  _|    _| | |    _ _ _ _|
12, 12;       |_ _ _ _ _ _ _ _| |     |     |  _|_|   |* * * *
8, 8, 8;      |_ _ _ _ _ _ _ _| |  _ _|  _ _|_|       |* * * *
31;           |_ _ _ _ _ _ _ _ _| |  _ _|  _|      _ _|* * * *
9, 9;         |_ _ _ _ _ _ _ _ _| | |_ _ _|      _|* * * * * *
39;           |_ _ _ _ _ _ _ _ _ _| |  _ _|    _|* * * * * * *
10, 10;       |_ _ _ _ _ _ _ _ _ _| | |       |* * * * * * * *
42;           |_ _ _ _ _ _ _ _ _ _ _| |  _ _ _|* * * * * * * *
11, 5, 5, 11; |_ _ _ _ _ _ _ _ _ _ _| | |* * * * * * * * * * *
18, 18;       |_ _ _ _ _ _ _ _ _ _ _ _| |* * * * * * * * * * *
12, 12;       |_ _ _ _ _ _ _ _ _ _ _ _| |* * * * * * * * * * *
60;           |_ _ _ _ _ _ _ _ _ _ _ _ _|* * * * * * * * * * *
...
The total number of cells in the first n set of symmetric regions of the diagram equals A024916(n), the sum of all divisors of all positive integers <= n, hence the total number of cells in the n-th set of symmetric regions of the diagram equals sigma(n) = A000203(n).
For n = 9 the 9th row of A237593 is [5, 2, 2, 2, 2, 5] and the 8th row of A237593 is [5, 2, 1, 1, 2, 5] therefore between both symmetric Dyck paths there are three regions (or parts) of sizes [5, 3, 5], so row 9 is [5, 3, 5].
The sum of divisors of 9 is 1 + 3 + 9 = A000203(9) = 13. On the other hand the sum of the parts of the symmetric representation of sigma(9) is 5 + 3 + 5 = 13, equaling the sum of divisors of 9.
For n = 24 the 24th row of A237593 is [13, 4, 3, 2, 1, 1, 1, 1, 2, 3, 4, 13] and the 23rd row of A237593 is [12, 5, 2, 2, 1, 1, 1, 1, 2, 2, 5, 12] therefore between both symmetric Dyck paths there are only one region (or part) of size 60, so row 24 is 60.
The sum of divisors of 24 is 1 + 2 + 3 + 4 + 6 + 8 + 12 + 24 = A000203(24) = 60. On the other hand the sum of the parts of the symmetric representation of sigma(24) is 60, equaling the sum of divisors of 24.
Note that the number of *'s in the diagram is 24^2 - A024916(24) = 576 - 491 = A004125(24) = 85.
From _Omar E. Pol_, Nov 22 2020: (Start)
Also consider the infinite double-staircases diagram defined in A335616 (see the theorem).
For n = 15 the diagram with first 15 levels looks like this:
.
Level                         "Double-staircases" diagram
.                                          _
1                                        _|1|_
2                                      _|1 _ 1|_
3                                    _|1  |1|  1|_
4                                  _|1   _| |_   1|_
5                                _|1    |1 _ 1|    1|_
6                              _|1     _| |1| |_     1|_
7                            _|1      |1  | |  1|      1|_
8                          _|1       _|  _| |_  |_       1|_
9                        _|1        |1  |1 _ 1|  1|        1|_
10                     _|1         _|   | |1| |   |_         1|_
11                   _|1          |1   _| | | |_   1|          1|_
12                 _|1           _|   |1  | |  1|   |_           1|_
13               _|1            |1    |  _| |_  |    1|            1|_
14             _|1             _|    _| |1 _ 1| |_    |_             1|_
15            |1              |1    |1  | |1| |  1|    1|              1|
.
Starting from A196020 and after the algorithm described in A280850 and A296508 applied to the above diagram we have a new diagram as shown below:
.
Level                             "Ziggurat" diagram
.                                          _
6                                         |1|
7                            _            | |            _
8                          _|1|          _| |_          |1|_
9                        _|1  |         |1   1|         |  1|_
10                     _|1    |         |     |         |    1|_
11                   _|1      |        _|     |_        |      1|_
12                 _|1        |       |1       1|       |        1|_
13               _|1          |       |         |       |          1|_
14             _|1            |      _|    _    |_      |            1|_
15            |1              |     |1    |1|    1|     |              1|
.
The 15th row
of A249351 :  [1,1,1,1,1,1,1,1,0,0,0,1,1,1,2,1,1,1,0,0,0,1,1,1,1,1,1,1,1]
The 15th row
of triangle:  [              8,            8,            8              ]
The 15th row
of A296508:   [              8,      7,    1,    0,      8              ]
The 15th row
of A280851    [              8,      7,    1,            8              ]
.
More generally, for n >= 1, it appears there is the same correspondence between the original diagram of the symmetric representation of sigma(n) and the "Ziggurat" diagram of n.
For the definition of subparts see A239387 and also A296508, A280851. (End)
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_] := Ceiling[(n + 1)/k - (k + 1)/2] (* from A235791 *)
    path[n_] := Module[{c = Floor[(Sqrt[8n + 1] - 1)/2], h, r, d, rd, k, p = {{0, n}}}, h = Map[T[n, #] - T[n, # + 1] &, Range[c]]; r = Join[h, Reverse[h]]; d = Flatten[Table[{{1, 0}, {0, -1}}, {c}], 1];
    rd = Transpose[{r, d}]; For[k = 1, k <= 2c, k++, p = Join[p, Map[Last[p] + rd[[k, 2]] * # &, Range[rd[[k, 1]]]]]]; p]
    segments[n_] := SplitBy[Map[Min, Drop[Drop[path[n], 1], -1] - path[n - 1]], # == 0 &]
    a237270[n_] := Select[Map[Apply[Plus, #] &, segments[n]], # != 0 &]
    Flatten[Map[a237270, Range[40]]] (* data *)
    (* Hartmut F. W. Hoft, Jun 23 2014 *)

Formula

T(n, k) = (A384149(n, k) + A384149(n, m+1-k))/2, where m = A237271(n) is the row length. (conjectured) - Peter Munn, Jun 01 2025

Extensions

Drawing of the spiral extended by Omar E. Pol, Nov 22 2020

A003462 a(n) = (3^n - 1)/2.

Original entry on oeis.org

0, 1, 4, 13, 40, 121, 364, 1093, 3280, 9841, 29524, 88573, 265720, 797161, 2391484, 7174453, 21523360, 64570081, 193710244, 581130733, 1743392200, 5230176601, 15690529804, 47071589413, 141214768240, 423644304721, 1270932914164
Offset: 0

Views

Author

Keywords

Comments

Partial sums of A000244. Values of base 3 strings of 1's.
a(n) = (3^n-1)/2 is also the number of different nonparallel lines determined by pair of vertices in the n dimensional hypercube. Example: when n = 2 the square has 4 vertices and then the relevant lines are: x = 0, y = 0, x = 1, y = 1, y = x, y = 1-x and when we identify parallel lines only 4 remain: x = 0, y = 0, y = x, y = 1 - x so a(2) = 4. - Noam Katz (noamkj(AT)hotmail.com), Feb 11 2001
Also number of 3-block bicoverings of an n-set (if offset is 1, cf. A059443). - Vladeta Jovovic, Feb 14 2001
3^a(n) is the highest power of 3 dividing (3^n)!. - Benoit Cloitre, Feb 04 2002
Apart from the a(0) and a(1) terms, maximum number of coins among which a lighter or heavier counterfeit coin can be identified (but not necessarily labeled as heavier or lighter) by n weighings. - Tom Verhoeff, Jun 22 2002, updated Mar 23 2017
n such that A001764(n) is not divisible by 3. - Benoit Cloitre, Jan 14 2003
Consider the mapping f(a/b) = (a + 2b)/(2a + b). Taking a = 1, b = 2 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the sequence 1/2, 4/5, 13/14, 40/41, ... converging to 1. Sequence contains the numerators = (3^n-1)/2. The same mapping for N, i.e., f(a/b) = (a + Nb)/(a+b) gives fractions converging to N^(1/2). - Amarnath Murthy, Mar 22 2003
Binomial transform of A000079 (with leading zero). - Paul Barry, Apr 11 2003
With leading zero, inverse binomial transform of A006095. - Paul Barry, Aug 19 2003
Number of walks of length 2*n + 2 in the path graph P_5 from one end to the other one. Example: a(2) = 4 because in the path ABCDE we have ABABCDE, ABCBCDE, ABCDCDE and ABCDEDE. - Emeric Deutsch, Apr 02 2004
The number of triangles of all sizes (not counting holes) in Sierpiński's triangle after n inscriptions. - Lee Reeves (leereeves(AT)fastmail.fm), May 10 2004
Number of (s(0), s(1), ..., s(2n+1)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| = 1 for i = 1, 2, ..., 2*n + 1, s(0) = 1, s(2n+1) = 4. - Herbert Kociemba, Jun 10 2004
Number of non-degenerate right-angled incongruent integer-edged Heron triangles whose circumdiameter is the product of n distinct primes of shape 4k + 1. - Alex Fink and R. K. Guy, Aug 18 2005
Also numerator of the sum of the reciprocals of the first n powers of 3, with A000244 being the sequence of denominators. With the exception of n < 2, the base 10 digital root of a(n) is always 4. In base 3 the digital root of a(n) is the same as the digital root of n. - Alonso del Arte, Jan 24 2006
The sequence 3*a(n), n >= 1, gives the number of edges of the Hanoi graph H_3^{n} with 3 pegs and n >= 1 discs. - Daniele Parisse, Jul 28 2006
Numbers n such that a(n) is prime are listed in A028491 = {3, 7, 13, 71, 103, 541, 1091, ...}. 2^(m+1) divides a(2^m*k) for m > 0. 5 divides a(4k). 5^2 divides a(20k). 7 divides a(6k). 7^2 divides a(42k). 11^2 divides a(5k). 13 divides a(3k). 17 divides a(16k). 19 divides a(18k). 1093 divides a(7k). 41 divides a(8k). p divides a((p-1)/5) for prime p = {41, 431, 491, 661, 761, 1021, 1051, 1091, 1171, ...}. p divides a((p-1)/4) for prime p = {13, 109, 181, 193, 229, 277, 313, 421, 433, 541, ...}. p divides a((p-1)/3) for prime p = {61, 67, 73, 103, 151, 193, 271, 307, 367, ...} = A014753, 3 and -3 are both cubes (one implies other) mod these primes p = 1 mod 6. p divides a((p-1)/2) for prime p = {11, 13, 23, 37, 47, 59, 61, 71, 73, 83, 97, ...} = A097933(n). p divides a(p-1) for prime p > 7. p^2 divides a(p*(p-1)k) for all prime p except p = 3. p^3 divides a(p*(p-1)*(p-2)k) for prime p = 11. - Alexander Adamchuk, Jan 22 2007
Let P(A) be the power set of an n-element set A. Then a(n) = the number of [unordered] pairs of elements {x,y} of P(A) for which x and y are disjoint [and both nonempty]. Wieder calls these "disjoint usual 2-combinations". - Ross La Haye, Jan 10 2008 [This is because each of the elements of {1, 2, ..., n} can be in the first subset, in the second or in neither. Because there are three options for each, the total number of options is 3^n. However, since the sets being empty is not an option we subtract 1 and since the subsets are unordered we then divide by 2! (The number of ways two objects can be arranged.) Thus we obtain (3^n-1)/2 = a(n). - Chayim Lowen, Mar 03 2015]
Also, still with P(A) being the power set of a n-element set A, a(n) is the number of 2-element subsets {x,y} of P(A) such that the union of x and y is equal to A. Cf. A341590. - Fabio Visonà, Feb 20 2021
Starting with offset 1 = binomial transform of A003945: (1, 3, 6, 12, 24, ...) and double bt of (1, 2, 1, 2, 1, 2, ...); equals polcoeff inverse of (1, -4, 3, 0, 0, 0, ...). - Gary W. Adamson, May 28 2009
Also the constant of the polynomials C(x) = 3x + 1 that form a sequence by performing this operation repeatedly and taking the result at each step as the input at the next. - Nishant Shukla (n.shukla722(AT)gmail.com), Jul 11 2009
It appears that this is A120444(3^n-1) = A004125(3^n) - A004125(3^n-1), where A004125 is the sum of remainders of n mod k for k = 1, 2, 3, ..., n. - John W. Layman, Jul 29 2009
Subsequence of A134025; A171960(a(n)) = a(n). - Reinhard Zumkeller, Jan 20 2010
Let A be the Hessenberg matrix of order n, defined by: A[1,j] = 1, A[i, i] := 3, (i > 1), A[i, i-1] = -1, and A[i, j] = 0 otherwise. Then, for n >= 1, a(n) = det(A). - Milan Janjic, Jan 27 2010
This is the sequence A(0, 1; 2, 3; 2) = A(0, 1; 4, -3; 0) of the family of sequences [a, b:c, d:k] considered by Gary Detlefs, and treated as A(a, b; c, d; k) in the Wolfdieter Lang link given below. - Wolfdieter Lang, Oct 18 2010
It appears that if s(n) is a first order rational sequence of the form s(0) = 0, s(n) = (2*s(n-1)+1)/(s(n-1)+2), n > 0, then s(n)= a(n)/(a(n)+1). - Gary Detlefs, Nov 16 2010
This sequence also describes the total number of moves to solve the [RED ; BLUE ; BLUE] or [RED ; RED ; BLUE] pre-colored Magnetic Towers of Hanoi puzzle (cf. A183111 - A183125).
From Adi Dani, Jun 08 2011: (Start)
a(n) is number of compositions of odd numbers into n parts less than 3. For example, a(3) = 13 and there are 13 compositions odd numbers into 3 parts < 3:
1: (0, 0, 1), (0, 1, 0), (1, 0, 0);
3: (0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0), (1, 1, 1);
5: (1, 2, 2), (2, 1, 2), (2, 2, 1).
(End)
Pisano period lengths: 1, 2, 1, 2, 4, 2, 6, 4, 1, 4, 5, 2, 3, 6, 4, 8, 16, 2, 18, 4, ... . - R. J. Mathar, Aug 10 2012
a(n) is the total number of holes (triangles removed) after the n-th step of a Sierpiński triangle production. - Ivan N. Ianakiev, Oct 29 2013
a(n) solves Sum_{j = a(n) + 1 .. a(n+1)} j = k^2 for some integer k, given a(0) = 0 and requiring smallest a(n+1) > a(n). Corresponding k = 3^n. - Richard R. Forberg, Mar 11 2015
a(n+1) equals the number of words of length n over {0, 1, 2, 3} avoiding 01, 02 and 03. - Milan Janjic, Dec 17 2015
For n >= 1, a(n) is also the total number of words of length n, over an alphabet of three letters, such that one of the letters appears an odd number of times (See A006516 for 4 letter words, and the Balakrishnan reference there). - Wolfdieter Lang, Jul 16 2017
Also, the number of maximal cliques, maximum cliques, and cliques of size 4 in the n-Apollonian network. - Andrew Howroyd, Sep 02 2017
For n > 1, the number of triangles (cliques of size 3) in the (n-1)-Apollonian network. - Andrew Howroyd, Sep 02 2017
a(n) is the largest number that can be represented with n trits in balanced ternary. Correspondingly, -a(n) is the smallest number that can be represented with n trits in balanced ternary. - Thomas König, Apr 26 2020
These form Sierpinski nesting-stars, which alternate pattern on 3^n+1/2 star numbers A003154, based on the square configurations of 9^n. The partial sums of 3^n are delineated according to the geometry of a hexagram, see illustrations in links. (3*a(n-1) + 1) create Sierpinski-anti-triangles, representing the number of holes in a (n+1) Sierpinski triangle (see illustrations). - John Elias, Oct 18 2021
For n > 1, a(n) is the number of iterations necessary to calculate the hyperbolic functions with CORDIC. - Mathias Zechmeister, Jul 26 2022
a(n) is the least number k such that A065363(k) = n. - Amiram Eldar, Sep 03 2022
For all n >= 0, Sum_{k=a(n)+1..a(n+1)} 1/k < Sum_{j=a(n+1)+1..a(n+2)} 1/j. These are the minimal points which partition the infinite harmonic series into a monotonically increasing sequence. Each partition approximates log(3) from below as n tends to infinity. - Joseph Wheat, Apr 15 2023
a(n) is also the number of 3-cycles in the n-Dorogovtsev-Goltsev-Mendes graph (using the convention the 0-Dorogovtsev-Goltsev-Mendes graph is P_2). - Eric W. Weisstein, Dec 06 2023

Examples

			There are 4 3-block bicoverings of a 3-set: {{1, 2, 3}, {1, 2}, {3}}, {{1, 2, 3}, {1, 3}, {2}}, {{1, 2, 3}, {1}, {2, 3}} and {{1, 2}, {1, 3}, {2, 3}}.
Ternary........Decimal
0.................0
1.................1
11................4
111..............13
1111.............40 etc. - _Zerinvary Lajos_, Jan 14 2007
There are altogether a(3) = 13 three letter words over {A,B,C} with say, A, appearing an odd number of times: AAA; ABC, ACB, ABB, ACC; BAC, CAB, BAB, CAC; BCA, CBA, BBA, CCA. - _Wolfdieter Lang_, Jul 16 2017
		

References

  • J. G. Mauldon, Strong solutions for the counterfeit coin problem, IBM Research Report RC 7476 (#31437) 9/15/78, IBM Thomas J. Watson Research Center, P. O. Box 218, Yorktown Heights, N. Y. 10598.
  • Paulo Ribenboim, The Book of Prime Number Records, Springer-Verlag, NY, 2nd ed., 1989, p. 60.
  • Paulo Ribenboim, The Little Book of Big Primes, Springer-Verlag, NY, 1991, p. 53.
  • Amir Sapir, The Tower of Hanoi with Forbidden Moves, The Computer J. 47 (1) (2004) 20, case three-in-a row, sequence a(n).
  • Robert Sedgewick, Algorithms, 1992, pp. 109.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Sequences used for Shell sort: A033622, A003462, A036562, A036564, A036569, A055875.
Cf. A179526 (repeats), A113047 (characteristic function).
Cf. A000225, A000392, A004125, A014753, A028491 (indices of primes), A059443 (column k = 3), A065363, A097933, A120444, A321872 (sum reciprocals).
Cf. A064099 (minimal number of weightings to detect lighter or heavier coin among n coins).
Cf. A039755 (column k = 1).
Cf. A006516 (binomial transform, and special 4 letter words).
Cf. A341590.
Cf. A003462(n) (3-cycles), A367967(n) (5-cycles), A367968(n) (6-cycles).

Programs

Formula

G.f.: x/((1-x)*(1-3*x)).
a(n) = 4*a(n-1) - 3*a(n-2), n > 1. a(0) = 0, a(1) = 1.
a(n) = 3*a(n-1) + 1, a(0) = 0.
E.g.f.: (exp(3*x) - exp(x))/2. - Paul Barry, Apr 11 2003
a(n+1) = Sum_{k = 0..n} binomial(n+1, k+1)*2^k. - Paul Barry, Aug 20 2004
a(n) = Sum_{i = 0..n-1} 3^i, for n > 0; a(0) = 0.
a(n) = A125118(n, 2) for n > 1. - Reinhard Zumkeller, Nov 21 2006
a(n) = StirlingS2(n+1, 3) + StirlingS2(n+1, 2). - Ross La Haye, Jan 10 2008
a(n) = Sum_{k = 0..n} A106566(n, k)*A106233(k). - Philippe Deléham, Oct 30 2008
a(n) = 2*a(n-1) + 3*a(n-2) + 2, n > 1. - Gary Detlefs, Jun 21 2010
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3), a(0) = 0, a(1) = 1, a(2) = 4. Observation by G. Detlefs. See the W. Lang comment and link. - Wolfdieter Lang, Oct 18 2010
A008344(a(n)) = 0, for n > 1. - Reinhard Zumkeller, May 09 2012
A085059(a(n)) = 1 for n > 0. - Reinhard Zumkeller, Jan 31 2013
G.f.: Q(0)/2 where Q(k) = 1 - 1/(9^k - 3*x*81^k/(3*x*9^k - 1/(1 - 1/(3*9^k - 27*x*81^k/(9*x*9^k - 1/Q(k+1)))))); (continued fraction ). - Sergei N. Gladkovskii, Apr 12 2013
a(n) = A001065(3^n) where A001065(m) is the sum of the proper divisors of m for positive integer m. - Chayim Lowen, Mar 03 2015
a(n) = A000244(n) - A007051(n) = A007051(n)-1. - Yuchun Ji, Oct 23 2018
Sum_{n>=1} 1/a(n) = A321872. - Amiram Eldar, Nov 18 2020

Extensions

More terms from Michael Somos
Corrected my comment of Jan 10 2008. - Ross La Haye, Oct 29 2008
Removed comment that duplicated a formula. - Joerg Arndt, Mar 11 2010

A006218 a(n) = Sum_{k=1..n} floor(n/k); also Sum_{k=1..n} d(k), where d = number of divisors (A000005); also number of solutions to x*y = z with 1 <= x,y,z <= n.

Original entry on oeis.org

0, 1, 3, 5, 8, 10, 14, 16, 20, 23, 27, 29, 35, 37, 41, 45, 50, 52, 58, 60, 66, 70, 74, 76, 84, 87, 91, 95, 101, 103, 111, 113, 119, 123, 127, 131, 140, 142, 146, 150, 158, 160, 168, 170, 176, 182, 186, 188, 198, 201, 207, 211, 217, 219, 227, 231, 239, 243, 247, 249
Offset: 0

Views

Author

Keywords

Comments

The identity Sum_{k=1..n} floor(n/k) = Sum_{k=1..n} d(k) is Equation (10), p. 58, of Apostol (1976). - N. J. A. Sloane, Dec 06 2020
The "Dirichlet divisor problem" is to find a precise asymptotic estimate for this sequence - see formula lines below, also Apostol (1976), Chap. 3.
Number of increasing arithmetic progressions where n+1 is the second or later term. - Mambetov Timur, Takenov Nurdin, Haritonova Oksana (timus(AT)post.kg; oksanka-61(AT)mail.ru), Jun 13 2002. E.g., a(3) = 5 because there are 5 such arithmetic progressions: (1, 2, 3, 4); (2, 3, 4); (1, 4); (2, 4); (3, 4).
Binomial transform of A001659.
Area covered by overlapped partitions of n, i.e., sum of maximum values of the k-th part of a partition of n into k parts. - Jon Perry, Sep 08 2005
Equals inverse Mobius transform of A116477. - Gary W. Adamson, Aug 07 2008
The Polymath project (see the Tao-Croot-Helfgott link) sketches an algorithm for computing a(n) in essentially cube root time, see section 2.1. - Charles R Greathouse IV, Oct 10 2010 [Sladkey gives another. - Charles R Greathouse IV, Oct 02 2017]
The Dirichlet inverse starts (offset 1) 1, -3, -5, 1, -10, 16, -16, 1, 2, 33, -29, -6, -37, 55, 55, -1, -52, -5, -60, ... - R. J. Mathar, Oct 17 2012
The inverse Mobius transforms yields A143356. - R. J. Mathar, Oct 17 2012
An improved approximation vs. Dirichlet is: a(n) = log(Gamma(n+1)) + 2n*gamma. Using sample ranges of {n = k^2-k to k^2 + (k-1)} the means of the new error term are < +- 0.5 up to k=150, except on two values of k. These ranges appear to give means closest to zero for such small sample sizes. It is not clear sample means remain < +- 0.5 at larger k. The standard deviations are ~(n*log(n))^(1/4)/2, with n near sample range center. - Richard R. Forberg, Jan 06 2015
The values of n for which a(n) is even are given by 4*m^2 <= n <= 4*m(m+1) for m >= 0. Example: for m=1 the values of n are 4 <= n <= 8 for which a(4) to a(8) are even. - G. C. Greubel, Sep 30 2015
For n > 0, a(n) = count(x|y), 1 <= y <= x <= n, that is, the number of pairs in the ordered list of x and y, where y divides x, up to and including n. - Torlach Rush, Jan 31 2017
a(n) is also the total number of partitions of all positive integers <= n into equal parts. - Omar E. Pol, May 29 2017
a(n) is the rank of the join of the set of elements of rank n in Young's lattice, the lattice of all integer partitions ordered by inclusion of their Ferrers diagrams. - Geoffrey Critzer, Jul 11 2018
a(n) always has the same parity as floor(sqrt(n)) = A000196(n): see A211264 (proof in Diophante link). - Bernard Schott, Feb 13 2021
From Omar E. Pol, Feb 16 2021: (Start)
Apart from initial zero this is the convolution of A341062 and A000027.
Nonzero terms convolved with A341062 gives A055507. (End)
From Bernard Schott, Apr 17 2022: (Start)
a(n-1) is the number of lattice points in the first quadrant lying under the hyperbola x*y = n, excluding the lattice points on the axes.
a(n) is the number of lattice points in the first quadrant lying on or under the hyperbola x*y = n, excluding the lattice points on the axes. (Reference Hari Kishan). (End)
Let tiles Tn (for n >= 1) be initially placed on square n on an infinite 1D board. At each step, the leftmost unblocked tile (i.e., the top tile in the leftmost stack) jumps forward exactly n squares. Tiles can stack, and only the top tile of a stack can move. This sequence gives the step number when tile n moves for the first time. - Ali Sada, May 23 2025

Examples

			a(3) = 5 because 3 + floor(3/2) + 1 = 3 + 1 + 1 = 5. Or tau(1) + tau(2) + tau(3) = 1 + 2 + 2 = 5.
a(4) = 8 because 4 + floor(4/2) + floor(4/3) + 1 = 4 + 2 + 1 + 1 = 8. Or
tau(1) + tau(2) + tau(3) + tau(4) = 1 + 2 + 2 + 3 = 8.
a(5) = 10 because 5 + floor(5/2) + floor(5/3) + floor (5/4) + 1 = 5 + 2 + 1 + 1 + 1 = 10. Or tau(1) + tau(2) + tau(3) + tau(4) + tau(5) = 1 + 2 + 2 + 3 + 2 = 10.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
  • K. Chandrasekharan, Introduction to Analytic Number Theory. Springer-Verlag, 1968, Chap. VI.
  • K. Chandrasekharan, Arithmetical Functions. Springer-Verlag, 1970, Chapter VIII, pp. 194-228. Springer-Verlag, Berlin.
  • P. G. L. Dirichlet, Werke, Vol. ii, pp. 49-66.
  • M. N. Huxley, The Distribution of Prime Numbers, Oxford Univ. Press, 1972, p. 7.
  • M. N. Huxley, Area, Lattice Points and Exponential Sums, Oxford, 1996; p. 239.
  • Hari Kishan, Number Theory, Krishna, Educational Publishers, 2014, Theorem 1, p. 133.
  • H. L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 56.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Nurdin N. Takenov and Oksana Haritonova, Representation of positive integers by a special set of digits and sequences, in Dolmatov, S. L. et al. editors, Materials of Science, Practical seminar "Modern Mathematics".
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.6.13 on page 107.

Crossrefs

Right edge of A056535. Cf. A000005, A001659, A052511, A143236.
Row sums of triangle A003988, A010766 and A143724.
A061017 is an inverse.
It appears that the partial sums give A078567. - N. J. A. Sloane, Nov 24 2008

Programs

  • Haskell
    a006218 n = sum $ map (div n) [1..n]
    -- Reinhard Zumkeller, Jan 29 2011
    
  • Magma
    [0] cat [&+[Floor(n/k):k in [1..n]]:n in [1..60]]; // Marius A. Burtea, Aug 25 2019
    
  • Maple
    with(numtheory): A006218 := n->add(sigma[0](i), i=1..n);
  • Mathematica
    Table[Sum[DivisorSigma[0, k], {k, n}], {n, 70}]
    FoldList[Plus, 0, Table[DivisorSigma[0, x], {x, 61}]] //Rest (* much faster *)
    Join[{0},Accumulate[DivisorSigma[0,Range[60]]]] (* Harvey P. Dale, Jan 06 2016 *)
  • PARI
    a(n)=sum(k=1,n,n\k)
    
  • PARI
    a(n)=sum(k=1,sqrtint(n),n\k)*2-sqrtint(n)^2 \\ Charles R Greathouse IV, Oct 10 2010
    
  • Python
    from sympy import integer_nthroot
    def A006218(n): return 2*sum(n//k for k in range(1,integer_nthroot(n,2)[0]+1))-integer_nthroot(n,2)[0]**2 # Chai Wah Wu, Mar 29 2021

Formula

a(n) = n * ( log(n) + 2*gamma - 1 ) + O(sqrt(n)), where gamma is the Euler-Mascheroni number ~ 0.57721... (see A001620), Dirichlet, 1849. Again, a(n) = n * ( log(n) + 2*gamma - 1 ) + O(log(n)*n^(1/3)). The determination of the precise size of the error term is an unsolved problem (the so-called Dirichlet divisor problem) - see references, especially Huxley (2003).
The bounds from Chandrasekharan lead to the explicit bounds n log(n) + (2 gamma - 1) n - 4 sqrt(n) - 1 <= a(n) <= n log(n) + (2 gamma - 1) n + 4 sqrt(n). - David Applegate, Oct 14 2008
a(n) = 2*(Sum_{i=1..floor(sqrt(n))} floor(n/i)) - floor(sqrt(n))^2. - Benoit Cloitre, May 12 2002
G.f.: (1/(1-x))*Sum_{k >= 1} x^k/(1-x^k). - Benoit Cloitre, Apr 23 2003
For n > 0: A027750(a(n-1) + k) = k-divisor of n, = k <= A000005(n). - Reinhard Zumkeller, May 10 2006
a(n) = A161886(n) - n + 1 = A161886(n-1) - A049820(n) + 2 = A161886(n-1) + A000005(n) - n + 2 = A006590(n) + A000005(n) - n = A006590(n+1) - n - 1 = A006590(n) + A000005(n) - n for n >= 2. a(n) = a(n-1) + A000005(n) for n >= 1. - Jaroslav Krizek, Nov 14 2009
D(n) = Sum_{m >= 2, r >= 1} (r/m^(r+1)) * Sum_{j = 1..m - 1} * Sum_{k = 0 .. m^(r+1) - 1} exp{ 2*k*pi i(p^n + (m - j)m^r) / m^(r+1) } where p is some fixed prime number. - A. Neves, Oct 04 2010
Let E(n) = a(n) - n(log n + 2 gamma - 1). Then Berkane-Bordellès-Ramaré show that |E(n)| <= 0.961 sqrt(n), |E(n)| <= 0.397 sqrt(n) for n > 5559, and |E(n)| <= 0.764 n^(1/3) log n for x > 9994. - Charles R Greathouse IV, Jul 02 2012
a(n) = Sum_{k = 1..floor(sqrt(n))} A005408(floor((n/k) - (k-1))). - Gregory R. Bryant, Apr 20 2013
Dirichlet g.f. for s > 2: Sum_{n>=1} a(n)/n^s = Sum_{k>=1} (Zeta(s-1) - Sum_{n=1..k-1} (HurwitzZeta(s,n/k)*n/k^s))/k. - Mats Granvik, Sep 24 2017
From Ridouane Oudra, Dec 31 2022: (Start)
a(n) = n^2 - Sum_{i=1..n} Sum_{j=1..n} floor(log(i*j)/log(n+1));
a(n) = floor(sqrt(n)) + 2*Sum_{i=1..n} floor((sqrt(i^2 + 4*n) - i)/2);
a(n) = n + Sum_{i=1..n} v_2(i)*round(n/i), where v_2(i) = A007814(i). (End)

A236104 Triangle read by rows: T(n,k), n >= 1, k >= 1, in which column k lists k copies of the positive squares in nondecreasing order, and the first element of column k is in row k(k+1)/2.

Original entry on oeis.org

1, 4, 9, 1, 16, 1, 25, 4, 36, 4, 1, 49, 9, 1, 64, 9, 1, 81, 16, 4, 100, 16, 4, 1, 121, 25, 4, 1, 144, 25, 9, 1, 169, 36, 9, 1, 196, 36, 9, 4, 225, 49, 16, 4, 1, 256, 49, 16, 4, 1, 289, 64, 16, 4, 1, 324, 64, 25, 9, 1, 361, 81, 25, 9, 1, 400, 81, 25, 9, 4
Offset: 1

Views

Author

Omar E. Pol, Jan 23 2014

Keywords

Comments

These are the squares of the entries of the triangle in A235791: T(n,k) = (A235791(n,k))^2.
Row n has length A003056(n) hence the first element of column k is in row A000217(k).
Columns 1-3 (including the initial zeros) are A000290, A008794, A211547.
Also column k lists the partial sums of the k-th column of triangle A196020 which gives an identity for sigma.
Since all the elements of this sequence are squares, we can draw an illustration of the alternating sum of row n step by step, and a symmetric diagram for A000203, A024916, A004125; see example.
For more information about the diagram see A237593.

Examples

			Triangle begins:
    1;
    4;
    9,   1;
   16,   1;
   25,   4;
   36,   4,   1;
   49,   9,   1;
   64,   9,   1;
   81,  16,   4;
  100,  16,   4,   1;
  121,  25,   4,   1;
  144,  25,   9,   1;
  169,  36,   9,   1;
  196,  36,   9,   4;
  225,  49,  16,   4,   1;
  256,  49,  16,   4,   1;
  289,  64,  16,   4,   1;
  324,  64,  25,   9,   1;
  361,  81,  25,   9,   1;
  400,  81,  25,   9,   4;
  441, 100,  36,   9,   4,   1;
  484, 100,  36,  16,   4,   1;
  529, 121,  36,  16,   4,   1;
  576, 121,  49,  16,   4,   1;
  ...
For n = 6 the sum of all divisors of all positive integers <= 6 is [1] + [1+2] + [1+3] + [1+2+4] + [1+5] + [1+2+3+6] = 1 + 3 + 4 + 7 + 6 + 12 = 33. On the other hand the 6th row of triangle is 36, 4, 1, therefore the alternating row sum is 36 - 4 + 1 = 33, equaling the sum of all divisors of all positive integers <= 6.
Illustration of the alternating sum of the 6th row as the area of a polygon (or the number of cells), step by step, in the fourth quadrant:
.     _ _ _ _ _ _       _ _ _ _ _ _       _ _ _ _ _ _
.    |           |     |           |     |           |
.    |           |     |           |     |           |
.    |           |     |           |     |           |
.    |           |     |        _ _|     |          _|
.    |           |     |       |         |        _|
.    |_ _ _ _ _ _|     |_ _ _ _|         |_ _ _ _|
.
.          36           36 - 4 = 32     36 - 4 + 1 = 33
.
Then using this method we can draw a symmetric diagram for A000203, A024916, A004125, as shown below:
--------------------------------------------------
n     A000203  A024916            Diagram
--------------------------------------------------
.                         _ _ _ _ _ _ _ _ _ _ _ _
1        1        1      |_| | | | | | | | | | | |
2        3        4      |_ _|_| | | | | | | | | |
3        4        8      |_ _|  _|_| | | | | | | |
4        7       15      |_ _ _|    _|_| | | | | |
5        6       21      |_ _ _|  _|  _ _|_| | | |
6       12       33      |_ _ _ _|  _| |  _ _|_| |
7        8       41      |_ _ _ _| |_ _|_|    _ _|
8       15       56      |_ _ _ _ _|  _|     |* *
9       13       69      |_ _ _ _ _| |      _|* *
10      18       87      |_ _ _ _ _ _|  _ _|* * *
11      12       99      |_ _ _ _ _ _| |* * * * *
12      28      127      |_ _ _ _ _ _ _|* * * * *
.
The total number of cells in the first n set of symmetric regions of the diagram equals A024916(n). It appears that the total number of cells in the n-th set of symmetric regions of the diagram equals sigma(n) = A000203(n). Example: for n = 12 the 12th row of triangle is 144, 25, 9, 1, hence the alternating sums is 144 - 25 + 9 - 1 = 127. On the other hand we have that A000290(12) - A004125(12) = 144 - 17 = A024916(12) = 127, equaling the total number of cells in the diagram after 12 stages. The number of cells in the 12th set of symmetric regions of the diagram is sigma(12) = A000203(12) = 28. Note that in this case there is only one region. Finally, the number of *'s is A004125(12) = 17.
Note that the diagram is also the top view of the stepped pyramid described in A245092. - _Omar E. Pol_, Feb 12 2018
		

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[(n + 1)/k - (k + 1)/2]^2, {n, 20}, {k, Floor[(Sqrt[8 n + 1] - 1)/2]}] // Flatten (* Michael De Vlieger, Feb 10 2018, after Hartmut F. W. Hoft at A235791 *)
  • Python
    from sympy import sqrt
    import math
    def T(n, k): return int(math.ceil((n + 1)/k - (k + 1)/2))
    for n in range(1, 21): print([T(n, k)**2 for k in range(1, int(math.floor((sqrt(8*n + 1) - 1)/2)) + 1)]) # Indranil Ghosh, Apr 25 2017

Formula

Sum_{k=1..A003056(n)} (-1)^(k-1)*T(n,k) = A024916(n). [Although this was stated as a fact, as far as I can tell, no proof was known. However, Don Reble has recently found a proof, which will be added here soon. - N. J. A. Sloane, Nov 23 2020]
A000203(n) = Sum_{k=1..A003056(n)} (-1)^(k-1) * (T(n,k) - T(n-1,k)), assuming that T(k*(k+1)/2-1,k) = 0. - Omar E. Pol, Oct 10 2018
Showing 1-10 of 87 results. Next