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.

A049798 a(n) = (1/2)*Sum_{k = 1..n} T(n,k), array T as in A049800.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 2, 2, 3, 7, 2, 7, 10, 8, 8, 15, 11, 19, 16, 15, 22, 32, 19, 25, 34, 34, 33, 46, 33, 47, 47, 48, 61, 65, 45, 62, 77, 79, 68, 87, 74, 94, 97, 86, 105, 127, 98, 114, 120, 124, 129, 154, 141, 151, 142, 147, 172, 200, 151, 180
Offset: 1

Views

Author

Keywords

Comments

a(n) is the sum of the remainders after dividing each larger part by its corresponding smaller part for each partition of n+1 into two parts. - Wesley Ivan Hurt, Dec 20 2020

Examples

			From _Lei Zhou_, Mar 10 2014: (Start)
For n = 3, n+1 = 4, floor((n+1)/2) = 2, mod(4,2) = 0, and so a(3) = 0.
For n = 4, n+1 = 5, floor((n+1)/2) = 2, mod(5,2) = 1, and so a(4) = 1.
...
For n = 12, n+1 = 13, floor((n+1)/2) = 6, mod(13,2) = 1, mod(13,3) = 1, mod(13,4) = 1, mod(13,5) = 3, mod(13,6) = 1, and so a(12) = 1 + 1 + 1 + 3 + 1 = 7. (End)
		

Crossrefs

Half row sums of A049800.

Programs

  • GAP
    List([1..60], n-> Sum([1..n], k-> (n+1) mod Int((k+1)/2))/2 ); # G. C. Greubel, Dec 09 2019
    
  • Magma
    [ (&+[(n+1) mod Floor((k+1)/2): k in [1..n]])/2: n in [1..60]]; // G. C. Greubel, Dec 09 2019
    
  • Maple
    seq( add( (n+1) mod floor((k+1)/2), k=1..n)/2, n=1..60); # G. C. Greubel, Dec 09 2019
  • Mathematica
    Table[Sum[Mod[n+1, Floor[(k+1)/2]], {k,n}]/2, {n, 60}] (* G. C. Greubel, Dec 09 2019 *)
  • PARI
    vector(60, n, sum(k=1,n, lift(Mod(n+1, (k+1)\2)) )/2 ) \\ G. C. Greubel, Dec 09 2019
    
  • Python
    def A049798(n): return sum((n+1)%k for k in range(2,(n+1>>1)+1)) # Chai Wah Wu, Oct 20 2023
  • Sage
    def a(n):
        return sum([(n+1)%k for k in range(2,floor((n+3)/2))])
    # Ralf Stephan, Mar 14 2014
    

Formula

a(n) = Sum_{k=2..floor((n+1)/2)} ((n+1) mod k). - Lei Zhou, Mar 10 2014
a(n) = A004125(n+1) - A008805(n-2), for n >= 2. - Carl Najafi, Jan 31 2013
a(n) = Sum_{i = 1..ceiling(n/2)} ((n-i+1) mod i). - Wesley Ivan Hurt, Jan 05 2017

A049800 Triangular array T, read by rows: T(n,k) = (n+1) mod floor((k+1)/2), k = 1..n and n >= 1.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Array T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  0;
  0, 0;
  0, 0, 0;
  0, 0, 1, 1;
  0, 0, 0, 0, 0;
  0, 0, 1, 1, 1, 1;
  0, 0, 0, 0, 2, 2, 0;
  0, 0, 1, 1, 0, 0, 1, 1;
  0, 0, 0, 0, 1, 1, 2, 2, 0;
  0, 0, 1, 1, 2, 2, 3, 3, 1, 1;
  0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0;
  ...
		

Crossrefs

One-half the row sums are in A049798.

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> (n+1) mod Int((k+1)/2) ))); # G. C. Greubel, Dec 09 2019
  • Magma
    [ (n+1) mod Floor((k+1)/2): k in [1..n], n in [1..15]]; // G. C. Greubel, Dec 09 2019
    
  • Maple
    # To get the sequence:
    seq(seq((n+1) mod floor((k+1)/2), k = 1..n), n = 1..30);
    # To get the triangular array:
    for n from 1 to 30 do
        seq((n+1) mod floor((k+1)/2), k = 1..n);
    end do; # Petros Hadjicostas, Nov 20 2019
  • Mathematica
    Table[Mod[n+1, Floor[(k+1)/2]], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 09 2019 *)
  • PARI
    T(n,k) = lift(Mod(n+1,(k+1)\2));
    for(n=1, 15, for(k=1, n, print1(T(n,k), ", "))) \\ G. C. Greubel, Dec 09 2019
    
  • Sage
    [[ mod(n+1, floor((k+1)/2)) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 09 2019
    

Extensions

Name edited by Petros Hadjicostas, Nov 20 2019

A049801 Triangular array T, read by rows: T(n,k) = n mod floor(k/3), k = 3..n and n >= 3.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0
Offset: 3

Views

Author

Keywords

Examples

			Array T(n,k) (with rows n >= 3 and columns k >= 3) begins as follows:
  0;
  0, 0;
  0, 0, 0;
  0, 0, 0, 0;
  0, 0, 0, 1, 1;
  0, 0, 0, 0, 0, 0;
  0, 0, 0, 1, 1, 1, 0;
  0, 0, 0, 0, 0, 0, 1, 1;
  0, 0, 0, 1, 1, 1, 2, 2, 2;
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1;
  0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2;
  ...
		

Crossrefs

Row sums are in A049799.

Programs

  • GAP
    Flat(List([3..15], n-> List([3..n], k-> n mod Int(k/3) ))); # G. C. Greubel, Dec 09 2019
  • Magma
    [ n mod Floor(k/3): k in [3..n], n in [3..15]]; // G. C. Greubel, Dec 09 2019
    
  • Maple
    # To get the sequence:
    seq(seq(n mod floor(k/3), k = 3..n), n = 3..30);
    # To get the triangular array:
    for n from 3 to 30 do
        seq(n mod floor(k/3), k = 3..n);
    end do; # Petros Hadjicostas, Nov 20 2019
  • Mathematica
    Table[Mod[n, Floor[k/3]], {n,3,15}, {k,3,n}]//Flatten (* G. C. Greubel, Dec 09 2019 *)
  • PARI
    T(n,k) = lift(Mod(n, k\3)); \\ G. C. Greubel, Dec 09 2019
    
  • Sage
    [[ mod(n, floor(k/3)) for k in (3..n)] for n in (3..15)] # G. C. Greubel, Dec 09 2019
    

Extensions

Name edited by and more terms from Petros Hadjicostas, Nov 20 2019
Showing 1-3 of 3 results.