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

A077773 Number of integers between n^2 and (n+1)^2 that are the sum of two squares; multiple representations are counted once.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 6, 9, 8, 8, 10, 10, 11, 11, 12, 11, 14, 12, 13, 15, 16, 15, 15, 17, 16, 17, 19, 18, 19, 20, 19, 20, 21, 20, 22, 22, 24, 22, 25, 23, 26, 26, 24, 29, 26, 27, 28, 27, 29, 26, 31, 32, 30, 29, 33, 33, 31, 31, 35, 34, 35, 35, 35, 36, 37, 37, 33, 42, 37, 38
Offset: 0

Views

Author

T. D. Noe, Nov 20 2002

Keywords

Comments

Related to the circle problem, cf. A077770. See A077774 for a more restrictive case. A077768 counts the representations multiply.
Number of integers k in range [n^2, ((n+1)^2)-1] for which 2 = the least number of squares that add up to k (A002828). Because of this interpretation a(0)=0 was prepended to the beginning. - Antti Karttunen, Oct 04 2016
This sequence is not surjective, since, for instance, there is no n such that a(n) = 46. This follows from a bound observed by Jon E. Schoenfield, that if a(n) = m then n < ((m+1)^2)/2, and the fact that a(n) != 46 for all n < 1105. - Rainer Rosenthal, Jul 25 2023

Examples

			a(8)=6 because 65=64+1=49+16, 68=64+4, 72=36+36, 73=64+9, 74=49+25 and 80=64+16 are between squares 64 and 81. Note that 65 is counted only once.
		

Crossrefs

Cf. A363762 (terms not occurring in this sequence), A363763.

Programs

  • Mathematica
    maxN=100; lst={}; For[n=1, n<=maxN, n++, sqrs={}; i=n; j=0; While[i>=j, j=1; While[i^2+j^2<(n+1)^2, If[i>=j&&i^2+j^2>n^2, AppendTo[sqrs, i^2+j^2]]; j++ ]; i--; j-- ]; AppendTo[lst, Length[Union[sqrs]]]]; lst
  • PARI
    a(N)=s=0;for(n=N^2+1,(N+1)^2-1,f=0;r=sqrtint(n);forstep(i=r,1,-1,if(issquare(n-i*i),f=1;s=s+1;break)));s /* Ralf Stephan, Sep 17 2013 */
    
  • Python
    from sympy import factorint
    def A077773(n): return sum(1 for m in range(n**2+1,(n+1)**2) if all(p==2 or p&3==1 or e&1^1 for p, e in factorint(m).items())) # Chai Wah Wu, Jun 20 2023
  • Scheme
    (define (A077773 n) (add (lambda (i) (* (- 1 (A010052 i)) (A229062 i))) (A000290 n) (+ -1 (A000290 (+ 1 n)))))
    ;; Implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; Antti Karttunen, Oct 04 2016
    

Formula

a(n) = Sum_{i=n^2+1..(n+1)^2-1} A229062(i). - Ralf Stephan, Sep 17 2013
From Antti Karttunen, Oct 04 2016: (Start)
For n >= 0, a(n) + A277193(n) + A277194(n) = 2n.
For n >= 1, A277192(n) = a(n) + A277194(n). (End)

Extensions

Term a(0)=0 prepended by Antti Karttunen, Oct 04 2016

A047077 Number of pairs of integers (x,y) with n^2 <= x^2+y^2 <= (n+1)^2.

Original entry on oeis.org

5, 12, 20, 24, 36, 44, 40, 52, 60, 68, 72, 68, 92, 96, 100, 100, 108, 120, 124, 132, 128, 148, 140, 144, 172, 180, 180, 168, 180, 204, 192, 212, 204, 220, 240, 212, 244, 232, 268, 260, 248, 276, 268, 292, 288, 276, 300, 296, 316, 324, 348, 336, 324, 348, 336
Offset: 0

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Jan 26 2000

Keywords

Comments

