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.

A094820 Partial sums of A038548.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 11, 13, 15, 16, 19, 20, 22, 24, 27, 28, 31, 32, 35, 37, 39, 40, 44, 46, 48, 50, 53, 54, 58, 59, 62, 64, 66, 68, 73, 74, 76, 78, 82, 83, 87, 88, 91, 94, 96, 97, 102, 104, 107, 109, 112, 113, 117, 119, 123, 125, 127, 128, 134, 135, 137, 140, 144, 146, 150
Offset: 1

Views

Author

Vladeta Jovovic, Jun 12 2004

Keywords

Comments

a(n) = number of pairs (c,d) of integers such that 0 < c <= d and c*d <= n. - Clark Kimberling, Jun 18 2011
Equivalently, the number of representations of n in the form x + y*z, where x, y, and z are positive integers and y <= z. - John W. Layman, Feb 21 2012

Crossrefs

Programs

  • Maple
    ListTools:-PartialSums([seq(ceil(numtheory:-tau(n)/2), n=1..100)]); # Robert Israel, Feb 24 2016
  • Mathematica
    f[n_, k_] := Floor[n/k] - Floor[(n - 1)/k]
    g[n_, k_] := If[k^2 <= n, f[n, k], 0]
    Table[Sum[f[n, k], {k, 1, n}], {n, 1, 100}] (* A000005 *)
    t = Table[Sum[g[n, k], {k, 1, n}], {n, 1, 100}]
    (* A038548 *)
    a[n_] := Sum[t[[i]], {i, 1, n}]
    Table[a[n], {n, 1, 100}]  (* A094820 *)
    (* Clark Kimberling, Jun 18 2011 *)
    Table[Sum[Boole[d <= Sqrt[n]], {d, Divisors[n]}], {n, 1, 66}] // Accumulate (* Jean-François Alcover, Dec 13 2012 *)
  • PARI
    a(n) = sum(k=1, n, ceil(numdiv(k)/2)); \\ Michel Marcus, Feb 24 2016
    
  • Python
    from math import isqrt
    def A094820(n): return ((s:=isqrt(n))*(1-s)>>1)+sum(n//k for k in range(1,s+1)) # Chai Wah Wu, Oct 23 2023
  • Ruby
    def a(n)
        (1..Math.sqrt(n)).inject(0) { |accum, i| accum + 1 + (n/i).to_i - i }
      end # Peter Kagey, Feb 24 2016
    

Formula

G.f.: (1/(1 - x))*Sum_{k>=1} x^(k^2)/(1 - x^k). - Ilya Gutkovskiy, Apr 13 2017
a(n) ~ (log(n) + 2*gamma - 1)*n/2 + sqrt(n)/2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Aug 19 2019
a(n) = (A006218(n) + A000196(n))/2. - Ridouane Oudra, Nov 25 2022
a(n) = A211264(n) + A000196(n). - Ridouane Oudra, Sep 13 2024

A091627 Number of ordered integer pairs (b,c) with 1 <= b,c <= n such that both roots of x^2+bx+c=0 are integers.

Original entry on oeis.org

0, 0, 1, 2, 4, 5, 7, 8, 10, 12, 14, 15, 18, 19, 21, 23, 26, 27, 30, 31, 34, 36, 38, 39, 43, 45, 47, 49, 52, 53, 57, 58, 61, 63, 65, 67, 72, 73, 75, 77, 81, 82, 86, 87, 90, 93, 95, 96, 101, 103, 106, 108, 111, 112, 116, 118, 122, 124, 126, 127, 133, 134, 136, 139, 143
Offset: 0

Views

Author

Eric W. Weisstein, Jan 24 2004

Keywords

Comments

Also number of ordered pairs of positive integers (i, j) such that i+j <= n and i*j <= n. - Seiichi Manyama, Sep 04 2021

Crossrefs

Programs

  • Mathematica
    Accumulate[ Join[{0, 0}, Table[ Ceiling[ DivisorSigma[0, n]/2], {n, 2, 64}]]]  (* Jean-François Alcover, Oct 23 2012, after Vladeta Jovovic *)
  • PARI
    a(n) = sum(i=1, n, sum(j=i, n-i, i*j<=n)); \\ Seiichi Manyama, Sep 04 2021
    
  • PARI
    N=66; x='x+O('x^N); concat([0, 0], Vec((-x+sum(k=1, sqrtint(N), x^k^2/(1-x^k)))/(1-x))) \\ Seiichi Manyama, Sep 04 2021
    
  • Python
    from math import isqrt
    def A091627(n):
        m = isqrt(n)
        return 0 if n == 0 else sum(n//k for k in range(1, m+1))-m*(m-1)//2-1 # Chai Wah Wu, Oct 07 2021

Formula

a(n) = A091626(n) - n - 1. a(n) = a(n-1) + ceiling(tau(n)/2), n>1. Partial sums of A038548. - Vladeta Jovovic, Jun 12 2004
G.f.: (1/(1 - x)) * (-x + Sum_{k>=1} x^(k^2)/(1 - x^k)). - Seiichi Manyama, Sep 04 2021

A379597 a(n) is the number of distinct solution sets to the quadratic equations u*x^2 + v*x + w = 0 with integer coefficients u, v, w, abs(u) + abs(v) + abs(w) <= n having a nonnegative discriminant.

Original entry on oeis.org

1, 4, 12, 24, 50, 80, 134, 192, 276, 366, 510, 632, 834, 1018, 1262, 1502, 1858, 2136, 2584, 2956, 3448, 3910, 4576, 5076, 5834, 6488, 7320, 8066, 9136, 9892, 11118, 12114, 13358, 14482, 15978, 17108, 18862, 20272, 22024, 23532, 25700, 27216, 29600, 31486, 33746
Offset: 1

Views

Author

Felix Huber, Feb 18 2025

Keywords

Comments

Quadratic equations u*x^2 + v*x + w = 0 with real coefficients u, v, w and nonnegative discriminant v^2 - 4*u*w have two real solutions.
a(n) is even for n >= 2.

Examples

			a(3) = 12 because there are 12 equations with abs(u) + abs(v) + abs(w) <= 3 and distinct solution set having a nonnegative discriminant: (u, v, w) = (1, 0, 0), (1, -1, 0), (1, 1, 0), (1, 0, -1), (1, -1, -1), (1, 1, -1), (1, -2, 0), (1, 2, 0), (1, 0, -2), (2, -1, 0), (2, 1, 0), and (2, 0, -1). Multiplied equations like 2*(1, 0, 0) = (2, 0, 0) or (-1)*(1, -1, 0) = (-1, 1, 0) do not have a distinct solution set.
		

Crossrefs

Programs

  • Maple
    A379597:=proc(n)
       option remember;
       local a,u,v,w;
       if n=1 then
          1
       else
          a:=0;	
          for u to n-1 do
             for v from 0 to n-u do
                w:=n-u-v;
                if igcd(u,v,w)=1 then
                   if v=0 then
                      a:=a+1
                   elif w=0 or w>=v^2/(4*u) then
                      a:=a+2
                   else
                      a:=a+4
                   fi
                fi
             od
          od;
          a+procname(n-1)
       fi;
    end proc;
    seq(A379597(n),n=1..45);

A381710 a(n) is the number of distinct solution sets to the quadratic equations u*x^2 + v*x + w = 0 with integer coefficients u, v, w, abs(u) + abs(v) + abs(w) <= n having a negative discriminant.

Original entry on oeis.org

0, 1, 5, 11, 25, 39, 69, 99, 143, 189, 265, 327, 437, 529, 653, 777, 965, 1107, 1343, 1531, 1783, 2021, 2367, 2619, 3013, 3343, 3771, 4153, 4707, 5087, 5721, 6229, 6865, 7437, 8197, 8767, 9677, 10391, 11279, 12043, 13155, 13919, 15147, 16101, 17249, 18301, 19763
Offset: 1

Views

Author

Felix Huber, Mar 06 2025

Keywords

Comments

Quadratic equations u*x^2 + v*x + w = 0 with real coefficients u, v, w and negative discriminant v^2 - 4*u*w have two complex solutions.
a(n) is odd for n >= 2.

Examples

			a(3) = 5 because there are 5 equations with abs(u) + abs(v) + abs(w) <= 3 and distinct solution set having a negative discriminant: (u, v, w) = (1, 0, 1), (1, -1, 1), (1, 1, 1), (1, 0, 2), (2, 0, 1). Multiplied equations like (-1)*(1, -1, 1) = (-1, 1, -1) do not have a distinct solution set.
		

Crossrefs

Programs

  • Maple
    A381710:=proc(n)
       option remember;
       local a,u,v,w;
          if n=1 then
          0
       else
          a:=0;
          for u to n-1 do
             for v from 0 to n-u do
                w:=n-u-v;
                   if igcd(u,v,w)=1 then
                      if v=0 then
                         a:=a+1
                      elif w>v^2/(4*u) then
                        a:=a+2
                   fi
                fi
             od
          od;
          a+procname(n-1)
       fi;
    end proc;
    seq(A381710(n),n=1..47);

A381711 a(n) = A379597(n) - A381710(n).

Original entry on oeis.org

1, 3, 7, 13, 25, 41, 65, 93, 133, 177, 245, 305, 397, 489, 609, 725, 893, 1029, 1241, 1425, 1665, 1889, 2209, 2457, 2821, 3145, 3549, 3913, 4429, 4805, 5397, 5885, 6493, 7045, 7781, 8341, 9185, 9881, 10745, 11489, 12545, 13297, 14453, 15385, 16497, 17517, 18917
Offset: 1

Views

Author

Felix Huber, Mar 08 2025

Keywords

Comments

a(n) is odd.

Crossrefs

Programs

  • Maple
    A381711:=proc(n)
       option remember;
       local a,u,v,w;
       if n=1 then
          1
       else
          a:=0;
          for u to n-1 do
             for v from 0 to n-u do
                w:=n-u-v;
                if igcd(u,v,w)=1 and v<>0 then
                   if w=0 or w=v^2/(4*u) then
                      a:=a+2
                   elif wA381711(n),n=1..47);

