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.

Previous Showing 81-87 of 87 results.

A329970 a(n) = (-1)^(n + 1) * n * ceiling(n/2) + Sum_{k=1..n} (-1)^k * k^2 * floor(n/k).

Original entry on oeis.org

0, 0, -2, 3, 0, -3, -7, 16, 2, -15, -21, 31, 24, -15, -57, 34, 25, -17, -27, 77, 8, -99, -111, 155, 117, -36, -140, 40, 25, -80, -96, 259, 112, -157, -249, 202, 183, -156, -354, 224, 203, -40, -62, 342, -21, -524, -548, 562, 488, -34, -358, 194, 167, -262
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 26 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(-1)^(n + 1) n Ceiling[n/2] + Sum[(-1)^k k^2 Floor[n/k], {k, 1, n}], {n, 1, 54}]
    nmax = 54; CoefficientList[Series[x (1 - x + 2 x^2)/((1 - x)^2 (1 + x)^3) + 1/(1 - x) Sum[(-1)^k k^2 x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[Sum[(-1)^(k + 1) Mod[n, k] k, {k, 1, n}], {n, 1, 54}]
  • PARI
    a(n) = (-1)^(n + 1)*n*ceil(n/2) + sum(k=1, n, (-1)^k * k^2 * (n\k)); \\ Michel Marcus, Sep 20 2021

Formula

G.f.: x * (1 - x + 2*x^2) / ((1 - x)^2 * (1 + x)^3) + (1/(1 - x)) * Sum_{k>=1} (-1)^k * k^2 * x^k / (1 - x^k).
a(n) = Sum_{k=1..n} (-1)^(k + 1) * (n mod k) * k.

A024925 Sum of remainders of n mod prime(k), for k = 1,2,3,...,n.

Original entry on oeis.org

1, 2, 4, 9, 13, 19, 25, 38, 52, 64, 74, 92, 104, 122, 143, 172, 188, 218, 236, 268, 299, 329, 351, 393, 437, 473, 523, 569, 597, 646, 676, 737, 788, 836, 893, 959, 995, 1049, 1110, 1182, 1222, 1293, 1335, 1409, 1490, 1556, 1602, 1692, 1782, 1874, 1955, 2043, 2095, 2197, 2290
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+[n mod NthPrime(k): k in [1..n]]:n in [1..55]]; // Marius A. Burtea, Jul 16 2019
    
  • PARI
    a(n) = sum(k=1, n, n % prime(k)); \\ Michel Marcus, Jul 18 2019
    
  • PARI
    a(n) = my(s=0); forprime(p=2, prime(n), s += n%p); s; \\ Michel Marcus, Jul 18 2019

Formula

G.f.: x * (1 + x)/(1 - x)^3 - (1/(1 - x)) * Sum_{k>=1} prime(k) * x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jul 16 2019

A161678 Sum of c mod k for k from (smallest prime factor of c) to (largest prime factor of c) where c is composite(n).

Original entry on oeis.org

0, 0, 0, 0, 3, 0, 10, 3, 0, 0, 2, 5, 22, 0, 0, 34, 0, 8, 2, 0, 22, 61, 5, 0, 77, 42, 1, 4, 26, 1, 105, 0, 0, 4, 59, 35, 0, 20, 5, 65, 172, 0, 207, 9, 0, 30, 17, 66, 123, 7, 0, 290, 3, 82, 17, 33, 2, 0, 343, 4, 48, 384, 197, 27, 2, 15, 99, 201, 470, 94, 0, 9, 23, 1, 61, 36, 4, 573, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 16 2009

Keywords

Comments

"composite(n)" stands for "n-th composite number", so composite(1) to composite(8) are 4, 6, 8, 9, 10, 12, 14, 15.

Examples

			composite(2) = 6; (smallest prime factor of 6) = 2, (largest prime factor of 6) = 3. Hence a(2) = (6 mod 2)+(6 mod 3) = 0+0 = 0.
composite(5) = 10; (smallest prime factor of 10) = 2, (largest prime factor of 10) = 5. Hence a(5) = (10 mod 2)+(10 mod 3)+(10 mod 4)+(10 mod 5) = 0+1+2+0 = 3.
composite(7) = 14; (smallest prime factor of 14) = 2, (largest prime factor of 14) = 7. Hence a(7) = (14 mod 2)+(14 mod 3)+(14 mod 4)+(14 mod 5)+(14 mod 6)+(14 mod 7) = 0+2+2+4+2+0 = 10.
		

Crossrefs

Cf. A002808 (composite numbers), A004125 (sum of n mod k for k=1..n), A161517 (sum of c mod k for k=1..c where c is composite(n)).

Programs

  • Magma
    [ &+[ n mod k: k in [D[1]..D[ #D]] where D is PrimeDivisors(n) ]: n in [4..110] | not IsPrime(n) ]; // Klaus Brockhaus, Jun 24 2009

Extensions

Edited, corrected (a(22)=63 replaced by 61, a(25)=78 replaced by 77) and extended by Klaus Brockhaus, Jun 24 2009

A166247 Number of perfect partitions of n-1 plus sum of remainders of n mod k, for k=1,2,3,..,n.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 9, 12, 14, 16, 23, 25, 29, 34, 39, 44, 52, 55, 65, 69, 73, 80, 99, 105, 105, 115, 129, 132, 152, 151, 168, 183, 187, 200, 221, 224, 234, 251, 272, 278, 298, 297, 326, 336, 347, 361, 404, 422, 416, 428, 452, 462, 506, 512, 532, 540, 556, 581, 636
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 10 2009

Keywords

Crossrefs

Formula

a(n)=A002033(n-1)+A004125(n).

Extensions

Indices in definition and formula corrected by R. J. Mathar, May 21 2010

A302800 Irregular triangle read by rows: T(n,k) is the area of the k-th region of the diagram with n rows described in A237591.

Original entry on oeis.org

1, 3, 5, 1, 8, 2, 11, 4, 15, 5, 1, 19, 7, 2, 24, 9, 3, 29, 11, 5, 35, 13, 6, 1, 41, 16, 7, 2, 48, 18, 9, 3, 55, 21, 11, 4, 63, 24, 12, 6, 71, 27, 14, 7, 1, 80, 30, 16, 8, 2, 89, 34, 18, 9, 3, 99, 37, 20, 11, 4, 109, 41, 22, 13, 5, 120, 45, 24, 14, 7, 131, 49, 27, 15, 8, 1, 143, 53, 29, 17, 9, 2
Offset: 1

Views

Author

Omar E. Pol, Apr 13 2018

Keywords

Comments

Column k lists the partial sums of the k-th column of triangle A237591.
We can see this sequence in the front view of the pyramid described in A245092.

Examples

			Triangle begins:
    1;
    3;
    5,  1;
    8,  2;
   11,  4;
   15,  5,  1;
   19,  7,  2;
   24,  9,  3;
   29, 11,  5;
   35, 13,  6,  1;
   41, 16,  7,  2;
   48, 18,  9,  3;
   55, 21, 11,  4;
   63, 24, 12,  6;
   71, 27, 14,  7,  1;
   80, 30, 16,  8,  2;
   89, 34, 18,  9,  3;
   99, 37, 20, 11,  4;
  109, 41, 22, 13,  5;
  120, 45, 24, 14,  7;
  131, 49, 27, 15,  8,  1;
...
Illustration for n = 10:
We draw the first 10 rows of the infinite diagram described in A237591 as shown below:
Row                           _
1                           _| |
2                         _|  _|
3                       _|   | |
4                     _|    _| |
5                   _|     |  _|
6                 _|      _| | |
7               _|       |   | |
8             _|        _|  _| |
9           _|         |   |  _|
10         |_ _ _ _ _ _|_ _|_|_|
Area             35     13  6 1
.
The diagram contains four regions and the areas of the successives regions from left to right are respectively [35, 13, 6, 1], so the 10th row of this triangle is [35, 13, 6, 1].
Note that this infinite diagram gives a correspondence between the number of partitions into k consecutive parts and the symmetric representation of A000203, A024916, A004125 and many other integer sequences. For more information see A196020, A236104, A235791, A237048, A237593, A262626, A286000 and A286001.
		

Crossrefs

Row n has length A003056(n) hence column k starts in row A000217(k).
Row sums give A000217, n >= 1.
Column 1 gives A024206 without its initial zero.
Column 2 gives the partial sums of the A261348.

A341270 a(n) = Sum_{k=1..n} a(n mod k) for n > 0; a(0) = 1.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 7, 10, 12, 15, 17, 25, 24, 32, 37, 45, 46, 63, 62, 82, 83, 97, 104, 141, 130, 158, 170, 201, 202, 255, 242, 302, 306, 350, 367, 448, 416, 503, 522, 610, 597, 716, 690, 825, 832, 921, 945, 1147, 1085, 1255, 1272, 1430, 1435, 1683, 1631, 1888
Offset: 0

Views

Author

Rok Cestnik, Feb 07 2021

Keywords

Examples

			a(1) = a(1 mod 1) = a(0) = 1.
a(2) = a(2 mod 1)+a(2 mod 2) = a(0)+a(0) = 2.
a(3) = a(3 mod 1)+a(3 mod 2)+a(3 mod 3) = a(0)+a(1)+a(0) = 3.
		

Crossrefs

For Sum_{k=1..n} n mod k see A004125.
For Sum_{k=1..n} a(k) see A000079.
For Max_{k=1..n} a(n mod k)+1 see A113473.

Programs

  • Maple
    a:= proc(n) option remember;
         `if`(n=0, 1, add(a(n mod k), k=1..n))
        end:
    seq(a(n), n=0..62);  # Alois P. Heinz, Feb 07 2021
  • Mathematica
    a[0] = 1; a[n_] := a[n] = Sum[a[Mod[n, k]], {k, 1, n}]; Array[a, 50, 0] (* Amiram Eldar, Feb 08 2021 *)
  • PARI
    a(n) = if (n==0, 1, sum(k=1, n, a(n % k))); \\ Michel Marcus, Feb 08 2021
  • Python
    a = [1]
    for n in range(1,1000):
        a.append(sum(a[n%k] for k in range(1,n+1)))
    

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

  • Mathematica
    A380231[n_] := 2*Sum[(-1)^(k + 1)*Ceiling[(n + 1)/k - (k + 1)/2], {k,  Quotient[Sqrt[8*n + 1] - 1, 2]}] - n;
    Array[A380231 , 100] (* Paolo Xausa, Sep 06 2025 *)
  • 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).
Previous Showing 81-87 of 87 results.