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

A056549 a(n) = Sum_{k>=1} round(n/k) where round(1/2)=1.

Original entry on oeis.org

0, 2, 5, 9, 12, 17, 21, 25, 30, 35, 39, 45, 49, 54, 60, 66, 69, 75, 82, 86, 92, 98, 102, 110, 114, 120, 126, 132, 138, 144, 150, 154, 161, 169, 173, 181, 186, 190, 198, 206, 210, 217, 223, 229, 235, 243, 249, 255, 261, 266, 275, 281, 285, 295, 301, 307, 313, 319
Offset: 0

Views

Author

Henry Bottomley, Jun 21 2000

Keywords

Crossrefs

Formula

a(n) = A056548(n) + A001227(n).
Conjecture: a(n) = n + Sum_{k=1..n} floor(n/k + 1/2) = n + A077024(n). - Ridouane Oudra, Apr 29 2019

A351355 Number of ways the numbers from 1..n do not divide numbers from n+1..2n.

Original entry on oeis.org

0, 1, 3, 8, 13, 21, 31, 42, 55, 71, 87, 107, 128, 150, 174, 203, 231, 260, 294, 328, 364, 404, 442, 486, 530, 576, 624, 674, 726, 780, 838, 895, 953, 1017, 1079, 1146, 1216, 1284, 1354, 1430, 1505, 1583, 1663, 1745, 1827, 1913, 2001, 2091, 2184, 2275, 2371, 2471, 2567, 2669, 2773
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 08 2022

Keywords

