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-9 of 9 results.

A046109 Number of lattice points (x,y) on the circumference of a circle of radius n with center at (0,0).

Original entry on oeis.org

1, 4, 4, 4, 4, 12, 4, 4, 4, 4, 12, 4, 4, 12, 4, 12, 4, 12, 4, 4, 12, 4, 4, 4, 4, 20, 12, 4, 4, 12, 12, 4, 4, 4, 12, 12, 4, 12, 4, 12, 12, 12, 4, 4, 4, 12, 4, 4, 4, 4, 20, 12, 12, 12, 4, 12, 4, 4, 12, 4, 12, 12, 4, 4, 4, 36, 4, 4, 12, 4, 12, 4, 4, 12, 12, 20, 4, 4, 12, 4, 12, 4, 12, 4, 4, 36
Offset: 0

Views

Author

Keywords

Comments

Also number of Gaussian integers x + yi having absolute value n. - Alonso del Arte, Feb 11 2012
The indices of terms not equaling 4 or 12 correspond to A009177, n>0. - Bill McEachen, Aug 14 2025

Examples

			a(5) = 12 because the circumference of the circle with radius 5 will pass through the twelve points (5, 0), (4, 3), (3, 4), (0, 5), (-3, 4), (-4, 3), (-5, 0), (-4, -3), (-3, -4), (0, -5), (3, -4) and (4, -3). Alternatively, we can say the twelve Gaussian integers 5, 4 + 3i, ... , 4 - 3i all have absolute value of 5.
		

Crossrefs

Programs

  • Haskell
    a046109 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 == n^2]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Maple
    N:= 1000: # to get a(0) to a(N)
    A:= Array(0..N):
    A[0]:= 1:
    for x from 1 to N do
      A[x]:= A[x]+4;
      for y from 1 to min(x-1,floor(sqrt(N^2-x^2))) do
         z:= x^2+y^2;
         if issqr(z) then
           t:= sqrt(z);
           A[t]:= A[t]+8;
         fi
      od
    od:
    seq(A[i],i=0..N); # Robert Israel, May 08 2015
  • Mathematica
    Table[Length[Select[Flatten[Table[r + I i, {r, -n, n}, {i, -n, n}]], Abs[#] == n &]], {n, 0, 49}] (* Alonso del Arte, Feb 11 2012 *)
  • PARI
    a(n)=if(n==0, return(1)); my(f=factor(n)); 4*prod(i=1,#f~, if(f[i,1]%4==1, 2*f[i,2]+1, 1)) \\ Charles R Greathouse IV, Feb 01 2017
    
  • PARI
    a(n)=if(n==0, return(1)); t=0; for(x=1, n-1, y=n^2-x^2; if(issquare(y), t++)); return(4*t+4) \\ Arkadiusz Wesolowski, Nov 14 2017
  • Python
    from sympy import factorint
    def a(n):
        r = 1
        for p, e in factorint(n).items():
            if p%4 == 1: r *= 2*e + 1
        return 4*r if n > 0 else 0
    # Orson R. L. Peters, Jan 31 2017
    

Formula

a(n) = A000328(n) - A051132(n).
a(n) = 8*A046080(n) + 4 for n > 0.
a(n) = A004018(n^2).
From Jean-Christophe Hervé, Dec 01 2013: (Start)
a(A084647(k)) = 28.
a(A084648(k)) = 36.
a(A084649(k)) = 44. (End)
a(n) = 4 * Product_{i=1..k} (2*e_i + 1) for n > 0, given that p_i^e_i is the i-th factor of n with p_i = 1 mod 4. - Orson R. L. Peters, Jan 31 2017
a(n) = [x^(n^2)] theta_3(x)^2, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 20 2018
From Hugo Pfoertner, Sep 21 2023: (Start)
a(n) = 8*A063014(n) - 4 for n > 0.
a(n) = 4*A256452(n) for n > 0. (End)

A255212 Number A(n,k) of partitions of n^2 into at most k square parts; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Feb 17 2015

Keywords

Examples

			Square array A(n,k) begins:
  1, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1, ...
  0, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1, ...
  0, 1, 1, 1, 2,  2,  2,  2,  2,  2,  2, ...
  0, 1, 1, 2, 2,  2,  3,  3,  3,  4,  4, ...
  0, 1, 1, 1, 2,  3,  3,  4,  5,  5,  6, ...
  0, 1, 2, 2, 3,  4,  5,  7,  8,  9, 11, ...
  0, 1, 1, 2, 4,  5,  9, 10, 11, 15, 17, ...
  0, 1, 1, 2, 4,  6,  9, 13, 18, 21, 27, ...
  0, 1, 1, 1, 2,  7,  9, 16, 25, 30, 41, ...
  0, 1, 1, 4, 6,  8, 18, 27, 36, 52, 68, ...
  0, 1, 2, 2, 7, 13, 23, 36, 51, 70, 94, ...
		

Crossrefs

Main diagonal gives A105152.
Cf. A302996.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0 or i=1 and n<=t, 1,
          (j-> `if`(t*jn, 0, b(n-j, i, t-1))))(i^2))
        end:
    A:= (n, k)-> b(n^2, n, k):
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0 || i == 1 && n <= t, 1, Function[j, If[t*jn, 0, b[n-j, i, t-1]]]][i^2]]; A[n_, k_] := b[n^2, n, k]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Feb 22 2016, after Alois P. Heinz *)