Formula

a(n) = A379597(n) - A381710(n).

A347275 a(n) is the number of nonnegative ordered pairs (a,b) satisfying (a+b <= n) and (a*b <= n).

Original entry on oeis.org

1, 3, 6, 10, 15, 19, 25, 29, 35, 40, 46, 50, 58, 62, 68, 74, 81, 85, 93, 97, 105, 111, 117, 121, 131, 136, 142, 148, 156, 160, 170, 174, 182, 188, 194, 200, 211, 215, 221, 227, 237, 241, 251, 255, 263, 271, 277, 281, 293, 298, 306, 312, 320, 324, 334, 340, 350, 356
Offset: 0

Views

Author

Vo Hoang Anh, Aug 25 2021

Keywords

Comments

Except for a(0) and a(1), a(n) = A006218(n + 1) - A049820(n + 1) + 2n - 1. Tested with first 10^9 numbers.
Since there are only O(sqrt(n)) different integers in the set S = {floor(n / 1), floor(n / 2), ..., floor(n / n)}, we can calculate a(n) in O(sqrt(n)).
There are many methods based on different kinds of formulas that are also known to work in O(n^(1/3)), but not all are effective. Some of them have lower complexity, but their use of too much division and multiplication makes them slower than expected; some of them use precalculation and caching to speed things up but are not as effective as the division-free algorithm that Richard Sladkey described.
a(n) is approximately epsilon*n^(1+delta) as delta approaches 0 and epsilon approaches +oo for n approaching +oo. The tighter relationship between epsilon and delta is unknown. Tested with 10^7 numbers n <= 10^15 using power regression algorithm.
For n > 1, a(n) = A006218(n)+2n-1. - Chai Wah Wu, Oct 07 2021

Examples

			a(1) = 3: (0, 0), (0, 1), (1, 0).
		

Crossrefs

Programs

  • C
    int T(int n) { int cnt = 0; for (int a = 0; a <= n; ++a) for (int b = 0; b <= n - a; ++b) if (a * b <= n) ++cnt; return cnt; }
    
  • Maple
    A347275 := proc(n)
        local a,i,j ;
        a := 0 ;
        for i from 0 to n do
        for j from 0 to n-i do
            if i*j <= n then
                a := a+1 ;
            end if;
        end do:
        end do:
        a ;
    end proc:
    seq(A347275(n),n=0..40) ; # R. J. Mathar, Sep 15 2021
  • Mathematica
    a[n_] := Sum[Boole[i*j <= n], {i, 0, n}, {j, 0, n-i}];
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Nov 08 2023 *)
  • Python
    from math import isqrt
    def A347275(n): return 2*n+1 if n <= 1 else 2*(n+sum(n//k for k in range(1, isqrt(n)+1)))-isqrt(n)**2-1 # Chai Wah Wu, Oct 07 2021

Formula

a(n) = Sum_{a=0..n} Sum_{b=0..n-a} [a*b<=n], where [] is the Iverson bracket.
Showing 1-6 of 6 results.