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.

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