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

A106846 a(n) = Sum_{k + l*m <= n} (k + l*m), with 0 <= k,l,m <= n.

Original entry on oeis.org

0, 4, 22, 64, 144, 269, 461, 720, 1072, 1522, 2092, 2774, 3626, 4614, 5776, 7126, 8694, 10445, 12461, 14684, 17204, 19997, 23077, 26412, 30156, 34206, 38600, 43352, 48532, 54042, 60072, 66458, 73338, 80664, 88450, 96710, 105638, 114999
Offset: 0

Views

Author

Ralf Stephan, May 06 2005

Keywords

Crossrefs

Programs

  • Maple
    A106846 := 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
                    m := n ;
                else
                    m := floor((n-k)/l) ;
                end if;
                if m >=0 then
                    m := min(m,n) ;
                    a := a+(m+1)*k+l*m*(m+1)/2 ;
                end if;
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 17 2012
  • Mathematica
    A106846[n_] := Module[{a, k, l, m }, a = 0; For[k = 0, k <= n, k++, For[l = 0, l <= n, l++, If[l == 0, m = n, m = Floor[(n - k)/l]]; If[m >= 0, m = Min[m, n]; a = a + (m + 1)*k + l*m*(m + 1)/2 ]]]; a];
    Table[A106846[n], {n, 0, 40}] (* Jean-François Alcover, Apr 04 2024, after R. J. Mathar *)

Formula

From Ridouane Oudra, Jun 24 2024: (Start)
a(n) = (1/2) * (n*(n+1)*(2*n+1) + Sum_{k=1..n} (n^2 + n + k - k^2) * tau(k)).
a(n) = (1/2) * (A055112(n) + (n^2 + n) * A006218(n) + A143127(n) - A319085(n)).
a(n) = A059270(n) + A143127(n) + A106847(n). (End)
Showing 1-3 of 3 results.