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-10 of 14 results. Next

A046951 a(n) is the number of squares dividing n.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 3, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 2, 2, 1, 1, 1, 3, 3, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 3, 1, 2, 2, 4, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2
Offset: 1

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk)

Keywords

Comments

Rediscovered by the HR automatic theory formation program.
a(n) depends only on prime signature of n (cf. A025487, A046523). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3, 1).
First differences of A013936. Average value tends towards Pi^2/6 = 1.644934... (A013661, A013679). - Henry Bottomley, Aug 16 2001
We have a(n) = A159631(n) for all n < 125, but a(125) = 2 < 3 = A159631(125). - Steven Finch, Apr 22 2009
Number of 2-generated Abelian groups of order n, if n > 1. - Álvar Ibeas, Dec 22 2014 [In other words, number of order-n abelian groups with rank <= 2. Proof: let b(n) be such number. A finite abelian group is the inner direct product of all Sylow-p subgroups, so {b(n)} is multiplicative. Obviously b(p^e) = floor(e/2)+1 (corresponding to the groups C_(p^r) X C_(p^(e-r)) for 0 <= r <= floor(e/2)), hence b(n) = a(n) for all n. - Jianing Song, Nov 05 2022]
Number of ways of writing n = r*s such that r|s. - Eric M. Schmidt, Jan 08 2015
The number of divisors of the square root of the largest square dividing n. - Amiram Eldar, Jul 07 2020
The number of unordered factorizations of n into cubefree powers of primes (1, primes and squares of primes, A166684). - Amiram Eldar, Jun 12 2025

Examples

			a(16) = 3 because the squares 1, 4, and 16 divide 16.
G.f. = x + x^2 + x^3 + 2*x^4 + x^5 + x^6 + x^7 + 2*x^8 + 2*x^9 + x^10 + ...
		

Crossrefs

One more than A071325.
Differs from A096309 for the first time at n=32, where a(32) = 3, while A096309(32) = 2 (and also A185102(32) = 2).
Sum of the k-th powers of the square divisors of n for k=0..10: this sequence (k=0), A035316 (k=1), A351307 (k=2), A351308 (k=3), A351309 (k=4), A351310 (k=5), A351311 (k=6), A351313 (k=7), A351314 (k=8), A351315 (k=9), A351315 (k=10).
Sequences of the form n^k * Sum_{d^2|n} 1/d^k for k = 0..10: this sequence (k=0), A340774 (k=1), A351600 (k=2), A351601 (k=3), A351602 (k=4), A351603 (k=5), A351604 (k=6), A351605 (k=7), A351606 (k=8), A351607 (k=9), A351608 (k=10).
Cf. A082293 (a(n)==2), A082294 (a(n)==3).

