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.

A235796 2*n - 1 - sigma(n).

Original entry on oeis.org

0, 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
Offset: 1

Views

Author

Omar E. Pol, Jan 25 2014

Keywords

Comments

Partial sums give A004125.
Also 0 together with A120444.
It appears that a(n) = 0 iff n is a power of 2.
Numbers n with a(n) = 0 are called "almost perfect", "least deficient" or "slightly defective" numbers. See A000079. - Robert Israel, Jul 22 2014
a(n) = n - 2 iff n is prime.
a(n) = -1 iff n is a perfect number.
Also the alternating row sums of A239446. - Omar E. Pol, Jul 21 2014

Examples

			.     The positive     The sum of
n     odd numbers     divisors of n.      a(n)
1          1                1               0
2          3                3               0
3          5                4               1
4          7                7               0
5          9                6               3
6         11               12              -1
7         13                8               5
8         15               15               0
9         17               13               4
10        19               18               1
...
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, New York, 2004.

Crossrefs

Programs

  • Magma
    [2*n-1-SumOfDivisors(n): n in [1..100]]; // Vincenzo Librandi, Feb 25 2014
  • Mathematica
    Table[2n-1-DivisorSigma[1,n],{n,70}] (* Harvey P. Dale, Jul 11 2014 *)
  • PARI
    vector(100, n, (2*n-1)-sigma(n)) \\ Colin Barker, Jan 27 2014
    

Formula

a(n) = A005408(n-1) - A000203(n).
a(n) = -1 - A033880(n). - Michel Marcus, Jan 27 2014
a(n) = n - 1 - A001065(n). - Omar E. Pol, Jan 29 2014
a(n) = A033879(n) - 1. - Omar E. Pol, Jan 30 2014
a(n) = 2*n - 2 - A039653(n). - Omar E. Pol, Jan 31 2014
a(n) = (-1)*A237588(n). - Omar E. Pol, Feb 23 2014
a(n) = 2*n - A088580(n). - Omar E. Pol, Mar 23 2014

A239662 Triangle read by rows: T(n,k), n>=1, k>=1, in which column k lists the numbers A017113 interleaved with k-1 zeros, and the first element of column k is in row k(k+1)/2.

Original entry on oeis.org

4, 12, 20, 4, 28, 0, 36, 12, 44, 0, 4, 52, 20, 0, 60, 0, 0, 68, 28, 12, 76, 0, 0, 4, 84, 36, 0, 0, 92, 0, 20, 0, 100, 44, 0, 0, 108, 0, 0, 12, 116, 52, 28, 0, 4, 124, 0, 0, 0, 0, 132, 60, 0, 0, 0, 140, 0, 36, 20, 0, 148, 68, 0, 0, 0, 156, 0, 0, 0, 12, 164, 76, 44, 0, 0, 4, 172, 0, 0, 28, 0, 0, 180, 84, 0, 0, 0, 0, 188, 0, 52, 0, 0, 0
Offset: 1

Views

Author

Omar E. Pol, Mar 30 2014

Keywords

Comments

Gives an identity for A239050. Alternating sum of row n equals A239050(n), i.e., Sum_{k=1..A003056(n)} (-1)^(k-1)*T(n,k) = 4*A000203(n) = 2*A074400(n) = A239050(n).
Row n has length A003056(n) hence the first element of column k is in row A000217(k).
Note that if T(n,k) = 12 then T(n+1,k+1) = 4, the first element of the column k+1.
The number of positive terms in row n is A001227(n).
For more information see A196020.
Column 1 is A017113. - Omar E. Pol, Apr 17 2016

Examples

			Triangle begins:
  4;
  12;
  20,   4;
  28,   0;
  36,  12;
  44,   0,  4;
  52,  20,  0;
  60,   0,  0;
  68,  28, 12;
  76,   0,  0,  4;
  84,  36,  0,  0;
  92,   0, 20,  0;
  100, 44,  0,  0;
  108,  0,  0, 12;
  116, 52, 28,  0,  4;
  124,  0,  0,  0,  0;
  132, 60,  0,  0,  0;
  140,  0, 36, 20,  0;
  148, 68,  0,  0,  0;
  156,  0,  0,  0, 12;
  164, 76, 44,  0,  0,  4;
  172,  0,  0, 28,  0,  0;
  180, 84,  0,  0,  0,  0;
  188,  0, 52,  0,  0,  0;
  ...
For n = 9, the 9th row of triangle is [68, 28, 12], therefore the alternating row sum is 68 - 28 + 12 = 52. On the other hand we have that 4*A000203(9) = 2*A074400(9) = A239050(9) = 4*13 = 2*26 = 52, equaling the alternating sum of the 9th row of the triangle.
		

Crossrefs

Formula

T(n,k) = 2*A236106(n,k) = 4*A196020(n,k).

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