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.

Previous Showing 21-30 of 77 results. Next

A224921 Number of Pythagorean triples (a, b, c) with a^2 + b^2 = c^2 and 0 < a < b < c < n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 8, 9, 9, 9, 10, 11, 11, 11, 11, 12, 13, 13, 14, 14, 15, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 20, 21, 22, 23, 23, 24, 24, 24, 25, 25, 26, 27, 27, 27, 27, 31, 31, 31, 32, 32, 33, 33, 33
Offset: 1

Views

Author

Reiner Moewald, Apr 19 2013

Keywords

Comments

a(n+1) > a(n) iff n is in A009003. - Benoit Cloitre, Dec 08 2021

Crossrefs

Cf. A156685. Essentially partial sums of A046080.
Cf. A009003.

Programs

  • Maple
    a046080:= proc(n) local F,t;
      F:= select(t -> t[1] mod 4 = 1, ifactors(n)[2]);
      1/2*(mul(2*t[2]+1, t=F)-1)
    end proc:
    ListTools:-PartialSums(map(a046080, [$0..100])); # Robert Israel, Jul 18 2016
  • Mathematica
    b[0] = b[1] = 0; b[n_] := With[{fi = Select[FactorInteger[n], Mod[#[[1]], 4] == 1&][[All, 2]]}, (Times @@ (2*fi + 1) - 1)/2];
    Table[b[n], {n, 0, 100}] // Accumulate (* Jean-François Alcover, Feb 27 2019 *)
  • PARI
    a(n)=sum(a=1,n-3,sum(b=a+1,sqrtint((n-1)^2-a^2), issquare(a^2+b^2))) \\ Charles R Greathouse IV, Apr 29 2013

A242118 Number of unit squares that intersect the circumference of a circle of radius n centered at (0,0).

Original entry on oeis.org

0, 4, 12, 20, 28, 28, 44, 52, 60, 68, 68, 84, 92, 92, 108, 108, 124, 124, 140, 148, 148, 164, 172, 180, 188, 180, 196, 212, 220, 220, 228, 244, 252, 260, 260, 268, 284, 284, 300, 300, 308, 316, 332, 340, 348, 348, 364, 372, 380, 388, 380
Offset: 0

Views

Author

Kival Ngaokrajang, May 05 2014

Keywords

Comments

For the points that form the Pythagorean triple (for example see illustration n = 5, on the first quadrant at coordinate (4,3) and (3,4)), the transit of circumference occurs exactly at the corners, therefore there are no additional intersecting squares on the upper or lower rows (diagonally NE & SW directions) of such points.
If the center of the circle is instead chosen at the middle of a square grid centered at (1/2,0), the sequence will be 2*A004767(n-1).

Crossrefs

Programs

  • Python
    a = lambda n: sum(4 for x in range(n) for y in range(n)
                        if x**2 + y**2 < n**2 and (x+1)**2 + (y+1)**2 > n**2)
    
  • 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 8*n - 4*r if n > 0 else 0

Formula

a(n) = 4*Sum{k=1..n} ceiling(sqrt(n^2 - (k-1)^2)) - floor(sqrt(n^2 - k^2)). - Orson R. L. Peters, Jan 30 2017
a(n) = 8*n - A046109(n) for n > 0. - conjectured by Orson R. L. Peters, Jan 30 2017, proved by Andrey Zabolotskiy, Jan 31 2017

Extensions

Terms corrected by Orson R. L. Peters, Jan 30 2017

A210503 Numbers k that form a primitive Pythagorean triple with k' and sqrt(k^2 + k'^2), where k' is the arithmetic derivative of k.

Original entry on oeis.org

15, 35, 143, 323, 899, 1763, 3599, 4641, 5183, 10403, 11663, 13585, 19043, 22499, 32399, 35581, 36863, 39203, 51983, 57599, 72899, 79523, 97343, 121103, 176399, 186623, 213443, 272483, 324899, 359999, 381923, 412163, 435599, 446641, 622081, 656099, 675683
Offset: 1

Views

Author

Paolo P. Lava, Jan 25 2013

Keywords

Comments

A037074 is a subsequence of this sequence.
If k is the product of a pair of twin primes we have k=p(p+2), k'=2(p+1) and sqrt(k^2+k'^2)=(p+1)^2+1=p(p+2)+2=k+2. These numbers are relatively prime and therefore they form a primitive Pythagorean triple.
Also in the sequence are the following numbers with four distinct prime factors:
4641 = 3*7*13*17 [form p(p+4)*q(q+4)],
13585 = 5*11*13*19 [form p(p+6)*q(q+6)],
35581 = 7*13*17*23 [form p(p+6)*q(q+6)],
446641 = 13*17*43*47 [form p(p+4)*q(q+4)],
622081 = 17*23*37*43 [form p(p+6)*q(q+6)],
700321 = 19*29*31*41 [form p(p+10)*q(q+10)],
From Ray Chandler, Jan 25 2017: (Start)
24887581 = 47*53*97*103 [form p(p+6)*q(q+6)],
43518577 = 59*67*101*109 [form p(p+8)*q(q+8)],
115539901 = 83*97*113*127 [form p(p+14)*q(q+14)],
158682817 = 89*101*127*139 [form p(p+12)*q(q+12)],
305162941 = 103*113*157*167 [form p(p+10)*q(q+10)],
1093514641 = 103*107*313*317 [form p(p+4)*q(q+4)],
1415940061 = 167*193*197*223 [form p(p+26)*q(q+26)].
And one term with six distinct prime factors:
650344079 = 7*11*37*53*59*73. (End)

Examples

			m=57599, m'=480, sqrt(57599^2 + 480^2) = 57601.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    A210503:= proc(q)
    local a,n,p;
    for n from 1 to q do
      a:=n*add(op(2,p)/op(1,p),p=ifactors(n)[2]);
      if trunc(sqrt(n^2+a^2))=sqrt(n^2+a^2) and gcd(n,gcd(a,n^2+a^2))=1 then print(n); fi;
    od; end:
    A210503(100000);
  • Python
    from math import sqrt
    from sympy import factorint
    from gmpy2 import mpz, is_square, gcd
    A210503 = []
    for n in range(2, 10**5):
        nd = sum([mpz(n*e/p) for p, e in factorint(n).items()])
        if is_square(nd**2+n**2) and gcd(gcd(n, nd), mpz(sqrt(nd**2+n**2))) == 1:
            A210503.append(n) # Chai Wah Wu, Aug 21 2014

A134422 Square numbers which are sums of 2 distinct nonzero squares.

Original entry on oeis.org

25, 100, 169, 225, 289, 400, 625, 676, 841, 900, 1156, 1225, 1369, 1521, 1600, 1681, 2025, 2500, 2601, 2704, 2809, 3025, 3364, 3600, 3721, 4225, 4624, 4900, 5329, 5476, 5625, 6084, 6400, 6724, 7225, 7569, 7921, 8100, 8281, 9025, 9409, 10000, 10201
Offset: 1

Views

Author

Artur Jasinski, Oct 25 2007

Keywords

Examples

			25 = 5^2 = 4^2 + 3^2, and so 25 is in the sequence.
100 = 10^2 = 8^2 + 6^2, and so 100 is in the sequence.
169 = 13^2 = 12^2 + 5^2, and so 169 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    c = {}; Do[Do[k = a^2 + b^2; If[IntegerQ[Sqrt[k]], AppendTo[c, k]], {a, 1, b - 1}], {b, 200}]; Union[c] (* Artur Jasinski *)
    Select[Range[100]^2, Length[PowersRepresentations[#, 2, 2]] > 1 &] (* Alonso del Arte, Feb 11 2014 *)
  • PARI
    select(n->for(k=1,sqrtint(n\2),if(issquare(n-k^2), return(n>k^2)));0, vector(100,i,i^2)) \\ Charles R Greathouse IV, Jul 02 2013

Formula

a(n) = A009003(n)^2.

A161882 Smallest k such that n^2 = a_1^2 + ... + a_k^2 and all a_i are positive integers less than n.

Original entry on oeis.org

4, 3, 4, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 2, 4, 2, 3, 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, 3, 4, 3, 2, 2, 3, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 3, 2, 2, 3, 3, 4, 2, 3, 3, 2, 3, 2, 3, 3, 2, 2, 2, 3, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2
Offset: 2

Views

Author

Dmitry Kamenetsky, Jun 21 2009

Keywords

Comments

Related to hypotenuse numbers: A161882(A009003(n))=2 for all n.
Jacobi's four-square theorem can be used to show that a(n) <= 4. - Charles R Greathouse IV, Jul 31 2011

Examples

			2^2 = 1^2 + 1^2 + 1^2 + 1^2, so a(2)=4.
3^2 = 2^2 + 2^2 + 1^2, so a(3)=3.
		

Crossrefs

Programs

  • Mathematica
    f[n_, k_] := Select[PowersRepresentations[n^2, k, 2], AllTrue[#, 0<#Jean-François Alcover, Oct 03 2020 *)
  • PARI
    A161882(n)={vecmin(factor(n)[,1]%4)==1 && return(2);  if(n==1<M. F. Hasler, Dec 17 2014

Formula

a(n)=2 iff n is in A009003 (hypotenuse numbers), a(n)=4 iff n is in A000079 (powers of 2), otherwise a(n)=3. - M. F. Hasler, Dec 17 2014

Extensions

More terms from Alois P. Heinz, Dec 04 2014

A267113 Bitwise-OR of the exponents of all 4k+1 primes in the prime factorization of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 2, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Feb 03 2016

Keywords

Examples

			For n = 65 = 5 * 13 = (4+1)^1 * ((3*4)+1)^1, bitwise-or of 1 and 1 is 1, thus a(65) = 1.
		

Crossrefs

Cf. A004144 (indices of zeros), A009003 (of nonzeros).
Differs from both A046080 and A083025 for the first time at n=65, which here a(65) = 1.

Formula

a(n) = A267116(A170818(n)).
Other identities. For all n >= 0:
a(n) = a(A170818(n)). [The result depends only on the prime factors of the form 4k+1.]
a(n) <= A083025(n).

A156682 Consider all Pythagorean triangles A^2 + B^2 = C^2 with AA009004(n)).

Original entry on oeis.org

5, 13, 10, 25, 17, 15, 41, 26, 61, 20, 37, 85, 50, 25, 39, 113, 34, 65, 145, 30, 82, 181, 29, 52, 101, 35, 75, 221, 122, 265, 40, 51, 74, 145, 65, 313, 170, 45, 123, 365, 53, 100, 197, 421, 50, 78, 226, 481, 68, 130, 257, 55, 65, 183, 545, 290, 91, 125, 613, 60, 85, 111
Offset: 1

Views

Author

Ant King, Feb 17 2009

Keywords

Comments

The corresponding sequence for primitive triples is A156679. For all triples, the ordered sequence of C values is A020882 (allowing repetitions) and A009003 (excluding repetitions).

Examples

			As the first four Pythagorean triples (ordered by increasing A) are (3,4,5), (5,12,13), (6,8,10) and (7,24,25), then a(1)=5, a(2)=13, a(3)=10 and a(4)=25.
		

References

  • Beiler, Albert H.: Recreations In The Theory Of Numbers, Chapter XIV, The Eternal Triangle, Dover Publications Inc., New York, 1964, pp. 104-134.
  • Sierpinski, W.; Pythagorean Triangles, Dover Publications, Inc., Mineola, New York, 2003.

Crossrefs

Programs

  • Mathematica
    PythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[i
    				

Formula

a(n) = sqrt(A009004(n)^2 + A156681(n)^2).

A230543 Numbers n that form a Pythagorean quadruple with n', n'' and sqrt(n^2 + n'^2 + n''^2), where n' and n'' are the first and the second arithmetic derivative of n.

Original entry on oeis.org

512, 1203, 3456, 6336, 23328, 42768, 157464, 249753, 288684, 400000, 722718, 1062882, 1948617, 2700000, 4950000, 18225000, 33412500, 105413504, 123018750, 225534375, 312500000, 408918816
Offset: 1

Views

Author

Paolo P. Lava, Oct 25 2013

Keywords

Comments

Tested up to n = 4.09*10^8.

Examples

			If n = 6336 then n' = 23808, n'' = 103936 and sqrt(n^2 + n'^2 + n''^2) = 106816.
		

Crossrefs

Cf. A096907-A096909 and A097263-A097266 for Pythagorean Quadruples.

Programs

  • Maple
    with(numtheory): P:= proc(q) local a1, a2, n, p;
    for n from 2 to q do a1:=n*add(op(2,p)/op(1,p),p=ifactors(n)[2]);
    a2:=a1*add(op(2,p)/op(1,p),p=ifactors(a1)[2]);
    if type(sqrt(n^2+a1^2+a2^2),integer) then print(n);
    fi; od; end: P(10^10);

Extensions

a(16)-a(18) from Giovanni Resta, Oct 25 2013
a(19) from Ray Chandler, Dec 22 2016
a(20) from Ray Chandler, Dec 31 2016
a(21) from Ray Chandler, Jan 05 2017
a(22) from Ray Chandler, Jan 09 2017

A025302 Numbers that are the sum of 2 distinct nonzero squares in exactly 1 way.

Original entry on oeis.org

5, 10, 13, 17, 20, 25, 26, 29, 34, 37, 40, 41, 45, 50, 52, 53, 58, 61, 68, 73, 74, 80, 82, 89, 90, 97, 100, 101, 104, 106, 109, 113, 116, 117, 122, 136, 137, 146, 148, 149, 153, 157, 160, 164, 169, 173, 178, 180, 181, 193, 194, 197, 200, 202, 208, 212, 218, 225, 226, 229
Offset: 1

Views

Author

Keywords

Comments

From Fermat's two squares theorem, every prime of the form 4k + 1 is a term (A002144). - Bernard Schott, Apr 15 2022

Crossrefs

Cf. A002144 (subsequence), A009000, A009003, A024507, A025441, A004431.
Cf. Subsequence of A001983; A004435.

Programs

  • Haskell
    a025302 n = a025302_list !! (n-1)
    a025302_list = [x | x <- [1..], a025441 x == 1]
    
  • Mathematica
    nn = 229; t = Table[0, {nn}]; lim = Floor[Sqrt[nn - 1]]; Do[num = i^2 + j^2; If[num <= nn, t[[num]]++], {i, lim}, {j, i - 1}]; Flatten[Position[t, 1]] (* T. D. Noe, Apr 07 2011 *)
    a[1] = 5; a[ n_] := a[n] = Module[ {s = a[n - 1], t = True, j}, While[ t, s++; Do[ If[ i^2 + (j = Floor[Sqrt[s - i^2]])^2 == s && i < j, t = False; Break], {i, Sqrt[s/2]}]]; s]; (* Michael Somos, Jan 20 2019 *)
  • Python
    from collections import Counter
    from itertools import combinations
    def aupto(lim):
      s = filter(lambda x: x <= lim, (i*i for i in range(1, int(lim**.5)+2)))
      s2 = filter(lambda x: x <= lim, (sum(c) for c in combinations(s, 2)))
      s2counts = Counter(s2)
      return sorted(k for k in s2counts if k <= lim and s2counts[k] == 1)
    print(aupto(229)) # Michael S. Branicky, May 10 2021

Formula

A025441(a(n)) = 1. - Reinhard Zumkeller, Dec 20 2013

A120211 x values giving the smallest integer solutions of y^2 = x*(a^N - x)*( b^N + x) (elliptic curve, Weierstrass equation) with a and b legs in primitive Pythagorean triangles and N = 2. Sequence ordered in increasing values of leg a. Relevant y values in A120210.

Original entry on oeis.org

4, 6, 12, 24, 15, 40, 60, 40, 70, 84, 72, 56, 126, 144, 180, 168, 198, 180, 220, 264, 126, 286, 312, 364, 360, 390, 420, 480, 510, 49, 544, 300, 612, 616, 646, 684, 720, 760, 288, 798, 840, 924, 726, 966, 700, 1012, 1104, 990, 1150, 1200
Offset: 1

Views

Author

Giorgio Balzarotti, Paolo P. Lava, Jun 10 2006

Keywords

Examples

			First primitive Pythagorean triad: 3, 4, 5
Weierstrass equation. y^2 = x*( 3^2 - x)*( 4^2 + x)
Smallest integer solution (x, y) = (4,20)
First element in the sequence x = 4
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 47.

Crossrefs

Programs

  • Maple
    flag :=1;x:=0; # a, b, c primitive Pythagorean triad while flag =1 do x:=x+1; y2:= x*( a^2 - x)*(x+b^2); if ((floor(sqrt(y2)))^2=y2)then print( x);flag :=0;fi; od;
Previous Showing 21-30 of 77 results. Next