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.

A072481 a(n) = Sum_{k=1..n} Sum_{d=1..k} (k mod d).

Original entry on oeis.org

0, 0, 0, 1, 2, 6, 9, 17, 25, 37, 50, 72, 89, 117, 148, 184, 220, 271, 318, 382, 443, 513, 590, 688, 773, 876, 988, 1113, 1237, 1388, 1526, 1693, 1860, 2044, 2241, 2459, 2657, 2890, 3138, 3407, 3665, 3962, 4246, 4571, 4899, 5238, 5596, 5999, 6373, 6787, 7207
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 02 2002

Keywords

Comments

Previous name was: Sums of sums of remainders when dividing n by k, 0
Partial sums of A004125.

Crossrefs

Programs

  • Maple
    N:= 200: # to get a(0) to a(N)
    S:= series(add(k*x^(2*k)/(1-x^k),k=1..floor(N/2))/(1-x)^2, x, N+1):
    seq((n^3-n)/6 - coeff(S,x,n), n=0..N); # Robert Israel, Aug 13 2015
  • Mathematica
    a[n_] := n(n+1)(2n+1)/6 - Sum[DivisorSigma[1, k] (n-k+1), {k, 1, n}];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 08 2019, after Omar E. Pol *)
  • PARI
    a(n) = sum(k=1, n, sum(d=1, k, k % d)); \\ Michel Marcus, Feb 11 2014
  • Python
    for n in range(99):
        s = 0
        for k in range(1,n+1):
          for d in range(1,k+1):
            s += k % d
        print(str(s), end=',')
    
  • Python
    from math import isqrt
    def A072481(n): return (n*(n+1)*((n<<1)+1)-((s:=isqrt(n))**2*(s+1)*((s+1)*((s<<1)+1)-6*(n+1))>>1)-sum((q:=n//k)*(-k*(q+1)*(3*k+(q<<1)+1)+3*(n+1)*((k<<1)+q+1)) for k in range(1,s+1)))//6 # Chai Wah Wu, Oct 22 2023
    

Formula

a(n) = Sum_{k=1..n} Sum_{d=1..k}(k mod d).
a(n) = A000330(n) - A175254(n), n >= 1. - Omar E. Pol, Aug 12 2015
G.f.: x^2/(1-x)^4 - (1-x)^(-2) * Sum_{k>=1} k*x^(2*k)/(1-x^k). - Robert Israel, Aug 13 2015
a(n) ~ (1 - Pi^2/12)*n^3/3. - Vaclav Kotesovec, Sep 25 2016

Extensions

New name and a(0) from Alex Ratushnyak, Feb 10 2014

A224924 Sum_{i=0..n} Sum_{j=0..n} (i AND j), where AND is the binary logical AND operator.

Original entry on oeis.org

0, 1, 3, 12, 16, 33, 63, 112, 120, 153, 211, 300, 408, 553, 735, 960, 976, 1041, 1155, 1324, 1536, 1809, 2143, 2544, 2952, 3433, 3987, 4620, 5320, 6105, 6975, 7936, 7968, 8097, 8323, 8652, 9072, 9601, 10239, 10992, 11800, 12729, 13779, 14956, 16248, 17673, 19231, 20928
Offset: 0

Author

Alex Ratushnyak, Apr 19 2013

Keywords

Comments

For n>0, a(2^n)-A000217(2^n)=a(2^n-1)-A000217(2^n-1) [See links]. - R. J. Cano, Aug 21 2013

Crossrefs

Programs

  • Maple
    read("transforms") :
    A224924 := proc(n)
        local a,i,j ;
        a := 0 ;
        for i from 0 to n do
        for j from 0 to n do
            a := a+ANDnos(i,j) ;
        end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Aug 22 2013
  • Mathematica
    a[n_] := Sum[BitAnd[i, j], {i, 0, n}, {j, 0, n}];
    Table[a[n], {n, 0, 20}]
    (* Enrique Pérez Herrero, May 30 2015 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,n,bitand(i,j))); \\ R. J. Cano, Aug 21 2013
  • Python
    for n in range(99):
        s = 0
        for i in range(n+1):
          for j in range(n+1):
            s += i & j
        print(s, end=',')
    

Formula

a(2^n) = a(2^n - 1) + 2^n.
a(n) -a(n-1) = 2*A222423(n) -n. - R. J. Mathar, Aug 22 2013

A224932 Maximal side length b <= a = n of integer parallelograms.

Original entry on oeis.org

0, 0, 0, 3, 5, 0, 6, 6, 8, 10, 10, 11, 13, 13, 15, 15, 17, 16, 18, 20, 20, 21, 21, 23, 25, 26, 26, 27, 29, 30, 29, 31, 31, 34, 35, 33, 37, 37, 39, 40, 41, 41, 41, 43, 45, 45, 46, 46, 48, 50
Offset: 1

Author

Reiner Moewald, Apr 20 2013

Keywords

Crossrefs

Showing 1-3 of 3 results.