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.

A049767 Triangular array T, read by rows: T(n,k) = (k^2 mod n) + (n^2 mod k), for k = 1..n and n >= 1.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 5, 5, 2, 0, 1, 4, 3, 4, 2, 0, 1, 5, 3, 3, 8, 2, 0, 1, 4, 2, 0, 5, 8, 2, 0, 1, 5, 0, 8, 8, 3, 8, 2, 0, 1, 4, 10, 6, 5, 10, 11, 8, 2, 0, 1, 5, 10, 6, 4, 4, 7, 10, 8, 2, 0, 1, 4, 9, 4, 5, 0, 5, 4, 9, 8, 2, 0, 1, 5, 10, 4
Offset: 1

Views

Author

Keywords

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  0;
  1,  0;
  1,  2,  0;
  1,  0,  2,  0;
  1,  5,  5,  2,  0;
  1,  4,  3,  4,  2,  0;
  1,  5,  3,  3,  8,  2,  0;
  1,  4,  2,  0,  5,  8,  2,  0;
  1,  5,  0,  8,  8,  3,  8,  2,  0;
  1,  4, 10,  6,  5, 10, 11,  8,  2,  0;
  ...
		

Crossrefs

Row sums are in A049768.

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> PowerMod(k,2,n) + PowerMod(n,2,k) ))); # G. C. Greubel, Dec 13 2019
  • Magma
    [[Modexp(k,2,n) + Modexp(n,2,k): k in [1..n]]: n in [1..15]]; // G. C. Greubel, Dec 13 2019
    
  • Maple
    seq(seq( `mod`(k^2, n) + `mod`(n^2, k), k = 1..n), n = 1..15); # G. C. Greubel, Dec 13 2019
  • Mathematica
    Table[PowerMod[k,2,n] + PowerMod[n,2,k], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 13 2019 *)
  • PARI
    T(n,k) = lift(Mod(k,n)^2) + lift(Mod(n,k)^2);
    for(n=1,15, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Dec 13 2019
    
  • Sage
    [[power_mod(k,2,n) + power_mod(n,2,k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 13 2019
    

Formula

T(n, k) = A048152(n, k) + A049759(n, k). - Michel Marcus, Nov 21 2019

A049766 a(n) = Sum_{k=1..n} T(n,k), array T as in A049765.

Original entry on oeis.org

0, 1, 4, 7, 14, 18, 29, 36, 48, 58, 77, 83, 106, 122, 141, 156, 187, 200, 235, 251, 280, 308, 351, 361, 403, 437, 476, 502, 557, 573, 632, 663, 712, 758, 813, 828, 899, 951, 1010, 1038, 1117, 1145, 1228, 1274, 1329, 1393, 1484
Offset: 1

Views

Author

Keywords

Crossrefs

Row sums of A049765.

Programs

  • GAP
    List([1..50], n-> Sum([1..n], k-> (k mod n) + (n mod k)) ); # G. C. Greubel, Dec 13 2019
  • Magma
    [&+[ (k mod n) + (n mod k): k in [1..n]]: n in [1..50]]; // G. C. Greubel, Dec 13 2019
    
  • Maple
    seq( add( `mod`(k, n) + `mod`(n, k), k = 1..n), n = 1..50); # G. C. Greubel, Dec 13 2019
  • Mathematica
    T[n_, k_] := Mod[n, k] + Mod[k, n]; Map[Total[T[#, Range[#]]] &, Range[80]] (* Carl Najafi, Aug 24 2011 *)
  • PARI
    a(n) = sum(k=1, n, k%n + n%k); \\ Michel Marcus, Aug 22 2015
    
  • Sage
    [sum((k%n) + (n%k) for k in (1..n)) for n in (1..50)] # G. C. Greubel, Dec 13 2019
    

A049765 Triangular array T, read by rows: T(n,k) = (k mod n) + (n mod k), for k = 1..n and n >= 1.

Original entry on oeis.org

0, 1, 0, 1, 3, 0, 1, 2, 4, 0, 1, 3, 5, 5, 0, 1, 2, 3, 6, 6, 0, 1, 3, 4, 7, 7, 7, 0, 1, 2, 5, 4, 8, 8, 8, 0, 1, 3, 3, 5, 9, 9, 9, 9, 0, 1, 2, 4, 6, 5, 10, 10, 10, 10, 0, 1, 3, 5, 7, 6, 11, 11, 11, 11, 11, 0, 1, 2, 3, 4, 7, 6, 12, 12, 12, 12, 12, 0
Offset: 1

Views

Author

Keywords

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  0;
  1, 0;
  1, 3, 0;
  1, 2, 4, 0;
  1, 3, 5, 5, 0;
  1, 2, 3, 6, 6,  0;
  1, 3, 4, 7, 7,  7,  0;
  1, 2, 5, 4, 8,  8,  8,  0;
  1, 3, 3, 5, 9,  9,  9,  9,  0;
  1, 2, 4, 6, 5, 10, 10, 10, 10, 0;
  ...
		

Crossrefs

Row sums are in A049766.

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> (k mod n) + (n mod k) ))); # G. C. Greubel, Dec 13 2019
  • Magma
    [[(k mod n) + (n mod k): k in [1..n]]: n in [1..15]]; // G. C. Greubel, Dec 13 2019
    
  • Maple
    seq(seq( `mod`(k, n) + `mod`(n, k), k = 1..n), n = 1..15); # G. C. Greubel, Dec 13 2019
  • Mathematica
    Table[Mod[k,n] + Mod[n,k], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 13 2019 *)
  • PARI
    T(n,k) = k%n + n%k;
    for(n=1,15, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Dec 13 2019
    
  • Sage
    [[(k%n) + (n%k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 13 2019
    
Showing 1-3 of 3 results.