Number of integer Cartesian grid points covered by a ring around the origin with width 1 and outer radius n. Also, number of Gaussian integers z=a+bi satisfying n-1 <= |z| <= n. - Ralf Stephan, Nov 28 2013

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[SquaresR[2, k], {k, n^2, (n+1)^2}]; Table[a[n], {n, 0, 54}] (* Jean-François Alcover, Oct 15 2012 *)

Formula

a(n) = A000328(n+1) - A051132(n).

A077768 Number of times that the sum of two squares is an integer between n^2 and (n+1)^2; multiple representations are counted multiply.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 6, 7, 7, 7, 8, 10, 10, 11, 11, 12, 13, 15, 15, 14, 18, 17, 17, 19, 19, 21, 20, 21, 23, 22, 26, 25, 26, 27, 25, 29, 27, 32, 30, 28, 33, 33, 36, 34, 33, 37, 36, 39, 38, 40, 39, 38, 42, 40, 46, 43, 45, 44, 46, 48, 47, 49, 50, 48, 50, 50, 53, 55, 52, 55, 53, 60, 57
Offset: 1

Views

Author

T. D. Noe, Nov 20 2002

Keywords

Comments

Related to the circle problem, cf. A077770. Note that 2*a(n)-A077770(n)/4 is the characteristic sequence for the Beatty sequence A001951. See A077769 for a more restrictive case. A077773 counts multiple representations only once.

Examples

			a(8)=7 because 65=64+1, 65=49+16, 68=64+4, 72=36+36, 73=64+9, 74=49+25 and 80=64+16 are between squares 64 and 81. Note that 65 occurs twice.
		

Crossrefs

Programs

  • Mathematica
    maxN=100; lst={}; For[n=1, n<=maxN, n++, cnt=0; i=n; j=0; While[i>=j, j=1; While[i^2+j^2<(n+1)^2, If[i>=j&&i^2+j^2>n^2, cnt++ ]; j++ ]; i--; j-- ]; AppendTo[lst, cnt]]; lst

A138494 a and b are integers > 0 satisfying a^2 + b^2 = c^2. Sequence gives the number of choices for a and b between successive values of c. (Integer solutions for c (Pythagorean triples) are not included.)

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 11, 13, 13, 14, 15, 19, 20, 21, 21, 23, 26, 29, 29, 28, 35, 33, 34, 37, 37, 41, 40, 41, 45, 44, 51, 49, 51, 54, 49, 57, 54, 63, 59, 56, 65, 65, 71, 68, 65, 73, 72, 77, 75, 79, 78, 75, 83, 80, 91, 85, 89, 88, 91, 95, 94, 97, 99, 96, 99, 99, 105, 110, 103, 109
Offset: 1

Views

Author

Rick Walcott (rick(AT)campbellsci.com), May 09 2008

Keywords

Comments

Also number of pairs (a, b) such that floor(s) = n and s > n where a and b are positive integers and s = sqrt(a^2 + b^2). - David A. Corneth, May 30 2019

Crossrefs

Cf. A077770.

Programs

  • PARI
    a(n)={ cnt = 0; for( x = 1, n, for( y = floor( sqrt( n^2 - x^2) ), floor( sqrt( n^2 + 2*n + 1 - x^2) ), d = x^2 + y^2; if( sqrt(d) > n && sqrt(d) < n+1, cnt = cnt + 1); ) ); return(cnt);} /* Dimitri Papadopoulos, May 29 2019 */
  • QBasic
    OPEN "PYTH.TXT" FOR OUTPUT AS #1
    FOR C = 1 TO 100
    N = 0
    FOR A = 1 TO C
    FOR B = 1 TO C
    D = SQR(A * A + B * B)
    IF D > C AND D < C + 1 THEN N = N + 1
    NEXT B
    NEXT A
    PRINT #1, N;
    NEXT C
    CLOSE
    

Formula

a(n) = A077770(n)/4 for n >= 1. - Dimitri Papadopoulos, May 29 2019
Showing 1-4 of 4 results.