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 21-30 of 42 results. Next

A330926 a(n) = Sum_{k=1..n} (ceiling(n/k) mod 2).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 3, 2, 5, 3, 4, 3, 6, 5, 6, 3, 7, 6, 7, 6, 9, 6, 7, 6, 11, 9, 10, 7, 10, 9, 10, 9, 14, 11, 12, 9, 13, 12, 13, 10, 15, 14, 15, 14, 17, 12, 13, 12, 19, 17, 18, 15, 18, 17, 18, 15, 20, 17, 18, 17, 22, 21, 22, 17, 23, 20, 21, 20, 23, 20, 21, 20, 27, 26, 27, 22, 25, 22, 23, 22
Offset: 1

Views

Author

Ilya Gutkovskiy, May 25 2020

Keywords

Comments

a(n) = number of terms among {ceiling(n/k)}, 1 <= k <= n, that are odd.

Crossrefs

Programs

  • Maple
    b:= n-> add((-1)^d, d=numtheory[divisors](n)):
    a:= proc(n) option remember; `if`(n>0, 1+b(n-1)+a(n-1), 0) end:
    seq(a(n), n=1..80);  # Alois P. Heinz, May 25 2020
  • Mathematica
    Table[Sum[Mod[Ceiling[n/k], 2], {k, 1, n}], {n, 1, 80}]
    Table[n - Sum[DivisorSum[k, (-1)^(# + 1) &], {k, 1, n - 1}], {n, 1, 80}]
    nmax = 80; CoefficientList[Series[x/(1 - x) (1 + Sum[x^(2 k)/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, ceil(n/k) % 2); \\ Michel Marcus, May 25 2020
    
  • Python
    from math import isqrt
    def A330926(n): return n+(s:=isqrt(n-1))**2-((t:=isqrt(m:=n-1>>1))**2<<1)-(sum((n-1)//k for k in range(1,s+1))-(sum(m//k for k in range(1,t+1))<<1)<<1) # Chai Wah Wu, Oct 23 2023

Formula

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

A348389 Irregular triangle read by rows: row n gives for n >= 2 a concatenation of the finite sequences of the multiples of k, larger than k and not exceeding n, for k = 1, 2, ..., floor(n/2).

Original entry on oeis.org

2, 2, 3, 2, 3, 4, 4, 2, 3, 4, 5, 4, 2, 3, 4, 5, 6, 4, 6, 6, 2, 3, 4, 5, 6, 7, 4, 6, 6, 2, 3, 4, 5, 6, 7, 8, 4, 6, 8, 6, 8, 2, 3, 4, 5, 6, 7, 8, 9, 4, 6, 8, 6, 9, 8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, 6, 8, 10, 6, 9, 8, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 6, 8, 10, 6, 9, 8, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 6, 8, 10, 12, 6, 9, 12, 8, 12, 10, 12
Offset: 2

Views

Author

Wolfdieter Lang, Oct 31 2021

Keywords

Comments

The length of row n is A002541(n).
The sum of row n is A348392(n).
The lengths of the sublists for these multiples of k in row n are given by T(n, k) = A348388(n, k), for n >= 2 and k = 1, 2, ..., floor(n/2).

Examples

			The irregular triangle a(n, m) begins: (the k-sublists are separated by a vertical bar)
n\m   1 2 3 4 5 6 7 8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ...
-------------------------------------------------------------------------
2:    2
3:    2 3
4:    2 3 4|4
5:    2 3 4 5|4
6:    2 3 4 5 6|4 6|6
7:    2 3 4 5 6 7|4 6| 6
8:    2 3 4 5 6 7 8|4  6  8| 6| 8
9:    2 3 4 5 6 7 8 9| 4  6  8| 6  9| 8
10:   2 3 4 5 6 7 8 9 10| 4  6  8 10| 6  9| 8|10
11:   2 3 4 5 6 7 8 9 10 11| 4  6  8 10| 6  9| 8|10
12:   2 3 4 5 6 7 8 9 10 11 12| 4  6  8 10 12| 6  9 12| 8 12|10|12
13:   2 3 4 5 6 7 8 9 10 11 12 13| 4  6  8 10 12| 6  9 12| 8 12|10|12
...
		

Crossrefs

Programs

  • Mathematica
    nrows=10;Table[Flatten[Table[Range[2k,n,k],{k,Floor[n/2]}]],{n,2,nrows+1}] (* Paolo Xausa, Nov 23 2021 *)

Formula

The entries a(n, m) of row n, for n > = 2 and m = 1, 2, ..., A002541(n), are given by the concatenation of the sequences k*(2, 3, ..., t(n,k)) for k = 1, 2, ..., floor(n/2), with t(n, k) = floor((n-k)/k) + 1.

A348390 Irregular triangle read by rows: for n >= 2 the row members a(n, m) give the proper divisors of k, followed by the multiples of k larger than k and not exceeding n, for k = 1, 2, ..., n.

Original entry on oeis.org

2, 1, 2, 3, 1, 1, 2, 3, 4, 1, 4, 1, 1, 2, 2, 3, 4, 5, 1, 4, 1, 1, 2, 1, 2, 3, 4, 5, 6, 1, 4, 6, 1, 6, 1, 2, 1, 1, 2, 3, 2, 3, 4, 5, 6, 7, 1, 4, 6, 1, 6, 1, 2, 1, 1, 2, 3, 1, 2, 3, 4, 5, 6, 7, 8, 1, 4, 6, 8, 1, 6, 1, 2, 8, 1, 1, 2, 3, 1, 1, 2, 4
Offset: 2

Views

Author

Wolfdieter Lang, Nov 07 2021

Keywords

Comments

The length of row n is 2*A002541(n), for n >= 2.
The sum of row n is A348391(n). The sum of the proper divisors of row n is A153485(n). The sum of the multiples in row n is A348392(n). Hence, A348391(n) = A153485(n) + A348392(n).
For k = 1 the proper divisor set is empty, and for k > floor(n/2) the set of multiples is empty.

Examples

			The irregular triangle a(n, m), m = 1, 2, ..., 2*A002541(n) begins:
(members for k = 1, 2, ..., n are separated by a vertical bar, and the proper divisors and multiples are separated by a comma)
n\m 1 2 3 4 5 6 7 8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ...
-----------------------------------------------------------------------------------
2:  2|1
3:  2 3|1|1
4:  2 3 4|1,4|1|1 2
5:  2 3 4 5|1,4|1|1  2| 1
6:  2 3 4 5 6|1,4 6| 1, 6| 1  2| 1| 1 2 3
7:  2 3 4 5 6 7|1,4  6| 1, 6| 1  2| 1| 1  2  3| 1
8:  3 4 5 6 7 8|1,4  6  8| 1 ,6| 1  2 ,8| 1| 1  2  3| 1| 1  2  4
9:  2 3 4 5 6 7 8 9| 1, 4  6  8| 1, 6  9| 1  2, 8| 1| 1  2  3| 1| 1  2  4| 1  3
...
n = 10: 2 3 4 5 6 7 8 9 10 | 1, 4 6 8 10 | 1, 6 9 | 1 2, 8 | 1, 10 | 1 2 3 | 1 | 1 2 4 | 1 3 | 1 2 5
-----------------------------------------------------------------------------------
n = 4:  d(4, 1) = {}, m(4, 1) = {2, 3, 4}; d(4, 2) = {1}, m(4, 2) = {4}; d(4, 3) = {1}, m(4, 3) = {}; d(4, 4) = {1, 2}, m(4, 4) = {}, This explains row n = 4.
		

Crossrefs

Programs

  • Mathematica
    nrows=10;Table[Flatten[Table[Join[Most[Divisors[k]],Range[2k,n,k]],{k,n}]],{n,2,nrows+1}] (* Paolo Xausa, Nov 23 2021 *)

Formula

For n >= 2 row n gives the sequence of the sequence d(n, k) of proper divisors of k (A027751(k)) followed by the sequences m(n, k) of the multiples of k, larger than k and not exceeding n (A348389), for k = 1, 2, 3, ..., n.

A348392 Row sums of the irregular triangle A348389.

Original entry on oeis.org

2, 5, 13, 18, 36, 43, 67, 85, 115, 126, 186, 199, 241, 286, 350, 367, 457, 476, 576, 639, 705, 728, 896, 946, 1024, 1105, 1245, 1274, 1484, 1515, 1675, 1774, 1876, 1981, 2269, 2306, 2420, 2537, 2817
Offset: 2

Views

Author

Wolfdieter Lang, Oct 31 2021

Keywords

Examples

			n = 4: Compare the row of an array with all multiples of k <= n, for k = 1,2, ..., n with the row of A348389:
All multiples of k <= 4 for k = 1..4:  [1 2 3 4|2 4|3|4] with row sum A143127(4) = 23.
A348389 row 4: [2 3 4|4] with 1, 2, 3 and 4 missing: row sum is 23 - 4*5/2  = 13. Hence a(4) = A143127(4) - A000217(4).
Also: a(4) =  A348391(4) - A153485(4) = 18 - 5 = 13.
		

Crossrefs

Formula

a(n) = Sum_{m=1.. A002541(n)} A348389(n, m), for n >= 2.
a(n) = A143127(n) - A000217(n).
a(n) = A348391(n) - A153485(n).

A366967 a(n) = Sum_{k=2..n} binomial(k,2) * floor(n/k).

Original entry on oeis.org

0, 1, 4, 11, 21, 40, 61, 96, 135, 191, 246, 337, 415, 528, 646, 801, 937, 1145, 1316, 1568, 1802, 2089, 2342, 2737, 3047, 3451, 3841, 4338, 4744, 5358, 5823, 6474, 7060, 7758, 8384, 9294, 9960, 10835, 11657, 12717, 13537, 14739, 15642, 16881, 18025, 19314, 20395
Offset: 1

Views

Author

Seiichi Manyama, Oct 30 2023

Keywords

Crossrefs

Partial sums of A069153.

Programs

  • PARI
    a(n) = sum(k=2, n, binomial(k, 2)*(n\k));
    
  • Python
    from math import isqrt
    def A366967(n): return ((s:=isqrt(n))**2*(1-s**2)+sum((q:=n//k)*(3*k*(k-1)+q**2-1) for k in range(1,s+1)))//6 # Chai Wah Wu, Oct 30 2023

Formula

G.f.: 1/(1-x) * Sum_{k>=1} x^(2*k)/(1-x^k)^3 = 1/(1-x) * Sum_{k>=2} binomial(k,2) * x^k/(1-x^k).
a(n) = (A064602(n)-A024916(n))/2. - Chai Wah Wu, Oct 30 2023

A224525 Number of idempotent 3 X 3 0..n matrices of rank 1.

Original entry on oeis.org

27, 69, 123, 195, 273, 375, 477, 603, 735, 885, 1035, 1221, 1395, 1593, 1803, 2031, 2253, 2511, 2757, 3039, 3321, 3615, 3909, 4251, 4575, 4917, 5271, 5649, 6015, 6429, 6819, 7245, 7671, 8109, 8559, 9051, 9513, 9999, 10497, 11031, 11541, 12099, 12633
Offset: 1

Views

Author

R. H. Hardin, Apr 09 2013

Keywords

Comments

Row 3 of A224524.

Examples

			Some solutions for n=3:
  0 1 0   1 3 2   0 1 0   1 3 1   0 0 0   0 0 0   1 0 0
  0 1 0   0 0 0   0 1 0   0 0 0   0 1 2   3 0 3   1 0 0
  0 3 0   0 0 0   0 2 0   0 0 0   0 0 0   1 0 1   2 0 0
		

Crossrefs

Programs

  • Maple
    f:= k -> 6*k^2 + 18*k + 3 + 6 * add(floor(k/m),m=2..k):
    map(f, [$1..50]); # Robert Israel, Dec 15 2019

Formula

a(n) = 6*n^2 + 18*n + 3 + 6 * A002541(n). - Robert Israel, Dec 15 2019

A224526 Number of idempotent 4 X 4 0..n matrices of rank 1.

Original entry on oeis.org

108, 404, 892, 1716, 2732, 4324, 6060, 8516, 11308, 14820, 18572, 23668, 28716, 34916, 41836, 49860, 58076, 68164, 78252, 90356, 102988, 116868, 131276, 148564, 165660, 184532, 204604, 226788, 249116, 274900, 300252, 328628, 357868, 389028, 421580, 457924, 493500
Offset: 1

Views

Author

R. H. Hardin, Apr 09 2013

Keywords

Comments

Row 4 of A224524

Examples

			Some solutions for n=3:
  0 0 0 0     0 0 0 0     1 0 0 0     0 0 0 0     0 0 0 0
  0 0 0 0     2 0 0 1     0 0 0 0     1 1 0 0     0 0 0 0
  2 0 1 0     2 0 0 1     0 0 0 0     3 3 0 0     0 0 0 0
  0 0 0 0     2 0 0 1     0 0 0 0     2 2 0 0     1 0 1 1
		

Crossrefs

Programs

  • Maple
    F4 := k -> 8*k^3 + 36*k^2 + 24*add(m*floor(k/m), m = 2 .. k) + 12*add(floor(k/m), m = 2 .. k) + 12*add(floor(k/m)^2, m = 2 .. k) + 60*k + 4:
    map(F4, [$1..100]); # Robert Israel, Dec 15 2019
  • Mathematica
    Table[8*n^3+36*n^2+60*n+4+24*Sum[k*Floor[n/k],{k, 2, n}]+12*Sum[Floor[(n-k)/k],{k, n-1}]+12*Sum[Floor[(n/k)]^2,{k,2,n}],{n,1,100}] (* Metin Sariyar, Dec 15 2019 *)

Formula

a(n) = 8*n^3 + 36*n^2 + 60*n + 4 + 24*A024917(n) + 12*A002541(n) + 12*Sum_{m=2..n} floor(n/m)^2. - Robert Israel, Dec 15 2019

Extensions

More terms from Metin Sariyar, Dec 15 2019

A338991 a(n) = Sum_{k=1..floor(n/2)} (n-2*k) * floor((n-k)/k).

Original entry on oeis.org

0, 0, 2, 6, 13, 24, 37, 56, 78, 106, 132, 178, 212, 258, 312, 376, 425, 508, 565, 662, 749, 836, 909, 1058, 1156, 1264, 1384, 1536, 1636, 1836, 1946, 2126, 2282, 2434, 2606, 2880, 3019, 3194, 3385, 3676, 3833, 4138, 4305, 4572, 4863, 5086, 5271, 5692, 5924, 6240
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 21 2020

Keywords

Comments

Total area of all rectangles with dimensions (y-x) X (z) where x and y are integers such that x + y = n, 0 < x <= y, and z = floor(y/x).

Crossrefs

Programs

  • Mathematica
    Table[Sum[(n - 2 k)*Floor[(n - k)/k], {k, Floor[n/2]}], {n, 60}]
  • Python
    from math import isqrt
    def A338991(n): return ((s:=isqrt(n))+1)*(n*(1-s)+s**2)-sum((q:=n//k)*((k-n<<1)+q+1) for k in range(1,s+1)) # Chai Wah Wu, Oct 23 2023

Formula

From Vaclav Kotesovec, Jun 24 2021: (Start)
a(n) = n + n*A006218(n) - 2*A024916(n).
a(n) ~ (log(n) + 2*gamma - Pi^2/6 - 1)*n^2, where gamma is the Euler-Mascheroni constant A001620. (End)

A339217 a(n) = Sum_{k=1..n} floor((2*n-k)/k).

Original entry on oeis.org

0, 1, 4, 8, 12, 17, 23, 27, 34, 40, 46, 52, 60, 65, 73, 81, 87, 93, 104, 108, 118, 126, 132, 140, 150, 157, 165, 173, 183, 189, 201, 205, 216, 226, 232, 242, 254, 258, 268, 278, 288, 295, 307, 313, 323, 335, 343, 349, 363, 369, 382, 390, 398, 408, 420, 428, 440, 448, 456, 464, 482
Offset: 0

Views

Author

Wesley Ivan Hurt, Dec 22 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Floor[(2 n - i)/i], {i, n}], {n, 0, 60}]
  • PARI
    a(n) = sum(k=1, n, (2*n-k)\k); \\ Michel Marcus, Dec 22 2020

Formula

From Vaclav Kotesovec, Dec 23 2020: (Start)
For n>0, a(n) = 2*A006218(n) + A075989(n) - n.
a(n) ~ 2*n * (log(2*n) + 2*gamma - 2), where gamma is the Euler-Mascheroni constant A001620. (End)

A348388 Irregular triangle read by rows: T(n, k) = floor((n-k)/k), for k = 1, 2, ..., floor(n/2) and n >= 2.

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 5, 2, 1, 6, 2, 1, 7, 3, 1, 1, 8, 3, 2, 1, 9, 4, 2, 1, 1, 10, 4, 2, 1, 1, 11, 5, 3, 2, 1, 1, 12, 5, 3, 2, 1, 1, 13, 6, 3, 2, 1, 1, 1, 14, 6, 4, 2, 2, 1, 1, 15, 7, 4, 3, 2, 1, 1, 1, 16, 7, 4, 3, 2, 1, 1, 1, 17, 8, 5, 3, 2, 2, 1, 1, 1, 18, 8, 5, 3, 2, 2, 1, 1, 1, 19, 9, 5, 4, 3, 2, 1, 1, 1, 1
Offset: 2

Views

Author

Wolfdieter Lang, Oct 31 2021

Keywords

Comments

This irregular triangle T(n, k) gives the number of multiples of number k, larger than k and not exceeding n, for k = 1, 2, ..., floor(n/2), for n >= 2. See A348389 for the array of these multiples.
The length of row n is floor(n/2) = A004526(n), for n >= 2.
The row sums give A002541(n). See the formula given there by Wesley Ivan Hurt, May 08 2016.
The columns give the k-fold repeated positive integers k, for k >= 1.

Examples

			The irregular triangle T(n, k) begins:
n\k   1 2 3 4 5 6 7 8 9 10 ...
------------------------------
2:    1
3:    2
4:    3 1
5:    4 1
6:    5 2 1
7:    6 2 1
8:    7 3 1 1
9:    8 3 2 1
10:   9 4 2 1 1
11:  10 4 2 1 1
12:  11 5 3 2 1 1
13:  12 5 3 2 1 1
14:  13 6 3 2 1 1 1
15:  14 6 4 2 2 1 1
16:  15 7 4 3 2 1 1 1
17:  16 7 4 3 2 1 1 1
18:  17 8 5 3 2 2 1 1 1
19:  18 8 5 3 2 2 1 1 1
20:  19 9 5 4 3 2 1 1 1  1
...
		

Crossrefs

Columns k (with varying offsets): A000027, A004526, A008620, A008621, A002266, A097992, ...

Programs

  • Mathematica
    T[n_, k_] := Floor[(n - k)/k]; Table[T[n, k], {n, 2, 20}, {k, 1, Floor[n/2]}] // Flatten (* Amiram Eldar, Nov 02 2021 *)
  • Python
    def A348388row(n): return [(n - k) // k for k in range(1, 1 + n // 2)]
    for n in range(2, 21): print(A348388row(n))  # Peter Luschny, Nov 05 2021

Formula

T(n, k) = floor((n-k)/k), for k = 1, 2, ..., floor(n/2) and n >= 2.
G.f. of column k: G(k, x) = x^(2*k)/((1 - x)*(1 - x^k)).
Previous Showing 21-30 of 42 results. Next