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-4 of 4 results.

A271342 Sum of all even divisors of all positive integers <= n.

Original entry on oeis.org

0, 2, 2, 8, 8, 16, 16, 30, 30, 42, 42, 66, 66, 82, 82, 112, 112, 138, 138, 174, 174, 198, 198, 254, 254, 282, 282, 330, 330, 378, 378, 440, 440, 476, 476, 554, 554, 594, 594, 678, 678, 742, 742, 814, 814, 862, 862, 982, 982, 1044, 1044, 1128, 1128, 1208, 1208, 1320, 1320, 1380, 1380, 1524, 1524, 1588, 1588, 1714, 1714
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2016

Keywords

Comments

a(n) is also the sum of all even divisors of all even positive integers <= n.
a(n) is also the total number of parts in all partitions of all positive integers <= n into an even number of equal parts. - Omar E. Pol, Jun 04 2017
The bisection of this sequence equals twice A024916 (see formulas). - Michel Marcus, Dec 14 2017

Examples

			For n = 6 the divisors of all positive integers <= 6 are [1], [1, 2], [1, 3], [1, 2, 4], [1, 5], [1, 2, 3, 6] and the even divisors of all positive integers <= 6 are [2], [2, 4], [2, 6], so a(6) = 2 + 2 + 4 + 2 + 6 = 16. On the other hand the sum of all the divisors of all positive integers <= 6/2 are [1] + [1 + 2] + [1 + 3] = A024916(3) = 8, so a(6) = 2*8 = 16.
For n = 10, (floor(10/2) = 5) numbers have divisor 2, (floor(10/4) = 2) numbers have divisor 4, ..., (floor(10/10) = 1) numbers have divisor 10. Therefore, a(10) = 5 * 2 + 2 * 4 + 1 * 6 + 1 * 8 + 1 * 10 = 42. - _David A. Corneth_, Jun 06 2017
		

Crossrefs