Examples

			a(5) = 13; there are 13 ways the numbers from 1..5 do not divide the numbers from 6..10. 2 does not divide 7,9 (2 ways) + 3 does not divide 7,8,10 (3 ways) + 4 does not divide 6,7,9,10 (4 ways) + 5 does not divide 6,7,8,9 (4 ways) = 13 ways.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i; n^2 - add(floor(2*n/i) - floor(n/i),i=1..n) end proc:
    map(f, [$1..100]); # Robert Israel, Aug 26 2025
  • Python
    def A351355(n): return 0 if n == 1 else n*n-sum(2*n//k for k in range(2,2*n))+sum(n//k for k in range(2,n)) # Chai Wah Wu, Feb 08 2022
    
  • Python
    from math import isqrt
    def A351355(n): return ((t:=isqrt(m:=n<<1))+(s:=isqrt(n)))*(t-s)+(sum(n//k for k in range(1,s+1))-sum(m//k for k in range(1,t+1))<<1)+n*(n+1) # Chai Wah Wu, Oct 23 2023

Formula

a(n) = Sum_{k=1..n} Sum_{i=n+1..2n} sign(i mod k).
a(n) = n*(n+1) + A006218(n) - A006218(2n). - Chai Wah Wu, Feb 08 2022

A077025 a(n) = Sum_{k=1..n} floor(n/(k + 1/2)).

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 11, 14, 17, 19, 23, 25, 28, 32, 36, 37, 41, 46, 48, 52, 56, 58, 64, 66, 70, 74, 78, 82, 86, 90, 92, 97, 103, 105, 111, 114, 116, 122, 128, 130, 135, 139, 143, 147, 153, 157, 161, 165, 168, 175, 179, 181, 189, 193, 197, 201, 205, 209, 215, 221, 224
Offset: 1

Views

Author

Clark Kimberling, Oct 18 2002

Keywords

Comments

It appears that A077024(n) - a(n) = n.

Examples

			[4/(1 + 1/2)] + [4/(2 + 1/2)] + [4/(3 + 1/2)] + [4/(4 + 1/2)] = 2+1+1+0 = 4 = a(4).
		

Crossrefs

Cf. A077024.

Programs

  • PARI
    a(n) = sum(k=1, n, n\(k+1/2)); \\ Michel Marcus, Jan 14 2023

A351362 Number of ways the numbers from 1..n do not divide the numbers from n..2n-1.

Original entry on oeis.org

0, 1, 4, 8, 14, 22, 32, 42, 57, 72, 88, 108, 129, 151, 177, 203, 232, 262, 295, 329, 367, 405, 443, 487, 532, 577, 627, 675, 727, 783, 839, 895, 956, 1018, 1082, 1148, 1217, 1285, 1357, 1431, 1506, 1586, 1664, 1746, 1832, 1914, 2002, 2092, 2186, 2277, 2374, 2472, 2568, 2672
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 08 2022

Keywords

Examples

			a(5) = 14; there are 14 ways that the numbers 1..5 do not divide the numbers 5..9. 2 does not divide 5,7,9 (3 ways) + 3 does not divide 5,7,8 (3 ways) + 4 does not divide 5,6,7,9 (4 ways) + 5 does not divide 6,7,8,9 (4 ways) = 14 ways.
		

Crossrefs

Programs

  • Python
    def A351362(n): return 1 if n == 2 else n*n-1-sum((2*n-1)//k for k in range(2,2*n-1))+sum((n-1)//k for k in range(2,n-1)) # Chai Wah Wu, Feb 08 2022
    
  • Python
    from math import isqrt
    def A351362(n): return ((t:=isqrt(m:=(n<<1)-1))+(s:=isqrt(r:=n-1)))*(t-s)+(sum(r//k for k in range(1,s+1))-sum(m//k for k in range(1,t+1))<<1)+n*(n+1)-1 # Chai Wah Wu, Oct 23 2023

Formula

a(n) = Sum_{k=1..n} Sum_{i=n..2n-1} sign(i mod k).
a(n) = n*(n+1) - 1 + A006218(n-1) - A006218(2n-1). - Chai Wah Wu, Feb 08 2022

A363341 Number of positive integers k <= n such that round(n/k) is odd.

Original entry on oeis.org

1, 1, 2, 2, 4, 3, 4, 4, 6, 7, 6, 5, 9, 8, 9, 9, 10, 10, 11, 12, 13, 12, 13, 12, 15, 16, 17, 16, 17, 16, 17, 17, 20, 21, 20, 20, 23, 22, 21, 22, 24, 23, 26, 25, 28, 27, 26, 25, 27, 29, 30, 31, 32, 31, 32, 31, 32, 33, 34, 33, 35, 34, 37, 37, 40, 39, 38, 39, 40
Offset: 1

Views

Author

Caleb M. Shor, May 28 2023

Keywords

Comments

Here round(x) = floor(x + 1/2).
a(n) is related to the number of lattice points in a circle. Let C(x) equal the number of square lattice points in a circle of radius sqrt(x) centered at the origin. Then a(n) = (C(2n) - 4n - 1)/4. (Prop 3.5 in Dent & Shor paper)

Examples

			For n=5: round(5/1), round(5/2), round(5/3), round(5/4), round(5/5) = 5, 3, 2, 1, 1 among which 4 are odd so a(5)=4.
		

Crossrefs

Cf. A059851 (number of k=1..n such that floor(n/k) is odd).
Cf. A330926 (number of k=1..n such that ceiling(n/k) is odd).
Cf. A057655 (number of lattice points in circle).
Cf. A001826 (d_1), A001842 (d_3), A002654 (d_1-d_3).
Cf. A077024 (n + floor(2n/3) + floor(2n/5) + floor(2n/7) + ...).

Programs

  • Maple
    f:= proc(n) local k;
       nops(select(k -> floor(n/k + 1/2)::odd, [$1..n]))
    end proc:
    map(f, [$1..120]); # Robert Israel, Aug 03 2025
  • PARI
    a(n) = sum(k=1, n, round(n/k)%2) \\ Andrew Howroyd, May 28 2023

Formula

a(n) = n - floor(2n/3) + floor(2n/5) - floor(2n/7) + ...
a(n) = -n + Sum_{k=1..2n} d_1(k) - d_3(k), where d_i(k) is the number of divisors of k that are congruent to i modulo 4.

A211707 Rectangular array: R(n,k)=n+[n/2+1/2]+...+[n/k+1/2], where [ ]=floor and k>=1, by antidiagonals.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 20 2012

Keywords

Comments

Limit of n-th row: A056549=(2,5,9,12,17,21,25,...).
Row 1: A000027
Row 2: A007494
R(n,n)=A077024(n)
For n>=1, row n is a homogeneous linear recurrence sequence of order A005728(n) with palindromic recurrence coefficients in the sense described at A211701.

Examples

			Northwest corner:
1...2...3...4...5....6....7
2...3...5...6...8....9....11
2...4...6...7...10...11...12
2...5...7...8...11...13...15
2...5...8...9...12...14...16
		

Crossrefs

Programs

  • Mathematica
    f[n_, m_] := Sum[Floor[n/k + 1/2], {k, 1, m}]
    TableForm[Table[f[n, m], {m, 1, 20}, {n, 1, 16}]]
Showing 1-6 of 6 results.