A286361 Least number with the same prime signature as {the largest divisor of n with only prime factors of the form 4k+1} has: a(n) = A046523(A170818(n)).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 4, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 4, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 6, 1, 1, 2, 1, 2, 1, 1, 2, 2, 4, 1, 1, 2, 1, 2, 1, 2, 1, 1, 6, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 4, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2
Offset: 1

Views

Author

Antti Karttunen, May 08 2017

Keywords

Crossrefs

Differs from A063014 for the first time at n=25, where a(25) = 4, while A063014(25) = 3.

Programs

  • Python
    from sympy import factorint
    from operator import mul
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a072438(n):
        f = factorint(n)
        return 1 if n == 1 else reduce(mul, [1 if i%4==1 else i**f[i] for i in f])
    def a(n): return a046523(n/a072438(n)) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286361 n) (A046523 (A170818 n)))
    

Formula

a(n) = A046523(A170818(n)).
a(n) = A286363(A267099(n)).

A065458 Number of inequivalent (ordered) solutions to a^2 + b^2 + c^2 + d^2 = n^2.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 4, 4, 2, 6, 7, 6, 4, 8, 10, 14, 2, 11, 14, 13, 7, 23, 15, 17, 4, 24, 21, 31, 10, 25, 37, 28, 2, 46, 29, 49, 14, 38, 35, 61, 7, 45, 62, 49, 15, 93, 47, 57, 4, 72, 67, 97, 21, 71, 84, 101, 10, 119, 70, 86, 37, 92, 79, 165, 2, 138, 127, 109, 29, 168, 140, 121, 14
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(5)=3 because 25 produces {0,0,0,5}, {0,0,3,4}, {1,2,2,4}.
		

Crossrefs

Column k=4 of A255212.

Programs

  • Maple
    N:= 100:
    R:= Vector(N,1):
    for a from 0 to N do
      for b from a to floor(sqrt(N^2-a^2)) do
         for c from b to floor(sqrt(N^2-a^2-b^2)) do
           q:= a^2 + b^2 + c^2;
           for f in numtheory:-divisors(q) do
              if f^2 + 2*f*c <= q and (f + q/f)::even then
                 r:= (f + q/f)/2;
                 if r <= N then R[r]:= R[r]+1 fi;
              fi
    od od od od:
    convert(R,list); # Robert Israel, Feb 16 2015
  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[4, (k)^2], {k, 72}]

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015

A065459 Number of inequivalent (ordered) solutions to n^2 = sum of 5 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 13, 12, 13, 17, 25, 22, 27, 31, 35, 38, 46, 49, 61, 61, 61, 73, 92, 83, 112, 106, 118, 127, 147, 138, 185, 175, 178, 198, 239, 212, 254, 262, 298, 294, 341, 304, 404, 376, 385, 432, 483, 441, 539, 517, 560, 551, 680, 587, 745, 693, 698
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(5)=4 because 25 produces {0,0,0,0,5}, {0,0,0,3,4}, {0,1,2,2,4}, {2,2,2,2,3}.
		

Crossrefs

Column k=5 of A255212.

Programs

  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[5, (k)^2], {k, 72}]

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015

