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

A235799 a(n) = n^2 - sigma(n).

Original entry on oeis.org

0, 1, 5, 9, 19, 24, 41, 49, 68, 82, 109, 116, 155, 172, 201, 225, 271, 285, 341, 358, 409, 448, 505, 516, 594, 634, 689, 728, 811, 828, 929, 961, 1041, 1102, 1177, 1205, 1331, 1384, 1465, 1510, 1639, 1668, 1805, 1852, 1947, 2044, 2161, 2180, 2344, 2407
Offset: 1

Views

Author

Omar E. Pol, Jan 24 2014

Keywords

Comments

From Omar E. Pol, Apr 11 2021: (Start)
If n is prime (A000040) then a(n) = n^2 - n - 1.
If n is a power of 2 (A000079) then a(n) = (n-1)^2.
If n is a perfect number (A000396) then a(n) = (n-1)^2 - 1, assuming there are no odd perfect numbers.
In order to construct the diagram of the symmetric representation of a(n) we use the following rules:
At stage 1 in the first quadrant of the square grid we draw the symmetric representation of sigma(n) using the two Dyck paths described in the rows n and n-1 of A237593. The area of the region that is below the symmetric representation of sigma(n) equals A024916(n-1).
At stage 2 we draw a pair of orthogonal line segments (if it's necessary) such that in the drawing appears totally formed a square n X n. The area of the region that is above the symmetric representation of sigma(n) equals A004125(n).
At stage 3 we turn OFF the cells of the symmetric representation of sigma(n). Then we turn ON the rest of the cells that are in the square n X n. The result is that the ON cell form the diagram of the symmetric representation of a(n). See the Example section. (End)

Examples

			From _Omar E. Pol, Apr 04 2021: (Start)
Illustration of initial terms in the first quadrant for n = 1..6:
.
.                                                             y|        _ _
.                                              y|      _ _     |_ _ _  |_  |
.                                 y|      _     |_ _ _|   |    |     |   |_|
.                      y|    _     |_ _  |_|    |        _|    |     |_ _
.             y|        |_ _|_|    |   |_       |       |      |         |
.      y|      |_       |   |      |     |      |       |      |         |
.       |_ _   |_|_ _   |_ _|_ _   |_ _ _|_ _   |_ _ _ _|_ _   |_ _ _ _ _|_ _
.          x        x          x            x              x                x
.
n:        1       2         3           4             5               6
a(n):     0       1         5           9            19              24
.
Illustration of initial terms in the first quadrant for n = 7..9:
.                                                y|          _ _ _ _
.                          y|          _ _ _      |_ _ _ _ _|       |
.      y|        _ _ _      |_ _ _ _  |     |     |          _ _    |
.       |_ _ _ _|     |     |       | |_    |     |         |_  |   |
.       |             |     |       |_  |_ _|     |           |_|  _|
.       |            _|     |         |_ _        |               |
.       |           |       |             |       |               |
.       |           |       |             |       |               |
.       |           |       |             |       |               |
.       |_ _ _ _ _ _|_ _    |_ _ _ _ _ _ _|_ _    |_ _ _ _ _ _ _ _|_ _
.                      x                     x                       x
.
n:              7                    8                      9
a(n):          41                   49                     68
.
For n = 9 the figures 1, 2 and 3 below show respectively the three stages described in the Comments section as follows:
.
.   y|_ _ _ _ _ 5            y|_ _ _ _ _ _ _ _ _      y|          _ _ _ _
.    |_ _ _ _ _|              |_ _ _ _ _|       |      |_ _ _ _ _|       |
.    |         |_ _ 3         |         |_ _ R  |      |          _ _    |
.    |         |_  |          |         |_  |   |      |         |_  |   |
.    |           |_|_ _ 5     |           |_|_ _|      |           |_|  _|
.    |               | |      |               | |      |               |
.    |      Q        | |      |       Q       | |      |               |
.    |               | |      |               | |      |               |
.    |               | |      |               | |      |               |
.    |_ _ _ _ _ _ _ _|_|_     |_ _ _ _ _ _ _ _|_|_     |_ _ _ _ _ _ _ _|_ _
.                       x                        x                        x
.         Figure 1.                Figure 2.                Figure 3.
.         Symmetric                Symmetric                Symmetric
.       representation           representation           representation
.         of sigma(9)              of sigma(9)             of a(9) = 68
.       A000203(9) = 13          A000203(9) = 13
.           and of                   and of
.     Q = A024916(8) = 56      R = A004125(9) = 12
.                              Q = A024916(8) = 56
.
Note that the symmetric representation of a(9) contains a hole formed by three cells because these three cells were the central part of the symmetric representation of sigma(9). (End)
		

Crossrefs

Programs

  • Magma
    [n^2 - DivisorSigma(1,n): n in [1..50]]; // G. C. Greubel, Oct 31 2018
  • Mathematica
    Table[n^2-DivisorSigma[1,n],{n,50}] (* Harvey P. Dale, Sep 02 2016 *)
  • PARI
    vector(50, n, n^2 - sigma(n)) \\ G. C. Greubel, Oct 31 2018
    

Formula

a(n) = A000290(n) - A000203(n).
a(n) = A024916(n-1) + A004125(n), n > 1.
G.f.: x*(1 + x)/(1 - x)^3 - Sum_{k>=1} x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Mar 17 2017
From Omar E. Pol, Apr 10 2021: (Start)
a(n) = A024816(n) + A000217(n-1).
a(n) = A067436(n) + A153485(n) + A244048(n). (End)

A342344 Number of parts in the symmetric representation of antisigma(n).

Original entry on oeis.org

0, 0, 2, 3, 1, 3, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2
Offset: 1

Views

Author

Omar E. Pol, Mar 08 2021

Keywords

Comments

In order to construct this sequence and the diagram of the symmetric representation of antisigma(n) = A024816(n) we use the following rules:
At stage 1 in the first quadrant of the square grid we draw the symmetric representation of sigma(n) using the two Dyck paths described in the rows n and n-1 of A237593. The area of the region that is below the symmetric representation of sigma(n) equals A024916(n-1).
At stage 2 we draw a pair of orthogonal line segments (if it's necessary) such that in the drawing appears totally formed a square n X n. The area of the region that is above the symmetric representation of sigma(n) equals A004125(n). Then we draw a zig-zag path with line segments of length 1 from (0,n-1) to (n-1,0) such that appears a staircase with n-1 steps. The area of the region (or regions) that is below the symmetric representation of sigma(n) and above the staircase equals A244048(n) = A153485(n-1). The area of the region that is below the staircase equals A000217(n-1).
At stage 3 we turn OFF the cells of the symmetric representation of sigma(n) and also the cells that are below the staircase. Then we turn ON the rest of the cells that are in the square n X n. The result is that the ON cell form the diagram of the symmetric representation of antisigma(n) = A024816(n). See the Example section.
For n >= 7; if A237271(n) = 1 or n is a term of A262259 then a(n) = 2 otherwise a(n) = 1.

Examples

			Illustration of the symmetric representation of antisigma(n) = AS(n) = A024816(n), for n = 1..6:
.                                                             y|        _ _
.                                              y|      _ _     |  _ _  |_  |
.                                 y|      _     |  _ _|   |    | |_  |   |_|
.                      y|    _     |  _  |_|    | |_     _|    |   |_|_ _
.             y|        |  _|_|    | |_|_       |   |_  |      |     |_  |
.      y|      |        | |_|      |   |_|      |     |_|      |       |_|
.       |_ _   |_ _ _   |_ _ _ _   |_ _ _ _ _   |_ _ _ _ _ _   |_ _ _ _ _ _ _
.          x        x          x            x              x                x
.
n:        1       2         3           4             5               6
a(n):     0       0         2           3             1               3
AS(n):    0       0         2           3             9               9
.
Illustration of the symmetric representation of antisigma(n) = AS(n) = A024816(n), for n = 7..9:
.                                                y|          _ _ _ _
.                          y|          _ _ _      |  _ _ _ _|       |
.      y|        _ _ _      |  _ _ _  |     |     | |_       _ _    |
.       |  _ _ _|     |     | |_    | |_    |     |   |_    |_  |   |
.       | |_          |     |   |_  |_  |_ _|     |     |_    |_|  _|
.       |   |_       _|     |     |_  |_ _        |       |_      |
.       |     |_    |       |       |_    |       |         |_    |
.       |       |_  |       |         |_  |       |           |_  |
.       |         |_|       |           |_|       |             |_|
.       |_ _ _ _ _ _ _ _    |_ _ _ _ _ _ _ _ _    |_ _ _ _ _ _ _ _ _ _
.                      x                     x                       x
.
n:              7                    8                      9
a(n):           1                    2                      1
AS(n):         20                   21                     32
.
For n = 9 the figures 1, 2 and 3 below show respectively the three stages described in the Comments section as follows:
.
.   y|_ _ _ _ _ 5            y|_ _ _ _ _ _ _ _ _      y|          _ _ _ _
.    |_ _ _ _ _|              |_ _ _ _ _|       |      |  _ _ _ _|       |
.    |         |_ _ 3         | |_      |_ _ R  |      | |_       _ _    |
.    |         |_  |          |   |_    |_  |   |      |   |_    |_  |   |
.    |           |_|_ _ 5     |     |_ T  |_|_ _|      |     |_    |_|  _|
.    |               | |      |       |_      | |      |       |_      |
.    |      Q        | |      |         |_    | |      |         |_    |
.    |               | |      |    W      |_  | |      |           |_  |
.    |               | |      |             |_| |      |             |_|
.    |_ _ _ _ _ _ _ _|_|_     |_ _ _ _ _ _ _ _|_|_     |_ _ _ _ _ _ _ _ _ _
.                       x                        x                        x
.         Figure 1.                Figure 2.                Figure 3.
.         Symmetric                Symmetric                Symmetric
.       representation           representation           representation
.         of sigma(9)              of sigma(9)            of antisigma(9)
.       A000203(9) = 13          A000203(9) = 13          A024816(9) = 32
.           and of                   and of
.     Q = A024916(8) = 56      R = A004125(9) = 12
.                              T = A244048(9) = 20
.                              T = A153485(8) = 20
.                              W = A000217(8) = 36
.
Note that the symmetric representation of antisigma(9) contains a hole formed by three cells because these three cells were the central part of the symmetric representation of sigma(9).
		

Crossrefs

A050482 Sum of remainders when n-th prime is divided by all preceding integers.

Original entry on oeis.org

0, 1, 4, 8, 22, 28, 51, 64, 98, 151, 167, 233, 297, 325, 403, 505, 635, 645, 790, 904, 923, 1113, 1244, 1422, 1654, 1800, 1888, 2056, 2098, 2256, 2849, 3066, 3326, 3450, 3969, 4045, 4329, 4696, 5014, 5325, 5767, 5759, 6499, 6565, 6898
Offset: 1

Views

Author

Brian Wallace (wallacebrianedward(AT)yahoo.co.uk), Dec 26 1999

Keywords

Comments

a(n)/(n*log(n))^2 appears to approach a constant ~0.22... for large n. - Benedict W. J. Irwin, Dec 07 2016
Irwin's comment is incorrect. - Bill McEachen, Feb 04 2024. [Indeed, according to the first formula in A004125, a(n)/(n*log(n))^2 approaches a constant, which is not 0.22 but 1-Pi^2/12 = 0.1775... - Amiram Eldar, Feb 04 2024]

Examples

			a(4) = 8 because remainders when 7 is divided by 1..6 are 0,1,1,3,2,1, which add to 8.
a(2) = 3 mod (3-1) = 1.
a(3) = (5 mod (5-1)) + (5 mod (5-2)) + (5 mod (5-3)) = 2 + 1 + 1 = 4.
		

Crossrefs

Programs

  • Maple
    A050482 := proc(n) local a,i; a := 0; for i from 1 to ithprime(n)-1 do a := a+(ithprime(n) mod i); od: end;
  • Mathematica
    Table[Sum[Mod[Prime[n],k],{k,Prime[n]-1}],{n,45}] (* James C. McMahon, Feb 08 2024 *)
  • PARI
    a(n)=my(p=prime(n));sum(k=2, p, p%k) \\ Charles R Greathouse IV, Jun 03 2013
    
  • Python
    from math import isqrt
    from sympy import prime
    def A050482(n): return (p:=prime(n))**2+((s:=isqrt(p))**2*(s+1)-sum((q:=p//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) # Chai Wah Wu, Nov 01 2023

Formula

a(n) = A004125(A000040(n)). - R. J. Mathar, Jun 12 2009

A099726 Sum of remainders of the n-th prime mod k, for k = 1,2,3,...,n.

Original entry on oeis.org

0, 1, 3, 5, 7, 7, 14, 18, 28, 30, 31, 26, 38, 45, 63, 71, 93, 75, 96, 115, 101, 142, 161, 167, 152, 159, 203, 224, 219, 222, 216, 250, 263, 296, 341, 320, 319, 349, 433, 427, 496, 419, 487, 481, 538, 537, 495, 631, 635, 676, 697, 777, 665, 820, 784, 874, 929, 856
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Nov 07 2004

Keywords

Examples

			a(7)=14 because the 7th prime is 17 and its remainders modulo 1,2,3,4,5,6,7 are 0,1,2,1,2,5,3 respectively and 0+1+2+1+2+5+3=14.
		

Crossrefs

Programs

  • Maple
    umpf:=n->add(modp(floor(ithprime(n)),m),m=1..n); seq(umpf(k),k=1..120);
  • Mathematica
    Table[Total[Mod[Prime[p],Range[p]]],{p,Range[60]}] (* Harvey P. Dale, Feb 09 2025 *)
  • PARI
    a(n) = my(p=prime(n)); sum(k=1, n, p%k); \\ Daniel Suteu, Feb 02 2021
    
  • PARI
    T(n) = n*(n+1)/2;
    S(n) = my(s=sqrtint(n)); sum(k=1, s, T(n\k) + k*(n\k)) - s*T(s); \\ A024916
    g(a,b) = my(s=0); while(a <= b, my(t=b\a); my(u=b\t); s += t*(T(u) - T(a-1)); a = u+1); s;
    a(n) = my(p=prime(n)); n*p - S(p) + g(n+1, p); \\ Daniel Suteu, Feb 02 2021

Formula

a(n) = n*p - A024916(p) + Sum_{k=n+1..p} k*floor(p/k), where p = prime(n). - Daniel Suteu, Feb 02 2021

Extensions

Definition corrected by Daniel Suteu, Feb 02 2021

A180491 Product of remainders of n mod k, for k = 2,3,4,...,n-1.

Original entry on oeis.org

1, 1, 1, 0, 2, 0, 6, 0, 0, 0, 720, 0, 2160, 0, 0, 0, 2419200, 0, 65318400, 0, 0, 0, 754427520000, 0, 0, 0, 0, 0, 32953394073600000, 0, 311409573995520000, 0, 0, 0, 0, 0, 37269497815783833600000, 0, 0, 0, 7890485108998805913600000000, 0
Offset: 1

Views

Author

Carl R. White, Sep 08 2010

Keywords

Comments

a(n) is zero where n is composite and is trivially less than or equal to n! when n is prime or 1.
a(n)=0 iff n is composite. See A180492. - Robert G. Wilson v, Sep 09 2010

Examples

			a(7) = (7 mod 2) * (7 mod 3) * (7 mod 4) * (7 mod 5) * (7 mod 6) = 1 * 1 * 3 * 2 * 1 = 6.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n=1 then 1; elif isprime(n)=true then mul(n mod i, i=2..n-1); else 0; fi: end: seq(a(n), n=1..60); # Ridouane Oudra, Nov 01 2024
  • Mathematica
    f[n_] := Times @@ Mod[n, Range[2, n - 1]]; Array[f, 42] (* Robert G. Wilson v, Sep 09 2010 *)

Formula

a(n) = A080339(n)*A173392(n). - Ridouane Oudra, Nov 01 2024

A236630 Irregular triangle T(n,k) of alternating sums of squares of entries in the rows in the triangle of A235791, read by rows.

Original entry on oeis.org

1, 4, 9, 8, 16, 15, 25, 21, 36, 32, 33, 49, 40, 41, 64, 55, 56, 81, 65, 69, 100, 84, 88, 87, 121, 96, 100, 99, 144, 119, 128, 127, 169, 133, 142, 141, 196, 160, 169, 165, 225, 176, 192, 188, 189, 256, 207, 223, 219, 220, 289, 225, 241, 237, 238
Offset: 1

Views

Author

Omar E. Pol, Jan 29 2014

Keywords

Comments

The original name was: Number of "ON" cells at n-th stage in a cellular automaton (or pseudo cellular automaton) related to sigma (see Comments for precise definition).

Examples

			Triangle begins:
    1;
    4;
    9,   8;
   16,  15;
   25,  21;
   36,  32,  33;
   49,  40,  41;
   64,  55,  56;
   81,  65,  69;
  100,  84,  88,  87;
  121,  96, 100,  99;
  144, 119, 128, 127;
  169, 133, 142, 141;
  196, 160, 169, 165;
  225, 176, 192, 188, 189;
  256, 207, 223, 219, 220;
  289, 225, 241, 237, 238;
  ...
From _Omar E. Pol_, Apr 20 2024: (Start)
Illustration of the 6th row as the area of a polygon (or the number of cells) in the fourth quadrant:
.     _ _ _ _ _ _       _ _ _ _ _ _       _ _ _ _ _ _
.    |           |     |           |     |           |
.    |           |     |           |     |           |
.    |           |     |           |     |           |
.    |           |     |        _ _|     |          _|
.    |           |     |       |         |        _|
.    |_ _ _ _ _ _|     |_ _ _ _|         |_ _ _ _|
.
.          36           36 - 4 = 32     36 - 4 + 1 = 33
.
(End)
		

Crossrefs

Row n has length A003056(n).
The first element of column k is in row A000217(k).
Column 1 gives the positive terms of A000290.
Right border gives A024916.
Row n is the alternating sum of entries in row n of A236104.

Programs

  • Mathematica
    Map[Accumulate, Table[(-2 Boole[EvenQ[k]] + 1)*Ceiling[(n + 1)/k - (k + 1)/2]^2, {n, 20}, {k, Floor[(Sqrt[8*n + 1] - 1)/2]}]] // Flatten (* Michael De Vlieger, Apr 30 2024, after Hartmut F. W. Hoft at A235791 *)

Formula

From Hartmut F. W. Hoft, Apr 30 2024: (Start)
T(n, k) = Sum_{j = 1 .. k} (-1)^(j + 1) * S(n, j)^2, n >= 0, 1 <= k <= A003056(n), where S(n, j) is the j-th entry in the n-th row of the triangle of A235791.
T(n, k) = Sum_{j = 1 .. k} (-1)^(j+1) * S(n, j), n >= 0, 1 <= k <= A003056(n), where S(n, j) is the j-th entry in the n-th row of the triangle of A236104. (End)

Extensions

New name from Hartmut F. W. Hoft, Apr 27 2024
0 removed, offset changed and minor edits from Omar E. Pol, Apr 28 2024

A236631 Triangle read by rows: T(j,k), j>=1, k>=1, in which column k lists the positive squares repeated k-1 times, except the column 1 which is A123327. The elements of the even-indexed columns are multiplied by -1. The first element of column k is in row k(k+1)/2.

Original entry on oeis.org

1, 3, 5, -1, 8, -1, 10, -4, 15, -4, 1, 16, -9, 1, 23, -9, 1, 25, -16, 4, 31, -16, 4, -1, 34, -25, 4, -1, 45, -25, 9, -1, 42, -36, 9, -1, 55, -36, 9, -4, 60, -49, 16, -4, 1, 67, -49, 16, -4, 1, 69, -64, 16, -4, 1, 86, -64, 25, -9, 1, 84, -81, 25, -9, 1, 103
Offset: 1

Views

Author

Omar E. Pol, Jan 29 2014

Keywords

Comments

T(j,k) which row j has length A003056(j) hence the first element of column k is in row A000217(j).
Row sums give A000203.
Interpreted as a sequence with index n this is also the first differences of A236630. If a(n) is positive then a(n) is the number of cells turned ON at n-th stage in the structure of A236630. If a(n) is negative then a(n) is the number of cells turned OFF at n-th stage in the structure of A236630.

Examples

			Written as an irregular triangle the sequence begins:
1;
3;
5,     -1;
8,     -1;
10,    -4;
15,    -4,    1;
16,    -9,    1;
23,    -9,    1;
25,   -16,    4;
31,   -16,    4,   -1;
34,   -25,    4,   -1;
45,   -25,    9,   -1;
42,   -36,    9,   -1;
55,   -36,    9,   -4;
60,   -49,   16,   -4,   1;
67,   -49,   16,   -4,   1;
69,   -64,   16,   -4,   1;
86,   -64,   25,   -9,   1;
84,   -81,   25,   -9,   1;
103,  -81,   25,   -9,   4;
102, -100,   36,   -9,   4,  -1;
113, -100,   36,  -16,   4,  -1;
122, -121,   36,  -16,   4,  -1;
145, -121,   49,  -16,   4,  -1;
...
For j = 15 the divisors of 15 are 1, 3, 5, 15, therefore the sum of divisors of 15 is 1 + 3 + 5 + 15 = 24. On the other hand the 15th row of triangle is 60, -49, 16, -4, 1, therefore the row sum is 60 - 49 + 16 - 4 + 1 = 24, equalling the sum of divisors of 15.
		

Crossrefs

Formula

T(n,1) = A000203(n) + A004125(n).

A237588 Sigma(n) - 2n + 1.

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

Views

Author

Omar E. Pol, Feb 20 2014

Keywords

Comments

Also we can write Sigma(n) - (2n - 1).
a(n) = 2 - n iff n is prime.
a(n) = 1 iff n is a perfect number.
Conjecture: a(n) = 0 iff n is a power of 2.
The problem is not new. In fact, the following comments appeared on page 74 of Guy's book: "If Sigma(n) = 2*n - 1, n has been called almost perfect. Powers of 2 are almost perfect; it is not known if any other numbers are.". - Zhi-Wei Sun, Feb 23 2014

Examples

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

References

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

Crossrefs

Programs

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

Formula

a(n) = A000203(n) - A005408(n-1) = 1 - n + A001065(n) = 1 - A033879(n) = 1 + A033880(n) = (-1)*A235796(n).
a(n) = A088580(n) - 2*n. - Omar E. Pol, Mar 23 2014

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

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 3, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 7, 3, 0, 0, 0, 1, 0, 9, 0, 0, 0, 0, 5, 0, 0, 11, 0, 0, 0, 0, 0, 3, 0, 13, 7, 0, 1, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 9, 5, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 3, 0, 19, 11, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 21, 0
Offset: 1

Views

Author

Omar E. Pol, Mar 20 2014

Keywords

Comments

Alternating sum of row n equals A235796(n), i.e., sum_{k=1..A003056(n)} (-1)^(k-1)*T(n,k) = A235796(n).
Row n has length A003056(n) hence column k starts in row A000217(k).
Column k starts with k+1 zeros and then lists the odd numbers interleaved with k zeros.
It appears that row n lists all zeros iff n is a power of 2.

Examples

			Triangle begins:
0;
0;
1,  0;
0,  0;
3,  0;
0,  1,  0;
5,  0,  0;
0,  0,  0;
7,  3,  0;
0,  0,  1,  0;
9,  0,  0,  0;
0,  5,  0,  0;
11, 0,  0,  0;
0,  0,  3,  0;
13, 7,  0,  1,  0;
0,  0,  0,  0,  0;
15, 0,  0,  0,  0;
0,  9,  5,  0,  0;
17, 0,  0,  0,  0;
0,  0,  0,  3,  0;
19, 11, 0,  0,  1,  0;
0,  0,  7,  0,  0,  0;
21, 0,  0,  0,  0,  0;
0,  13, 0,  0,  0,  0;
23, 0,  0,  5,  0,  0;
...
For n = 15 the 15th row of triangle is 13, 7, 0, 1, and the alternating sum is 13 - 7 + 0 - 1 = A235796(15) = 5.
		

Crossrefs

A256532 Product of n and the sum of remainders of n mod k, for k = 1, 2, 3, ..., n.

Original entry on oeis.org

0, 0, 3, 4, 20, 18, 56, 64, 108, 130, 242, 204, 364, 434, 540, 576, 867, 846, 1216, 1220, 1470, 1694, 2254, 2040, 2575, 2912, 3375, 3472, 4379, 4140, 5177, 5344, 6072, 6698, 7630, 7128, 8621, 9424, 10491, 10320, 12177, 11928, 13975, 14432, 15255, 16468, 18941, 17952, 20286, 21000, 22899, 23608, 26765, 26568, 29095
Offset: 1

Views

Author

Omar E. Pol, May 03 2015

Keywords

Comments

a(n) is also the volume (or the total number of unit cubes) of a polycube which is a right prism whose base is the symmetric representation of A004125(n).
Note that the union of this right prism and the irregular staircase after n-th stage described in A244580 and the irregular stepped pyramid after (n-1)-th stage described in A245092, form a hexahedron (or cube) of side length n. This comment is represented by the third formula.

Examples

			a(5) = 20 because 5 * (0 + 1 + 2 + 1) = 5 * 4 = 20.
a(6) = 18 because 6 * (0 + 0 + 0 + 2 + 1) = 6 * 3 = 18.
a(7) = 56 because 7 * (0 + 1 + 1 + 3 + 2 + 1) = 7 * 8 = 56.
		

Crossrefs

Programs

  • Mathematica
    Table[n*Sum[Mod[n,i],{i,2,n-1}],{n,55}] (* Ivan N. Ianakiev, May 04 2015 *)
  • PARI
    vector(50, n, n*sum(k=1, n, n % k)) \\ Michel Marcus, May 05 2015
    
  • Python
    def A256532(n):
        s=0
        for k in range(1,n+1):
            s+=n%k
        return s*n # Indranil Ghosh, Feb 13 2017
    
  • Python
    from math import isqrt
    def A256532(n): return n**3+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

Formula

a(n) = n * A004125(n).
a(n) = n^3 - A256533(n).
a(n) = n^3 - A143128(n) - A175254(n-1), n > 1.
Previous Showing 51-60 of 87 results. Next