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.

A048149 Array T read by diagonals: T(i,j) = number of pairs (h,k) with h^2+k^2 <= i^2+j^2, h>=0, k >= 0.

Original entry on oeis.org

1, 3, 3, 6, 4, 6, 11, 8, 8, 11, 17, 13, 9, 13, 17, 26, 19, 15, 15, 19, 26, 35, 28, 22, 20, 22, 28, 35, 45, 37, 30, 26, 26, 30, 37, 45, 58, 48, 39, 33, 31, 33, 39, 48, 58, 73, 62, 52, 43, 41, 41, 43, 52, 62, 73, 90, 75, 64, 54, 50, 48, 50, 54, 64, 75, 90
Offset: 0

Views

Author

Keywords

Examples

			Seen as a triangle:
[0]  1;
[1]  3,  3;
[2]  6,  4,  6;
[3] 11,  8,  8, 11;
[4] 17, 13,  9, 13, 17;
[5] 26, 19, 15, 15, 19, 26;
[6] 35, 28, 22, 20, 22, 28, 35;
[7] 45, 37, 30, 26, 26, 30, 37, 45;
[8] 58, 48, 39, 33, 31, 33, 39, 48, 58;
[9] 73, 62, 52, 43, 41, 41, 43, 52, 62, 73;
		

Crossrefs

Cf. A000603 (right diagonal).

Programs

  • Maple
    A048149 := proc(n, k) option remember; ## n = 0 .. infinity and k = 0 .. n
        local x, y, radius, nTotal;
        if n >= k then
            radius := floor(sqrt(n^2 + k^2));
            nTotal := 0;
            for x from 0 to radius do
                nTotal := nTotal + floor(sqrt(n^2 + k^2 - x^2)) + 1;
            end do;
            return nTotal;
        else
            return A048149(k, n);
        end if;
    end proc: # Yu-Sheng Chang, Jan 14 2020
  • Mathematica
    t[i_, j_] := Module[{h, k}, Reduce[h^2 + k^2 <= i^2 + j^2 && h >= 0 && k >= 0, {h, k}, Integers] // ToRules // Length[{##}]&]; Table[t[n-k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 26 2013 *)

Extensions

a(55) corrected by Jean-François Alcover, Nov 26 2013
a(55) restored by Yu-Sheng Chang, Jan 14 2020