A065461 Number of inequivalent (ordered) solutions to n^2 = sum of 7 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 10, 13, 16, 27, 36, 43, 58, 72, 99, 130, 146, 178, 254, 265, 342, 417, 507, 540, 726, 745, 975, 1092, 1289, 1338, 1845, 1751, 2246, 2447, 2948, 2852, 3932, 3638, 4728, 4868, 5778, 5618, 7659, 6887, 8891, 8887, 10825, 10109, 13712
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(4)=4 because 16 produces {0,0,0,0,0,0,4}, {0,0,0,2,2,2,2}, {0,0,1,1,1,2,3}, {1,1,1,1,2,2,2}.
		

Crossrefs

Column k=7 of A255212.

Programs

  • Mathematica
    Table[Length[PowersRepresentations[n^2,7,2]],{n,0,50}] (* Harvey P. Dale, Sep 08 2020 *)

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015
Previous Mathematica program replaced by Harvey P. Dale, Sep 08 2020

A065460 Number of inequivalent (ordered) solutions to n^2 = sum of 6 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 9, 9, 9, 18, 23, 24, 29, 37, 53, 62, 59, 77, 116, 106, 130, 156, 199, 192, 221, 257, 342, 336, 384, 402, 577, 501, 599, 639, 835, 774, 910, 912, 1220, 1113, 1378, 1298, 1703, 1530, 1907, 1862, 2398, 2094, 2471, 2393, 3356, 2765, 3543
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(5)=5 because 25 produces {0,0,0,0,0,5}, {0,0,0,0,3,4}, {0,0,1,2,2,4}, {0,2,2,2,2,3}, {1,1,1,2,3,3}.
		

Crossrefs

Column k=6 of A255212.

Programs

  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[6, (k)^2], {k, 72}]

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015

A065462 Number of inequivalent (ordered) solutions to n^2 = sum of 8 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 11, 18, 25, 36, 51, 73, 90, 133, 169, 223, 295, 380, 452, 603, 763, 903, 1115, 1385, 1668, 2025, 2398, 2811, 3535, 4011, 4683, 5503, 6724, 7316, 8684, 9946, 11844, 12994, 15091, 16712, 20493, 21663, 24975, 27536, 33079, 34654, 39957, 43315
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(4)=5 because 16 produces {0,0,0,0,0,0,0,4}, {0,0,0,0,2,2,2,2}, {0,0,0,1,1,1,2,3}, {0,1,1,1,1,2,2,2}, {1,1,1,1,1,1,1,3}.
		

Crossrefs

Column k=8 of A255212.

Programs

  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[8, (k)^2], {k, 36}]

Extensions

a(0), a(37)-a(47) from Alois P. Heinz, Feb 16 2015

A063669 Hypotenuses of reciprocal Pythagorean triangles: number of solutions to 1/(12n)^2 = 1/b^2 + 1/c^2 [with b >= c > 0]; also number of values of A020885 (with repetitions) which divide n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 2, 1, 4, 1, 1, 1, 1, 4, 1, 1, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 2, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 1, 1, 1, 6, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 3, 2, 1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 2, 1, 3, 1, 1, 1, 1, 5
Offset: 1

Views

Author

Henry Bottomley, Jul 28 2001

Keywords

Comments

Primitive reciprocal Pythagorean triangles 1/a^2 = 1/b^2 + 1/c^2 have a=fg, b=ef, c=eg where e^2 = f^2 + g^2; i.e., e,f,g represent the sides of primitive Pythagorean triangles. But the product of the two legs of primitive Pythagorean triangles are multiples of 12 and so the reciprocal of hypotenuses of reciprocal Pythagorean triangles are always multiples of 12 (A008594).

Examples

			a(1)=1 since 1/(12*1)^2 = 1/12^2 = 1/15^2 + 1/20^2;
a(70)=6 since 1/(12*70)^2 = 1/840^2 = 1/875^2 + 1/3000^2 = 1/888^2 + 1/2590^2 = 1/910^2 + 1/2184^2 = 1/952^2 + 1/1785^2 = 1/1050^2 + 1/1400^2 = 1/1160^2 + 1/1218^2.
Looking at A020885, 1 is divisible by 1, while 70 is divisible by 1, 5, 10, 14, 35 and again 35.
		

Crossrefs

Showing 1-9 of 9 results.