Programs

  • Mathematica
    Accumulate@ Array[DivisorSum[#, # &, EvenQ] &, 65] (* Michael De Vlieger, Jun 06 2017 *)
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (1-d%2)*d)); \\ Michel Marcus, Jun 05 2017
    
  • PARI
    a(n) = 2 * sum(k=1, n\2, k*(n\(k<<1))) \\ David A. Corneth, Jun 06 2017
    
  • Python
    def A271342(n): return sum(k*((n>>1)//k) for k in range(1, (n>>1)+1))<<1 # Chai Wah Wu, Apr 26 2023
    
  • Python
    from math import isqrt
    def A271342(n): return -(s:=isqrt(m:=n>>1))**2*(s+1) + sum((q:=m//k)*((k<<1)+q+1) for k in range(1,s+1)) # Chai Wah Wu, Oct 21 2023

Formula

a(1) = 0.
a(n) = 2*A024916((n-1)/2), if n is odd and n > 1.
a(n) = 2*A024916(n/2), if n is even.
a(n) = A024916(n) - A078471(n).
For n > 1, a(2*n + 1) = a(2*n). - David A. Corneth, Jun 06 2017
a(n) = c * n^2 + O(n*log(n)), where c = Pi^2/24 = 0.411233... (A222171). - Amiram Eldar, Nov 27 2023

A266072 Number of ON (black) cells in the n-th iteration of the "Rule 3" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 1, 1, 5, 1, 9, 1, 13, 1, 17, 1, 21, 1, 25, 1, 29, 1, 33, 1, 37, 1, 41, 1, 45, 1, 49, 1, 53, 1, 57, 1, 61, 1, 65, 1, 69, 1, 73, 1, 77, 1, 81, 1, 85, 1, 89, 1, 93, 1, 97, 1, 101, 1, 105, 1, 109, 1, 113, 1, 117, 1, 121, 1, 125, 1, 129, 1, 133, 1, 137, 1, 141
Offset: 0

Views

Author

Robert Price, Dec 20 2015

Keywords

Comments

This sequence is A000012 and A016813 interspersed.
Also column 1 of A271343. - Omar E. Pol, Apr 06 2016

Examples

			From _Michael De Vlieger_, Dec 21 2015: (Start)
First 12 rows, replacing "0" with "." for better visibility of ON cells, followed by the total number of 1's per row:
                      1                        =  1
                    1 . .                      =  1
                  . . . 1 .                    =  1
                1 1 1 1 . . 1                  =  5
              . . . . . . 1 . .                =  1
            1 1 1 1 1 1 1 . . 1 1              =  9
          . . . . . . . . . 1 . . .            =  1
        1 1 1 1 1 1 1 1 1 1 . . 1 1 1          = 13
      . . . . . . . . . . . . 1 . . . .        =  1
    1 1 1 1 1 1 1 1 1 1 1 1 1 . . 1 1 1 1      = 17
  . . . . . . . . . . . . . . . 1 . . . . .    =  1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 . . 1 1 1 1 1  = 21
(End)
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Programs

  • Mathematica
    rule = 3; rows = 30; Table[Total[Table[Take[CellularAutomaton[rule, {{1},0},rows-1,{All,All}][[k]], {rows-k+1, rows+k-1}], {k,1,rows}][[k]]], {k,1,rows}]

Formula

Conjectured g.f.: (1 + x - x^2 + 3*x^3)/(-1 + x^2)^2. - Michael De Vlieger, Dec 21 2015
Conjectures from Colin Barker, Dec 21 2015: (Start)
a(n) = n-(-1)^n*(n-1).
a(n) = 2*a(n-2) - a(n-4) for n>3. (End)

A266537 Triangle read by rows: T(n,k), n>=1, k>=1, in which column k lists the twice odd numbers (A016825) interleaved with 2*k-1 zeros, and the first positive element of column k is in the row A002378(k), with T(1,1) = 0.

Original entry on oeis.org

0, 2, 0, 6, 0, 10, 2, 0, 0, 14, 0, 0, 0, 18, 6, 0, 0, 22, 0, 2, 0, 0, 0, 26, 10, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 34, 14, 6, 0, 0, 0, 38, 0, 0, 2, 0, 0, 0, 0, 42, 18, 0, 0, 0, 0, 0, 0, 46, 0, 10, 0, 0, 0, 0, 0, 50, 22, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 0, 0, 0, 0, 58, 26, 14, 0, 2
Offset: 1

Views

Author

Omar E. Pol, Apr 05 2016

Keywords

Comments

Gives an identity for A146076. Alternating sum in row n equals the sum of even divisors of n.
Even-indexed rows of the triangle give A236106.
If T(n,k) = 6 then T(n+2,k+1) = 2, the first element of the column k+1.

Examples

			Triangle begins:
0;
2;
0;
6;
0;
10,  2;
0,   0;
14,  0;
0,   0;
18,  6;
0,   0;
22,  0,  2;
0,   0,  0;
26, 10,  0;
0,   0,  0;
30,  0,  0;
0,   0,  0;
34, 14,  6;
0,   0,  0;
38,  0,  0,  2;
0,   0,  0,  0;
42, 18,  0,  0;
0,   0,  0,  0;
46,  0, 10,  0;
0,   0,  0,  0;
50, 22,  0,  0;
0,   0,  0,  0;
54,  0,  0,  6;
0,   0,  0,  0;
58, 26, 14,  0,  2;
...
For n = 12 the divisors of 12 are 1, 2, 3, 4, 6, 12 and the sum of even divisors of 12 is 2 + 4 + 6 + 12 = 24. On the other hand, the 12th row of the triangle is 22, 0, 2, so the alternating row sum is 22 - 0 + 2 = 24, equaling the sum of even divisors of 12.
		

Crossrefs

Formula

T(n,k) = 0, if n is odd.
T(n,k) = 2*A196020(n/2,k) = A236106(n/2,k), if n is even.

A380231 Alternating row sums of triangle A237591.

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 3, 4, 5, 4, 3, 6, 5, 4, 7, 8, 7, 8, 7, 10, 9, 8, 7, 10, 11, 10, 9, 12, 11, 14, 13, 14, 13, 12, 15, 16, 15, 14, 13, 16, 15, 18, 17, 16, 19, 18, 17, 20, 21, 22, 21, 20, 19, 22, 21, 24, 23, 22, 21, 24, 23, 22, 25, 26, 25, 28, 27, 26, 25, 28, 27, 32, 31, 30, 29, 28, 31, 30, 29
Offset: 1

Views

Author

Omar E. Pol, Jan 17 2025

Keywords

Comments

Consider the symmetric Dyck path in the first quadrant of the square grid described in the n-th row of A237593. Let C = (A240542(n), A240542(n)) be the middle point of the Dyck path.
a(n) is also the coordinate on the x axis of the point (a(n),n) and also the coordinate on the y axis of the point (n,a(n)) such that the middle point of the line segment [(a(n),n),(n,a(n))] coincides with the middle point C of the symmetric Dyck path.
The three line segments [(a(n),n),C], [(n,a(n)),C] and [(n,n),C] have the same length.
For n > 2 the points (n,n), C and (a(n),n) are the vertices of a virtual isosceles right triangle.
For n > 2 the points (n,n), C and (n,a(n)) are the vertices of a virtual isosceles right triangle.
For n > 2 the points (a(n),n), (n,n) and (n,a(n)) are the vertices of a virtual isosceles right triangle.

Examples

			For n = 14 the 14th row of A237591 is [8, 3, 1, 2] hence the alternating row sum is 8 - 3 + 1 - 2 = 4, so a(14) = 4.
On the other hand the 14th row of A237593 is the 14th row of A237591 together with the 14 th row of A237591 in reverse order as follows: [8, 3, 1, 2, 2, 1, 3, 8].
Then with the terms of the 14th row of A237593 we can draw a Dyck path in the first quadrant of the square grid as shown below:
.
         (y axis)
          .
          .
          .    (4,14)              (14,14)
          ._ _ _ . _ _ _ _            .
          .               |
          .               |
          .               |_
          .                 |
          .                 |_ _
          .                C    |_ _ _
          .                           |
          .                           |
          .                           |
          .                           |
          .                           . (14,4)
          .                           |
          .                           |
          . . . . . . . . . . . . . . | . . . (x axis)
        (0,0)
.
In the example the point C is the point (9,9).
The three line segments [(4,14),(9,9)], [(14,4),(9,9)] and [(14,14),(9,9)] have the same length.
The points (14,14), (9,9) and (4,14) are the vertices of a virtual isosceles right triangle.
The points (14,14), (9,9) and (14,4) are the vertices of a virtual isosceles right triangle.
The points (4,14), (14,14) and (14,4) are the vertices of a virtual isosceles right triangle.
		

Crossrefs

Other alternating row sums (ARS) related to the Dyck paths of A237593 and the stepped pyramid described in A245092 are as follows:
ARS of A237593 give A000004.
ARS of A196020 give A000203.
ARS of A252117 give A000203.
ARS of A271343 give A000593.
ARS of A231347 give A001065.
ARS of A236112 give A004125.
ARS of A236104 give A024916.
ARS of A249120 give A024916.
ARS of A271344 give A033879.
ARS of A231345 give A033880.
ARS of A239313 give A048050.
ARS of A237048 give A067742.
ARS of A236106 give A074400.
ARS of A235794 give A120444.
ARS of A266537 give A146076.
ARS of A236540 give A153485.
ARS of A262612 give A175254.
ARS of A353690 give A175254.
ARS of A239446 give A235796.
ARS of A239662 give A239050.
ARS of A235791 give A240542.
ARS of A272026 give A272027.
ARS of A211343 give A336305.

Programs

  • PARI
    row235791(n) = vector((sqrtint(8*n+1)-1)\2, i, 1+(n-(i*(i+1)/2))\i);
    a(n) = my(orow = concat(row235791(n), 0)); vecsum(vector(#orow-1, i, (-1)^(i+1)*(orow[i] - orow[i+1]))); \\ Michel Marcus, Apr 13 2025

Formula

a(n) = 2*A240542(n) - n.
a(n) = n - 2*A322141(n).
a(n) = A240542(n) - A322141(n).
Showing 1-4 of 4 results.