OFFSET
1,2
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
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A077770(n)/4 for n >= 1. - Dimitri Papadopoulos, May 29 2019
PROG
(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
(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 */
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Rick Walcott (rick(AT)campbellsci.com), May 09 2008
STATUS
approved