A006218
a(n) = Sum_{k=1..n} floor(n/k); also Sum_{k=1..n} d(k), where d = number of divisors (A000005); also number of solutions to x*y = z with 1 <= x,y,z <= n.
Original entry on oeis.org
0, 1, 3, 5, 8, 10, 14, 16, 20, 23, 27, 29, 35, 37, 41, 45, 50, 52, 58, 60, 66, 70, 74, 76, 84, 87, 91, 95, 101, 103, 111, 113, 119, 123, 127, 131, 140, 142, 146, 150, 158, 160, 168, 170, 176, 182, 186, 188, 198, 201, 207, 211, 217, 219, 227, 231, 239, 243, 247, 249
Offset: 0
a(3) = 5 because 3 + floor(3/2) + 1 = 3 + 1 + 1 = 5. Or tau(1) + tau(2) + tau(3) = 1 + 2 + 2 = 5.
a(4) = 8 because 4 + floor(4/2) + floor(4/3) + 1 = 4 + 2 + 1 + 1 = 8. Or
tau(1) + tau(2) + tau(3) + tau(4) = 1 + 2 + 2 + 3 = 8.
a(5) = 10 because 5 + floor(5/2) + floor(5/3) + floor (5/4) + 1 = 5 + 2 + 1 + 1 + 1 = 10. Or tau(1) + tau(2) + tau(3) + tau(4) + tau(5) = 1 + 2 + 2 + 3 + 2 = 10.
- T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
- K. Chandrasekharan, Introduction to Analytic Number Theory. Springer-Verlag, 1968, Chap. VI.
- K. Chandrasekharan, Arithmetical Functions. Springer-Verlag, 1970, Chapter VIII, pp. 194-228. Springer-Verlag, Berlin.
- P. G. L. Dirichlet, Werke, Vol. ii, pp. 49-66.
- M. N. Huxley, The Distribution of Prime Numbers, Oxford Univ. Press, 1972, p. 7.
- M. N. Huxley, Area, Lattice Points and Exponential Sums, Oxford, 1996; p. 239.
- Hari Kishan, Number Theory, Krishna, Educational Publishers, 2014, Theorem 1, p. 133.
- H. L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 56.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Nurdin N. Takenov and Oksana Haritonova, Representation of positive integers by a special set of digits and sequences, in Dolmatov, S. L. et al. editors, Materials of Science, Practical seminar "Modern Mathematics".
- James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.6.13 on page 107.
- N. J. A. Sloane, Table of n, a(n) for n = 0..20000 (first 1000 terms from T. D. Noe)
- Dorin Andrica and Ovidiu Bagdasar, On some results concerning the polygonal polynomials, Carpathian Journal of Mathematics (2019) Vol. 35, No. 1, 1-11.
- D. Andrica and E. J. Ionascu, On the number of polynomials with coefficients in [n], An. St. Univ. Ovidius Constanța, Vol. 22(1),2014, 13-23.
- R. Bellman and H. N. Shapiro, On a problem in additive number theory, Annals Math., 49 (1948), 333-340. See Eq. 1.5.
- D. Berkane, O. Bordellès, and O. Ramaré, Explicit upper bounds for the remainder term in the divisor problem, Math. Comp. 81:278 (2012), pp. 1025-1051.
- Peter J. Cameron and Hamid Reza Dorbidi, Minimal cover groups, arXiv:2311.15652 [math.GR], 2023. See p. 13.
- Diophante, A1712, La même parité (in French).
- Xiaoxi Duan and M. W. Wong, The Dirichlet divisor problem, traces and determinants for complex powers of the twisted bi-Laplacian, J. of Math. Analysis and Applications, Volume 410, Issue 1, Feb 01 2014, Pages 151-157
- L. Hoehn and J. Ridenhour, Summations involving computer-related functions, Math. Mag., 62 (1989), 191-196.
- M. N. Huxley, Exponential Sums and Lattice Points III, Proc. London Math. Soc., 87 (2003), pp. 591-609.
- Vaclav Kotesovec, Graph - The asymptotic ratio (1000000 terms)
- Richard Sladkey, A successive approximation algorithm for computing the divisor summatory function, arXiv:1206.3369 [math.NT], 2012.
- Terence Tao, Ernest Croot III, and Harald Helfgott, Deterministic methods to find primes, Math. Comp. 81 (2012), 1233-1246; also at arXiv:1009.3956 [math.NT], 2010-2012.
-
a006218 n = sum $ map (div n) [1..n]
-- Reinhard Zumkeller, Jan 29 2011
-
[0] cat [&+[Floor(n/k):k in [1..n]]:n in [1..60]]; // Marius A. Burtea, Aug 25 2019
-
with(numtheory): A006218 := n->add(sigma[0](i), i=1..n);
-
Table[Sum[DivisorSigma[0, k], {k, n}], {n, 70}]
FoldList[Plus, 0, Table[DivisorSigma[0, x], {x, 61}]] //Rest (* much faster *)
Join[{0},Accumulate[DivisorSigma[0,Range[60]]]] (* Harvey P. Dale, Jan 06 2016 *)
-
a(n)=sum(k=1,n,n\k)
-
a(n)=sum(k=1,sqrtint(n),n\k)*2-sqrtint(n)^2 \\ Charles R Greathouse IV, Oct 10 2010
-
from sympy import integer_nthroot
def A006218(n): return 2*sum(n//k for k in range(1,integer_nthroot(n,2)[0]+1))-integer_nthroot(n,2)[0]**2 # Chai Wah Wu, Mar 29 2021
A078651
Number of increasing geometric-progression subsequences of [1,...,n] with integral successive-term ratio and length >= 1.
Original entry on oeis.org
1, 3, 5, 9, 11, 15, 17, 23, 27, 31, 33, 40, 42, 46, 50, 59, 61, 68, 70, 77, 81, 85, 87, 97, 101, 105, 111, 118, 120, 128, 130, 141, 145, 149, 153, 165, 167, 171, 175, 185, 187, 195, 197, 204, 211, 215, 217, 231, 235, 242, 246, 253, 255, 265, 269, 279, 283, 287
Offset: 1
Robert E. Sawyer (rs.1(AT)mindspring.com), Jan 08 2003
a(1): [1]; a(2): [1],[2],[1,2]; a(3): [1],[2],[3],[1,2],[1,3].
-
g := (n, b) -> local i; add(iquo(n, b^i), i = 1..floor(log(n, b))):
a := n -> local b; n + add(g(n, b), b = 2..n):
seq(a(n), n = 1..58); # Peter Luschny, Apr 03 2025
-
Accumulate[1 + Table[Total[IntegerExponent[n, Rest[Divisors[n]]]], {n, 100}]] (* Paolo Xausa, Aug 27 2025 *)
-
A078651(n) = {my(s=0, k=2); while(k<=n, s+=(n - sumdigits(n, k))/(k-1); k=k+1); n + s} \\ Zhuorui He, Aug 28 2025
A051336
Number of increasing arithmetic progressions in {1,2,3,...,n}, including trivial arithmetic progressions of lengths 1 and 2.
Original entry on oeis.org
1, 3, 7, 13, 22, 33, 48, 65, 86, 110, 138, 168, 204, 242, 284, 330, 381, 434, 493, 554, 621, 692, 767, 844, 929, 1017, 1109, 1205, 1307, 1411, 1523, 1637, 1757, 1881, 2009, 2141, 2282, 2425, 2572, 2723, 2882, 3043, 3212, 3383, 3560, 3743, 3930, 4119
Offset: 1
a(1): [1];
a(2): [1],[2],[1,2];
a(3): [1],[2],[3],[1,2],[1,3],[2,3],[1,2,3].
-
nmax = 48; t = Table[ DivisorSigma[0, n], {n, 1, nmax}]; Accumulate[ Accumulate[t]+1] - Accumulate[t] (* Jean-François Alcover, Nov 08 2011 *)
With[{c=Accumulate[DivisorSigma[0,Range[50]]]},Accumulate[c+1]-c] (* Harvey P. Dale, Dec 23 2015 *)
nmax = 50; RecurrenceTable[{a[n] == a[n-1]+1+p[n], p[n] == p[n-1]+DivisorSigma[0, n-1], a[1] == 1, p[1] == 0}, {a, p}, {n, 1, nmax}][[All,1]] (* Daniel Hoying, May 16 2020 *)
-
from math import isqrt
def A051336(n): return (((s:=isqrt(n-1))*(s+1))**2>>2)+(1-s**2)*n+sum((q:=(n-1)//k)*(2*n-k*(1+q)) for k in range(1, s+1)) # Chai Wah Wu, Oct 21 2023
A341062
Sequence whose partial sums give A000005.
Original entry on oeis.org
1, 1, 0, 1, -1, 2, -2, 2, -1, 1, -2, 4, -4, 2, 0, 1, -3, 4, -4, 4, -2, 0, -2, 6, -5, 1, 0, 2, -4, 6, -6, 4, -2, 0, 0, 5, -7, 2, 0, 4, -6, 6, -6, 4, 0, -2, -2, 8, -7, 3, -2, 2, -4, 6, -4, 4, -4, 0, -2, 10, -10, 2, 2, 1, -3, 4, -6, 4, -2, 4, -6, 10, -10, 2, 2, 0, -2, 4, -6, 8, -5, -1, -2, 10, -8, 0, 0, 4, -6, 10
Offset: 1
Cf.
A000027,
A000041,
A000070,
A000217,
A006128,
A006218,
A014153,
A036469,
A055507,
A078567,
A138137,
A284870,
A305082,
A340793.
-
Join[{1}, Differences[Table[DivisorSigma[0, n], {n, 1, 90}]]] (* Amiram Eldar, Feb 06 2021 *)
A106847
a(n) = Sum {k + j*m <= n} (k + j*m), with 0 < k,j,m <= n.
Original entry on oeis.org
0, 0, 2, 11, 31, 71, 131, 229, 357, 537, 767, 1064, 1412, 1867, 2385, 3000, 3720, 4570, 5506, 6608, 7808, 9194, 10734, 12436, 14260, 16360, 18622, 21079, 23739, 26668, 29758, 33199, 36815, 40742, 44924, 49369, 54085, 59265, 64661, 70355
Offset: 0
We have 1+1*1=2<=3, 1+2*1=3, 1+1*2=3, 2+1*1=3, thus a(3)=2+3+3+3=11.
-
A106847 := proc(n)
local a,k,l,m ;
a := 0 ;
for k from 1 to n do
for l from 1 to n-k do
m := floor((n-k)/l) ;
if m >=1 then
m := min(m,n) ;
a := a+m*k+l*m*(m+1)/2 ;
end if;
end do:
end do:
a ;
end proc: # R. J. Mathar, Oct 17 2012
-
A106847[n_] := Module[{a, k, l, m}, a = 0; For[k = 1, k <= n, k++, For[l = 1, l <= n - k, l++, If[l == 0, m = n, m = Floor[(n - k)/l]]; If[m >= 1, m = Min[m, n]; a = a + m*k + l*m*(m + 1)/2]]]; a];
Table[A106847[n], {n, 0, 40}] (* Jean-François Alcover, Apr 04 2024, after R. J. Mathar *)
-
A106847(n)=sum(m=1,n-1,sum(k=1,(n-1)\m,(n-m*k)*(n+m*k+1)))/2 \\ M. F. Hasler, Oct 17 2012
A134546
Triangle read by rows: T(n, k) = Sum_{j=0..n} floor(j / k).
Original entry on oeis.org
1, 3, 1, 6, 2, 1, 10, 4, 2, 1, 15, 6, 3, 2, 1, 21, 9, 5, 3, 2, 1, 28, 12, 7, 4, 3, 2, 1, 36, 16, 9, 6, 4, 3, 2, 1, 45, 20, 12, 8, 5, 4, 3, 2, 1, 55, 25, 15, 10, 7, 5, 4, 3, 2, 1, 66, 30, 18, 12, 9, 6, 5, 4, 3, 2, 1, 78, 36, 22, 15, 11, 8, 6, 5, 4, 3, 2, 1, 91, 42, 26, 18, 13, 10, 7, 6, 5, 4, 3, 2, 1
Offset: 1
The triangle T(n, k) begins:
n\k 1 2 3 4 5 6 7 8 9 10 ...
1: 1
2: 3 1
3: 6 2 1
4: 10 4 2 1
5: 15 6 3 2 1
6: 21 9 5 3 2 1
7: 28 12 7 4 3 2 1
8: 36 16 9 6 4 3 2 1
9: 45 20 12 8 5 4 3 2 1
10: 55 25 15 10 7 5 4 3 2 1
... Reformatted. - _Wolfdieter Lang_, Feb 04 2015
T(10,3) = 15: 3*floor(10/3)*floor(13/3)/2 - floor(10/3)*(3-1 - 13 mod 3) = 3*3*4/2 - 3*(3-1-1) = 18 - 3 = 15. - _Bob Selcoe_, Aug 21 2016
-
T := proc(n, k) option remember: `if`(n = k, 1, T(n-1, k) + iquo(n,k)) end:
seq(seq(T(n,k), k=1..n),n=1..16); # Peter Luschny, May 26 2020
-
nn = 12; f[w_] := Map[PadRight[#, nn] &, w]; MapIndexed[Take[#1, First@ #2] &, f@ Table[Reverse@ Range@ n, {n, nn}].f@ Table[Boole@ Divisible[n, #] & /@ Range@ n, {n, nn}]] // Flatten (* Michael De Vlieger, Aug 10 2016 *)
-
t(n, k) = if (k>n, 0, if (n==1, 1, t(n-1, k) + n\k));
tabl(nn) = {m = matrix(nn, nn, n , k, t(n,k)); for (n=1, nn, for (k=1, n, print1(m[n, k], ", ");); print(););} \\ Michel Marcus, Jan 18 2015
-
trg(nn) = {ma = matrix(nn, nn, n, k, if (k<=n, n-k+1, 0)); mb = matrix(nn, nn, n, k, if (k<=n, !(n%k), 0)); ma*mb;} \\ Michel Marcus, Jan 20 2015
A309099
Number of partitions of n avoiding the partition (4,3,1).
Original entry on oeis.org
1, 1, 2, 3, 5, 7, 11, 15, 21, 28, 37, 46, 59, 72, 87, 104, 124, 144, 168, 192, 220, 250, 282, 314, 352, 391, 432, 475, 522, 569, 622, 675, 732, 791, 852, 915, 985, 1055, 1127, 1201, 1281, 1361, 1447, 1533, 1623, 1717, 1813, 1909, 2013, 2118, 2227, 2338, 2453
Offset: 0
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- Jonathan Bloom and Nathan McNew, Counting pattern-avoiding integer partitions, arXiv:1908.03953 [math.CO], 2019.
- J. Bloom and D. Saracino, On Criteria for rook equivalence of Ferrers boards, arXiv:1808.04221 [math.CO], 2018.
- J. Bloom and D. Saracino, Rook and Wilf equivalence of integer partitions, arXiv:1808.04238 [math.CO], 2018.
- J. Bloom and D. Saracino, Rook and Wilf equivalence of integer partitions, European J. Combin., 71 (2018), 246-267.
- J. Bloom and D. Saracino, On Criteria for rook equivalence of Ferrers boards, European J. Combin., 76 (2018), 199-207.
- Joachim König, Closed-form for the number of partitions of n avoiding the partition (4,3,1), answer to question on MathOverflow (2023).
-
b:= proc(n) option remember; `if`(n<1, [0$2],
(p-> p+[numtheory[tau](n), p[1]])(b(n-1)))
end:
a:= n-> b(n+1)[2]+`if`(n=0, 1, n*(1-n)):
seq(a(n), n=0..55); # Alois P. Heinz, Dec 20 2023
-
b[n_] := b[n] = If[n < 1, {0, 0}, With[{p = b[n-1]},
p + {DivisorSigma[0, n], p[[1]]}]];
a[n_] := b[n+1][[2]] + If[n == 0, 1, n*(1-n)];
Table[a[n], {n, 0, 55}] (* Jean-François Alcover, Jan 29 2025, after Alois P. Heinz *)
-
a(n) = if(n == 0, 1, sum(i = 1, n, (n - i + 1) * numdiv(i)) - n * (n - 1)) \\ Mikhail Kurkov, Dec 20 2023 [verification needed]
A381886
Triangle read by rows: T(n, k) = Sum_{j=1..floor(log[k](n))} floor(n / k^j) if k >= 2, T(n, 1) = n, T(n, 0) = 0^n.
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 0, 3, 1, 1, 0, 4, 3, 1, 1, 0, 5, 3, 1, 1, 1, 0, 6, 4, 2, 1, 1, 1, 0, 7, 4, 2, 1, 1, 1, 1, 0, 8, 7, 2, 2, 1, 1, 1, 1, 0, 9, 7, 4, 2, 1, 1, 1, 1, 1, 0, 10, 8, 4, 2, 2, 1, 1, 1, 1, 1, 0, 11, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1, 0, 12, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1
Offset: 0
Triangle starts:
[ 0] 1;
[ 1] 0, 1;
[ 2] 0, 2, 1;
[ 3] 0, 3, 1, 1;
[ 4] 0, 4, 3, 1, 1;
[ 5] 0, 5, 3, 1, 1, 1;
[ 6] 0, 6, 4, 2, 1, 1, 1;
[ 7] 0, 7, 4, 2, 1, 1, 1, 1;
[ 8] 0, 8, 7, 2, 2, 1, 1, 1, 1;
[ 9] 0, 9, 7, 4, 2, 1, 1, 1, 1, 1;
[10] 0, 10, 8, 4, 2, 2, 1, 1, 1, 1, 1;
[11] 0, 11, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1;
[12] 0, 12, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1;
-
T := (n, b) -> local i; ifelse(b = 0, b^n, ifelse(b = 1, n, add(iquo(n, b^i), i = 1..floor(log(n, b))))): seq(seq(T(n, b), b = 0..n), n = 0..12);
# Alternative:
T := (n, k) -> local j; ifelse(k = 0, k^n, ifelse(k = 1, n, add(padic:-ordp(j, k), j = 1..n))): for n from 0 to 12 do seq(T(n, k), k = 0..n) od;
-
T[n_, 0] := If[n == 0, 1, 0]; T[n_, 1] := n;
T[n_, k_] := Last@Accumulate[IntegerExponent[Range[n], k]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}] // MatrixForm
(* Alternative: *)
T[n_, k_] := Sum[Floor[n/k^j], {j, Floor[Log[k, n]]}]; T[n_, 1] := n; T[n_, 0] := 0^n; T[0, 0] = 1; Flatten@ Table[T[n, k], {n, 0, 12}, {k, 0, n}] (* Michael De Vlieger, Apr 03 2025 *)
-
T(n,k) = if (n==0, 1, if (n==1, k, if (k==0, 0, if (k==1, n, sum(j=1, n, valuation(j, k))))));
row(n) = vector(n+1, k, T(n,k-1)); \\ Michel Marcus, Apr 04 2025
-
from math import log
def T(n: int, b: int) -> int:
return (b**n if b == 0 else n if b == 1 else
sum(n // (b**i) for i in range(1, 1 + int(log(n, b)))))
print([[T(n, b) for b in range(n+1)] for n in range(12)])
-
def T(n, b): return (b^n if b == 0 else n if b == 1 else sum(valuation(j, b) for j in (1..n)))
print(flatten([[T(n, b) for b in range(n+1)] for n in srange(13)]))
Showing 1-8 of 8 results.
Comments