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

A106634 Number of ways to express n as i*j+k*l, with i,j,k,l in the range [0..n].

Original entry on oeis.org

1, 6, 21, 32, 62, 58, 124, 88, 173, 158, 226, 156, 380, 194, 340, 356, 466, 274, 613, 316, 690, 536, 596, 404, 1060, 552, 734, 728, 1032, 546, 1376, 596, 1213, 932, 1026, 976, 1858, 750, 1180, 1144, 1910, 854, 2048, 908, 1784, 1730, 1500, 1016, 2800
Offset: 0

Views

Author

Ralf Stephan, May 06 2005

Keywords

Comments

Number of ordered 4-tuples [i,j,k,l] with n=i*j+k*l and i,j,k,l in the range [0..n].
a(n) is odd iff n is in A001105.

Examples

			a(1)=6: the 4-tuples ijkl are 1100, 1101, 1110, 0011, 0111, 1011.
a(2)=21: 1111, 2100, 210x, 21x0, 1200, 120x, 12x0, where x = 1 or 2, and ten more with the two halves swapped.
		

Crossrefs

Programs

  • Maple
    A106634 := proc(n)
        local a,i,j,k,l ;
        a := 0 ;
        for i from 0 to n do
            for j from 0 to n do
                if i*j > n then
                    break;
                end if;
                for k from 0 to n do
                    if i*j = n then
                        # treat l=0 separately
                        a := a+1 ;
                    end if;
                    # l=1..n
                    if k =0 then
                        if i*j=n then
                            a := a+n ;
                        end if;
                    else
                        l := (n-i*j)/k ;
                        if l >=1 and l <=n and type(l,'integer') then
                            a := a+1 ;
                        end if;
                    end if;
                end do:
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 17 2012
  • Mathematica
    list[n_] := Module[{v, i, j}, v[_] = 0;
    For[i = 2, i <= n, i++, For[j = 1, j <= Min[Quotient[n, i], i-1], j++, v[i*j]+= 2]];
    For[i = 1, i <= Floor@Sqrt[n], i++, v[i^2]++];
    Join[{1}, Table[2 Sum[v[j] v[i-j], {j, Quotient[i, 2]+1, i-1}]+If[OddQ[i], 0, v[i/2]^2]+(4i+2) v[i], {i, 1, n}]]];
    list[48] (* Jean-François Alcover, Jun 04 2023, after Charles R Greathouse IV *)
  • PARI
    list(n)={
        my(v=vector(n));
        for(i=2,n,for(j=1,min(n\i,i-1),v[i*j]+=2));
        for(i=1,sqrtint(n),v[i^2]++);
        concat(1,vector(n,i,2*sum(j=i\2+1,i-1,v[j]*v[i-j])+if(i%2,,v[i/2]^2)+(4*i+2)*v[i]))
    }; \\ Charles R Greathouse IV, Oct 17 2012

Formula

From Ridouane Oudra, Jul 20 2024: (Start)
a(n) = (4*n + 2)*tau(n) + Sum_{i=1..n-1} tau(i)*tau(n-i), for n>0 ;
a(n) = (4*n + 2)*A000005(n) + A055507(n-1), for n>0 ;
a(n) = 4*A038040(n) + A062011(n) + A055507(n-1), for n>0. (End)

Extensions

Definition clarified by N. J. A. Sloane, Jul 07 2012

A106633 Number of ways to express n as k+l*m, with k, l, m all in the range [0..n].

Original entry on oeis.org

1, 4, 8, 12, 17, 21, 27, 31, 37, 42, 48, 52, 60, 64, 70, 76, 83, 87, 95, 99, 107, 113, 119, 123, 133, 138, 144, 150, 158, 162, 172, 176, 184, 190, 196, 202, 213, 217, 223, 229, 239, 243, 253, 257, 265, 273, 279, 283, 295, 300, 308, 314, 322, 326, 336, 342, 352
Offset: 0

Views

Author

Ralf Stephan, May 06 2005

Keywords

Comments

Number of ordered triples [k,l,m] with n = k+l*m and k, l, m all in the range [0..n].
From R. J. Mathar, Jun 30 2013: (Start)
A010766 is the following array A read by antidiagonals:
1, 1, 1, 1, 1, 1, ...
2, 1, 1, 1, 1, 1, ...
3, 2, 1, 1, 1, 1, ...
4, 2, 2, 1, 1, 1, ...
5, 3, 2, 2, 1, 1, ...
6, 3, 2, 2, 2, 1, ...
and apparently a(n) is the hook sum Sum_{k=0..n} A(n,k) + Sum_{r=0..n-1} A(r,n). (End)

Examples

			0+1*2 = 0+2*1 = 1+1*1 = 2+0*0 = 2+0*1 = 2+0*2 = 2+1*0 = 2+2*0 = 2, so a(2)=8.
a(3)=12: 3+0*0, 3+0*m (6), 2+1*1, 1+2*1 (2), 0+3*1 (2).
		

Crossrefs

Programs

  • Maple
    A106633 := proc(n)
        local a, k, l, m ;
        a := 0 ;
        for k from 0 to n do
            for l from 0 to n do
                if l = 0 then
                    if k = n then
                        a := a+n+1 ;
                    end if;
                else
                    m := (n-k)/l ;
                    if type(m,'integer') then
                        a := a+1 ;
                    end if;
                end if;
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 17 2012
  • Mathematica
    A106633[n_] := Module[{a, m}, a = 0; Do[If[l == 0, If[k == n, a = a + n + 1], m = (n - k)/l; If[IntegerQ[m], a = a + 1]], {k, 0, n}, {l, 0, n}]; a];
    Table[A106633[n], {n, 0, 56}] (* Jean-François Alcover, Jun 10 2023, after R. J. Mathar *)
  • PARI
    list(n)={
        my(v=vector(n),t);
        for(i=2,n,for(j=1,min(n\i,i-1),v[i*j]+=2));
        for(i=1,sqrtint(n),v[i^2]++);
        concat(1,vector(n,k,2*k+1+t+=v[k]))
    }; \\ Charles R Greathouse IV, Oct 17 2012

Formula

From Ridouane Oudra, Apr 22 2024: (Start)
a(n) = 2*n + 1 + Sum_{k=1..n} floor(n/k);
a(n) = 2*n + 1 + Sum_{k=1..n} tau(k);
a(n) = A005408(n) + A006218(n). (End)

Extensions

Definition clarified by N. J. A. Sloane, Jul 07 2012

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

Views

Author

Ralf Stephan, May 06 2005

Keywords

Examples

			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.
		

Crossrefs

Cf. A106633, A106634, A106846, A078567 (number of terms).

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    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

Formula

From Ridouane Oudra, Jun 02 2024: (Start)
a(n) = (1/2)*Sum_{k=1..n} (n^2 + n - k^2 - k)*tau(k);
a(n) = (1/2)*(n^2 + n)*A006218(n) - Sum_{k=1..n} A143272(k);
a(n) = (1/2)*((n + 1)*A143274(n) - A143127(n) - A319085(n)). (End)
a(n) ~ n^3 * (log(n) + 2*gamma - 4/3)/3, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jun 15 2024
Showing 1-3 of 3 results.