Programs

  • Haskell
    a046951 = sum . map a010052 . a027750_row
    -- Reinhard Zumkeller, Dec 16 2013
    
  • Magma
    [#[d: d in Divisors(n)|IsSquare(d)]:n in [1..120]]; // Marius A. Burtea, Jan 21 2020
    
  • Maple
    A046951 := proc(n)
        local a,s;
        a := 1 ;
        for p in ifactors(n)[2] do
            a := a*(1+floor(op(2,p)/2)) ;
        end do:
        a ;
    end proc: # R. J. Mathar, Sep 17 2012
    # Alternatively:
    isbidivisible := (n, d) -> igcd(n, d) = d and igcd(n/d, d) = d:
    a := n -> nops(select(k -> isbidivisible(n, k), [seq(1..n)])): # Peter Luschny, Jun 13 2025
  • Mathematica
    a[n_] := Length[ Select[ Divisors[n], IntegerQ[Sqrt[#]]& ] ]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Jun 26 2012 *)
    Table[Length[Intersection[Divisors[n], Range[10]^2]], {n, 100}] (* Alonso del Arte, Dec 10 2012 *)
    a[ n_] := If[ n < 1, 0, Sum[ Mod[ DivisorSigma[ 0, d], 2], {d, Divisors @ n}]]; (* Michael Somos, Jun 13 2014 *)
    a[ n_] := If[ n < 2, Boole[ n == 1], Times @@ (Quotient[ #[[2]], 2] + 1 & /@ FactorInteger @ n)]; (* Michael Somos, Jun 13 2014 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ x^k^2 / (1 - x^k^2), {k, Sqrt @ n}], {x, 0, n}]]; (* Michael Somos, Jun 13 2014 *)
    f[p_, e_] := 1 + Floor[e/2]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Sep 15 2020 *)
  • PARI
    a(n)=my(f=factor(n));for(i=1,#f[,1],f[i,2]\=2);numdiv(factorback(f)) \\ Charles R Greathouse IV, Dec 11 2012
    
  • PARI
    a(n) = direuler(p=2, n, 1/((1-X^2)*(1-X)))[n]; \\ Michel Marcus, Mar 08 2015
    
  • PARI
    a(n)=factorback(apply(e->e\2+1, factor(n)[,2])) \\ Charles R Greathouse IV, Sep 17 2015
    
  • Python
    from math import prod
    from sympy import factorint
    def A046951(n): return prod((e>>1)+1 for e in factorint(n).values()) # Chai Wah Wu, Aug 04 2024
    
  • Python
    def is_bidivisible(n, d) -> bool: return gcd(n, d) == d and gcd(n//d, d) == d
    def aList(n) -> list[int]: return [k for k in range(1, n+1) if is_bidivisible(n, k)]
    print([len(aList(n)) for n in range(1, 126)])  # Peter Luschny, Jun 13 2025
  • Scheme
    (definec (A046951 n) (if (= 1 n) 1 (* (A008619 (A007814 n)) (A046951 (A064989 n)))))
    (define (A008619 n) (+ 1 (/ (- n (modulo n 2)) 2)))
    ;; Antti Karttunen, Nov 14 2016
    

Formula

a(p^k) = A008619(k) = [k/2] + 1. a(A002110(n)) = 1 for all n. (This is true for any squarefree number, A005117). - Original notes clarified by Antti Karttunen, Nov 14 2016
a(n) = |{(i, j) : i*j = n AND i|j}| = |{(i, j) : i*j^2 = n}|. Also tau(A000188(n)), where tau = A000005.
Multiplicative with p^e --> floor(e/2) + 1, p prime. - Reinhard Zumkeller, May 20 2007
a(A130279(n)) = n and a(m) <> n for m < A130279(n); A008966(n)=0^(a(n) - 1). - Reinhard Zumkeller, May 20 2007
Inverse Moebius transform of characteristic function of squares (A010052). Dirichlet g.f.: zeta(s)*zeta(2s).
G.f.: Sum_{k > 0} x^(k^2)/(1 - x^(k^2)). - Vladeta Jovovic, Dec 13 2002
a(n) = Sum_{k=1..A000005(n)} A010052(A027750(n,k)). - Reinhard Zumkeller, Dec 16 2013
a(n) = Sum_{k = 1..n} ( floor(n/k^2) - floor((n-1)/k^2) ). - Peter Bala, Feb 17 2014
From Antti Karttunen, Nov 14 2016: (Start)
a(1) = 1; for n > 1, a(n) = A008619(A007814(n)) * a(A064989(n)).
a(n) = A278161(A156552(n)). (End)
G.f.: Sum_{k>0}(theta(q^k)-1)/2, where theta(q)=1+2q+2q^4+2q^9+2q^16+... - Mamuka Jibladze, Dec 04 2016
From Antti Karttunen, Nov 12 2017: (Start)
a(n) = A000005(n) - A056595(n).
a(n) = 1 + A071325(n).
a(n) = 1 + A001222(A293515(n)). (End)
L.g.f.: -log(Product_{k>=1} (1 - x^(k^2))^(1/k^2)) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018
a(n) = Sum_{d|n} A000005(d) * A008836(n/d). - Torlach Rush, Jan 21 2020
a(n) = A000005(sqrt(A008833(n))). - Amiram Eldar, Jul 07 2020
a(n) = Sum_{d divides n} mu(core(d)^2), where core(n) = A007913(n). - Peter Bala, Jan 24 2024

Extensions

Data section filled up to 125 terms and wrong claim deleted from Crossrefs section by Antti Karttunen, Nov 14 2016

A013939 Partial sums of sequence A001221 (number of distinct primes dividing n).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 14, 15, 17, 19, 20, 21, 23, 24, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 43, 44, 45, 47, 49, 51, 53, 54, 56, 58, 60, 61, 64, 65, 67, 69, 71, 72, 74, 75, 77, 79, 81, 82, 84, 86, 88, 90, 92, 93, 96, 97, 99, 101, 102, 104, 107, 108, 110, 112
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a013939 n = a013939_list !! (n-1)
    a013939_list = scanl1 (+) $ map a001221 [1..]
    -- Reinhard Zumkeller, Feb 16 2012
    
  • Magma
    [(&+[Floor(n/NthPrime(k)): k in [1..n]]): n in [1..70]]; // G. C. Greubel, Nov 24 2018
    
  • Maple
    A013939 := proc(n) option remember;  `if`(n = 1, 0, a(n) + iquo(n+1, ithprime(n+1))) end:
    seq(A013939(i), i = 1..69);  # Peter Luschny, Jul 16 2011
  • Mathematica
    a[n_] := Sum[Floor[n/Prime[k]], {k, 1, n}]; Table[a[n], {n, 1, 69}] (* Jean-François Alcover, Jun 11 2012, from 2nd formula *)
    Accumulate[PrimeNu[Range[120]]] (* Harvey P. Dale, Jun 05 2015 *)
  • PARI
    t=0;vector(99,n,t+=omega(n)) \\ Charles R Greathouse IV, Jan 11 2012
    
  • PARI
    a(n)=my(s);forprime(p=2,n,s+=n\p);s \\ Charles R Greathouse IV, Jan 11 2012
    
  • PARI
    a(n) = sum(k=1, sqrtint(n), k * (primepi(n\k) - primepi(n\(k+1)))) + sum(k=1, n\(sqrtint(n)+1), if(isprime(k), n\k, 0)); \\ Daniel Suteu, Nov 24 2018
    
  • Python
    from sympy.ntheory import primefactors
    print([sum(len(primefactors(k)) for k in range(1,n+1)) for n in range(1, 121)]) # Indranil Ghosh, Mar 19 2017
    
  • Python
    from sympy import primerange
    def A013939(n): return sum(n//p for p in primerange(n+1)) # Chai Wah Wu, Oct 06 2024
    
  • Sage
    [sum(floor(n/nth_prime(k)) for k in (1..n)) for n in (1..70)] # G. C. Greubel, Nov 24 2018

Formula

a(n) = Sum_{k <= n} omega(k).
a(n) = Sum_{k = 1..n} floor( n/prime(k) ).
a(n) = a(n-1) + A001221(n).
a(n) = A093614(n) - A048865(n); see also A006218.
A027748(a(A000040(n))+1) = A000040(n), A082287(a(n)+1) = n.
a(n) = Sum_{k=1..n} pi(floor(n/k)). - Vladeta Jovovic, Jun 18 2006
a(n) = n log log n + O(n). - Charles R Greathouse IV, Jan 11 2012
a(n) = n*(log log n + B) + o(n), where B = 0.261497... is the Mertens constant A077761. - Arkadiusz Wesolowski, Oct 18 2013
G.f.: (1/(1 - x))*Sum_{k>=1} x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jan 02 2017
a(n) = Sum_{k=1..floor(sqrt(n))} k * (pi(floor(n/k)) - pi(floor(n/(k+1)))) + Sum_{p prime <= floor(n/(1+floor(sqrt(n))))} floor(n/p). - Daniel Suteu, Nov 24 2018
a(n) = Sum_{k>=1} k * A346617(n,k). - Alois P. Heinz, Aug 19 2021
a(n) = A001222(A048803(n+1)). - Flávio V. Fernandes, Jan 14 2025

Extensions

More terms from Henry Bottomley, Jul 03 2001

A061201 Partial sums of A007425: (tau<=)_3(n).

Original entry on oeis.org

1, 4, 7, 13, 16, 25, 28, 38, 44, 53, 56, 74, 77, 86, 95, 110, 113, 131, 134, 152, 161, 170, 173, 203, 209, 218, 228, 246, 249, 276, 279, 300, 309, 318, 327, 363, 366, 375, 384, 414, 417, 444, 447, 465, 483, 492, 495, 540, 546, 564, 573, 591, 594, 624, 633, 663
Offset: 1

Views

Author

Vladeta Jovovic, Apr 21 2001

Keywords

Comments

(tau<=)_k(n) = |{(x_1,x_2,...,x_k): x_1*x_2*...*x_k<=n}|, i.e., tau<=_k(n) is number of solutions to x_1*x_2*...*x_k<=n, x_i > 0.
A061201(n) is the number of 4-tuples (w,x,y,z) having all terms in {1,...,n} and w=x*y*z; see A211795 for a list of related counting sequences. - Clark Kimberling, Apr 28 2012
The formula for Sum_{k=1..n} d3(k) in the Benoit Cloitre article on page 15 is incorrect. For correct asymptotic formula see below or generate it in the Mathematica: Residue[Zeta[s]^3 * n^s/s, {s, 1}] // Expand. - Vaclav Kotesovec, Aug 19 2021

References

  • M. N. Huxley, Area, Lattice Points and Exponential Sums, Oxford, 1996; p. 239.

Crossrefs

Cf. tau_2(n): A000005, tau_3(n): A007425, tau_4(n): A007426, tau_5(n): A061200, tau_6(n): A034695, (unordered) 2-factorizations of n: A038548, (unordered) 3-factorizations of n: A034836, A001055, (tau<=)_2(n): A006218, (tau<=)_4(n): A061202, (tau<=)_5(n): A061203, (tau<=)_6(n): A061204.

Programs

  • Magma
    [&+[NumberOfDivisors(k)*Floor(n/k): k in [1..n]]: n in [1..56]];  // Bruno Berselli, Apr 13 2011
    
  • Maple
    b:= proc(k, n) option remember; uses numtheory;
         `if`(k=1, 1, add(b(k-1, d), d=divisors(n)))
        end:
    a:= proc(n) option remember; `if`(n=0, 0, b(3, n)+a(n-1)) end:
    seq(a(n), n=1..76);  # Alois P. Heinz, Oct 23 2023
  • Mathematica
    a[n_] := Sum[ DivisorSigma[0, k]*Floor[n/k], {k, 1, n}]; Table[a[n], {n, 1, 56}] (* Jean-François Alcover, Sep 20 2011, after Benoit Cloitre *)
    (* Asymptotics: *) n*(Log[n]^2/2 + (3*EulerGamma - 1)*Log[n] + 3*EulerGamma^2 - 3*EulerGamma - 3*StieltjesGamma[1] + 1) (* Vaclav Kotesovec, Sep 09 2018 *)
    Accumulate[a[n_]:=DivisorSum[n, DivisorSigma[0, #]&]; Array[a, 60]] (* Vincenzo Librandi, Jan 12 2020 *)
  • PARI
    a(n)=sum(k=1,n,numdiv(k)*floor(n/k)) \\ Benoit Cloitre, Apr 19 2007
    
  • PARI
    { for (n=1, 1000, write("b061201.txt", n, " ", sum(k=1, n, numdiv(k)*(n\k))) ) } \\ Harry J. Smith, Jul 18 2009
    
  • PARI
    my(N=60, x='x+O('x^N)); Vec(sum(k=1, N, numdiv(k)*x^k/(1-x^k))/(1-x)) \\ Seiichi Manyama, Jul 24 2022
    
  • Python
    from math import isqrt
    from sympy import integer_nthroot
    def A061201(n): return (m:=integer_nthroot(n,3)[0])**3+3*sum(-(s:=isqrt(r:=n//i))**2+(sum(r//k for k in range(1,s+1))<<1)-sum(n//(i*j) for j in range(1,m+1)) for i in range(1,m+1)) # Chai Wah Wu, Oct 23 2023

Formula

(tau<=)k(n) = Sum{i=1..n} tau_k(i).
a(n) = n * ( log(n)^2/2 + (3*g-1)*log(n) + 3*g^2-3*g-3*g1+1 ) + O(sqrt(n)), where g is the Euler-Mascheroni number ~ 0.57721... (see A001620), and g1 is the first Stieltjes constant ~ -0.072816 (see A082633). The determination of the precise size of the error term is an unsolved problem - see references. - Andrew Lelechenko, Apr 15 2011 [corrected by Vaclav Kotesovec, Sep 09 2018]
a(n) = Sum_{k=1..n} A000005(k)*floor(n/k). - Benoit Cloitre, Apr 19 2007
To compute a(n) for huge n (see A180365) in sublinear use a(n) = 3*Sum_{i=1..n3} A006218(n/i) - Sum_{j=1..n3} floor(n/(i*j)) + n3^3, where n3 = floor(n^(1/3)). - Andrew Lelechenko, Apr 15 2011
a(n) = Sum_{k=1..n} Sum_{i=1..n} floor(n/(i*k)). - Wesley Ivan Hurt, Sep 14 2017
G.f.: (1/(1-x)) * Sum_{k>=1} A000005(k) * x^k/(1 - x^k). - Seiichi Manyama, Jul 24 2022

A013937 a(n) = Sum_{k=1..n} floor(n/k^3).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 75, 76, 77, 78, 79, 80, 81, 82
Offset: 0

Views

Author

Keywords

Examples

			a(36) = [36/1]+[36/8]+[36/27]+[36/64]+... = 36+4+1+0+... = 41.
		

Crossrefs

Cf. A005187, A006218, A011371, A013936, A013939 for similar sequences.

Programs

Formula

a(n) = a(n-1)+A061704(n). a(n) = Sum_{k=1..n} floor((n/k)^(1/3)) with asymptotic formula: a(n) = zeta(3)*n+zeta(1/3)*n^(1/3)+O(n^theta) where theta<1/3 and we conjecture that theta=1/4+epsilon is the best possible choice. - Benoit Cloitre, Nov 05 2012
G.f.: (1/(1 - x))*Sum_{k>=1} x^(k^3)/(1 - x^(k^3)). - Ilya Gutkovskiy, Feb 11 2017

Extensions

More terms from Henry Bottomley, Jul 03 2001

A013938 a(n) = Sum_{k=1..n} floor(n/k^4).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 87
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Floor[n/k^4], {k, 1, n}], {n, 1, 100}] (* Vaclav Kotesovec, Oct 12 2019 *)
  • PARI
    a(n) = sum(k=1, n, n\k^4); \\ Michel Marcus, Feb 11 2017

Formula

G.f.: (1/(1 - x))*Sum_{k>=1} x^(k^4)/(1 - x^(k^4)). - Ilya Gutkovskiy, Feb 11 2017
a(n) ~ zeta(4)*n = Pi^4*n/90. - Vaclav Kotesovec, Oct 12 2019

A145353 Sum of the number of e-divisors of all numbers from 1 up to n.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 10, 12, 13, 14, 16, 17, 18, 19, 22, 23, 25, 26, 28, 29, 30, 31, 33, 35, 36, 38, 40, 41, 42, 43, 45, 46, 47, 48, 52, 53, 54, 55, 57, 58, 59, 60, 62, 64, 65, 66, 69, 71, 73, 74, 76, 77, 79, 80, 82, 83, 84, 85, 87, 88, 89, 91, 95, 96, 97, 98, 100, 101, 102, 103, 107
Offset: 1

Views

Author

Jaroslav Krizek and N. J. A. Sloane, Mar 03 2009

Keywords

Crossrefs

Equals partial sums of A049419.
Different from A013936 (which does not contain 52).

Programs

  • Mathematica
    f[p_, e_]  := DivisorSigma[0, e]; ediv[n_] := Times @@ (f @@@ FactorInteger[n]); Accumulate[Array[ediv, 100]] (* Amiram Eldar, Jun 23 2019 *)
  • PARI
    d(n) = {my(f = factor(n)); prod(i = 1, #f~, numdiv(f[i,2]));}
    lista(nmax) = {my(s = 0); for(n = 1, nmax, s += d(n); print1(s, ", ")); } \\ Amiram Eldar, Dec 08 2022

Formula

a(n) ~ c * n, where c = A327837. - Amiram Eldar, Dec 08 2022

A309125 a(n) = n + 2^2 * floor(n/2^2) + 3^2 * floor(n/3^2) + 4^2 * floor(n/4^2) + ...

Original entry on oeis.org

1, 2, 3, 8, 9, 10, 11, 16, 26, 27, 28, 33, 34, 35, 36, 57, 58, 68, 69, 74, 75, 76, 77, 82, 108, 109, 119, 124, 125, 126, 127, 148, 149, 150, 151, 201, 202, 203, 204, 209, 210, 211, 212, 217, 227, 228, 229, 250, 300, 326, 327, 332, 333, 343, 344, 349, 350, 351, 352, 357, 358, 359, 369, 454, 455, 456
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 13 2019

Keywords

Comments

Partial sums of A035316.

Crossrefs

Programs

  • Mathematica
    Table[Sum[k^2 Floor[n/k^2], {k, 1, n}], {n, 1, 66}]
    nmax = 66; CoefficientList[Series[1/(1 - x) Sum[k^2 x^(k^2)/(1 - x^(k^2)), {k, 1, Floor[nmax^(1/2)] + 1}], {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, k^2*(n\k^2)); \\ Seiichi Manyama, Aug 30 2021

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} k^2 * x^(k^2)/(1 - x^(k^2)).
a(n) ~ zeta(3/2)*n^(3/2)/3 - n/2. - Vaclav Kotesovec, Aug 30 2021

A060832 a(n) = Sum_{k>0} floor(n/k!).

Original entry on oeis.org

0, 1, 3, 4, 6, 7, 10, 11, 13, 14, 16, 17, 20, 21, 23, 24, 26, 27, 30, 31, 33, 34, 36, 37, 41, 42, 44, 45, 47, 48, 51, 52, 54, 55, 57, 58, 61, 62, 64, 65, 67, 68, 71, 72, 74, 75, 77, 78, 82, 83, 85, 86, 88, 89, 92, 93, 95, 96, 98, 99, 102, 103, 105, 106, 108, 109, 112, 113
Offset: 0

Views

Author

Henry Bottomley, May 01 2001

Keywords

Crossrefs

Programs

  • Magma
    [0] cat [&+[Floor(m/Factorial(k)):k in [1..m]]:m in [1..70]]; // Marius A. Burtea, Jul 11 2019
  • PARI
    a(n)={my(s=0, d=1, f=1); while (n>=d, s+=n\d; f++; d*=f); s} \\ Harry J. Smith, Jul 12 2009
    
  • PARI
    a(n) = round(sumpos(k=1, n\k!)); \\ Michel Marcus, Jan 24 2025
    

Formula

a(n) = a(n-1) + A055881(n).
a(n) = (e-1)*n + f(n) where f(n) < 0. - Benoit Cloitre, Jun 19 2002
f is unbounded in the negative direction. The assertion that f(n) < 0 is correct, since (e-1)*n = Sum_{k>=1} n/k! is term for term >= this sequence. - Franklin T. Adams-Watters, Nov 03 2005
G.f.: (1/(1 - x)) * Sum_{k>=1} x^(k!)/(1 - x^(k!)). - Ilya Gutkovskiy, Jul 11 2019

A309081 a(n) = n - floor(n/2^2) + floor(n/3^2) - floor(n/4^2) + ...

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 6, 6, 8, 9, 10, 10, 11, 12, 13, 12, 13, 15, 16, 16, 17, 18, 19, 19, 21, 22, 24, 24, 25, 26, 27, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 37, 38, 39, 38, 40, 42, 43, 43, 44, 46, 47, 47, 48, 49, 50, 50, 51, 52, 54, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 62
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 11 2019

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [m-&+[(-1)^(k)*Floor(m/k^2):k in [2..m] ]:m in [2..75]]; // Marius A. Burtea, Jul 12 2019
    
  • Maple
    N:= 100: # for a(1)..a(N)
    V:= Vector([$1..N]):
    for k from 2 to floor(sqrt(N)) do
      for j from 1 to N/k^2 do
        t:=min((j+1)*k^2-1,N);
        V[j*k^2..t]:= V[j*k^2..t] +~ (-1)^(k+1)*j
    od od:
    convert(V,list); # Robert Israel, Jul 12 2019
  • Mathematica
    Table[Sum[(-1)^(k + 1) Floor[n/k^2], {k, 1, n}], {n, 1, 75}]
    nmax = 75; CoefficientList[Series[1/(1 - x) Sum[(-1)^(k + 1) x^(k^2)/(1 - x^(k^2)), {k, 1, Floor[nmax^(1/2)] + 1}], {x, 0, nmax}], x] // Rest
    Table[Sum[Boole[IntegerQ[d^(1/2)] && OddQ[d]], {d, Divisors[n]}] - Sum[Boole[IntegerQ[d^(1/2)] && EvenQ[d]], {d, Divisors[n]}], {n, 1, 75}] // Accumulate
  • Python
    from math import isqrt
    def A309081(n): return n+sum((1 if k%2 else -1)*(n//k**2) for k in range(2,isqrt(n)+1)) # Chai Wah Wu, Dec 20 2021

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} (-1)^(k+1) * x^(k^2)/(1 - x^(k^2)).
a(n) ~ Pi^2*n/12. - Vaclav Kotesovec, Oct 12 2019

A344128 a(n) = Sum_{k=1..n} k * floor(n/k^2).

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 9, 12, 16, 17, 18, 21, 22, 23, 24, 31, 32, 36, 37, 40, 41, 42, 43, 46, 52, 53, 57, 60, 61, 62, 63, 70, 71, 72, 73, 85, 86, 87, 88, 91, 92, 93, 94, 97, 101, 102, 103, 110, 118, 124, 125, 128, 129, 133, 134, 137, 138, 139, 140, 143, 144, 145, 149, 164, 165, 166
Offset: 1

Views

Author

Wesley Ivan Hurt, May 09 2021

Keywords

Crossrefs

Partial sums of A069290.
Cf. A013936.

Programs

  • Maple
    b:= n-> mul((i[1]^(iquo(i[2], 2)+1)-1)/(i[1]-1), i=ifactors(n)[2]):
    a:= proc(n) a(n):= a(n-1)+b(n) end: a(0):=0:
    seq(a(n), n=1..66);  # Alois P. Heinz, May 14 2021
  • Mathematica
    Table[Sum[k*Floor[n/k^2], {k, n}], {n, 100}]

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} k * x^(k^2) / (1 - x^(k^2)). - Ilya Gutkovskiy, May 14 2021
Showing 1-10 of 14 results. Next