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-10 of 25 results. Next

A129861 Smallest square s such that A024352(n) + s is square.

Original entry on oeis.org

1, 4, 9, 1, 16, 25, 4, 36, 1, 9, 64, 81, 16, 4, 121, 1, 144, 9, 36, 196, 225, 4, 16, 1, 64, 324, 25, 9, 400, 441, 100, 4, 529, 1, 576, 49, 144, 676, 9, 25, 64, 841, 4, 900, 1, 36, 16, 1089, 256, 100, 1225, 49, 1296, 25, 324, 4, 1521, 81, 144, 1681, 16, 36, 169, 81, 1936, 9, 484
Offset: 1

Views

Author

Andrew S. Plewe, May 23 2007

Keywords

Examples

			5(5+6) = 55, smallest square = (6/2)^2 = 9
4(4+10) = 56, smallest square = (10/2)^2 = 25
3(3+16) = 57, smallest square = (16/2)^2 = 64
1(1+58) = 59, smallest square = (58/2)^2 = 841
6(6+4) = 60, smallest square = (4/2)^2 = 4
1(1+60) = 61, smallest square = (60/2)^2 = 900
7(7+2) = 63, smallest square = (2/2)^2 = 1
etc.
		

Crossrefs

Cf. A024352.

Formula

y(y+e) = A024352(n), where e is the smallest even number that satisfies this equation, A(n) = (e/2)^2.

A020884 Ordered short legs of primitive Pythagorean triangles.

Original entry on oeis.org

3, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 20, 21, 23, 24, 25, 27, 28, 28, 29, 31, 32, 33, 33, 35, 36, 36, 37, 39, 39, 40, 41, 43, 44, 44, 45, 47, 48, 48, 49, 51, 51, 52, 52, 53, 55, 56, 57, 57, 59, 60, 60, 60, 61, 63, 64, 65, 65, 67, 68, 68, 69, 69, 71, 72, 73, 75, 75, 76, 76, 77
Offset: 1

Views

Author

Keywords

Comments

Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence gives values of A, sorted.
Union of A081874 and A081925. - Lekraj Beedassy, Jul 28 2006
Each term in this sequence is given by f(m,n) = m^2 - n^2 or g(m,n) = 2mn where m and n are relatively prime positive integers with m > n, m and n not both odd. For example, a(1) = f(2,1) = 2^2 - 1^2 = 3 and a(4) = g(4,1) = 2*4*1 = 8. - Agola Kisira Odero, Apr 29 2016
All powers of 2 greater than 4 (2^2) are terms, and are generated by the function g(m,n) = 2mn. - Torlach Rush, Nov 08 2019

Crossrefs

Cf. A009004, A020882, A020883, A020885, A020886. Different from A024352.
Cf. A024359 (gives the number of times n occurs).
Cf. A037213.

Programs

  • Haskell
    a020884 n = a020884_list !! (n-1)
    a020884_list = f 1 1 where
       f u v | v > uu `div` 2        = f (u + 1) (u + 2)
             | gcd u v > 1 || w == 0 = f u (v + 2)
             | otherwise             = u : f u (v + 2)
             where uu = u ^ 2; w = a037213 (uu + v ^ 2)
    -- Reinhard Zumkeller, Nov 09 2012
  • Mathematica
    shortLegs = {}; amx = 99; Do[For[b = a + 1, b < (a^2/2), c = (a^2 + b^2)^(1/2); If[c == IntegerPart[c] && GCD[a, b, c] == 1, AppendTo[shortLegs, a]]; b = b + 2], {a, 3, amx}]; shortLegs (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
    Take[Union[Sort/@({Times@@#,(Last[#]^2-First[#]^2)/2}&/@(Select[Subsets[Range[1,101,2],{2}],GCD@@#==1&]))][[;;,1]],80] (* Harvey P. Dale, Feb 06 2025 *)

Extensions

Extended and corrected by David W. Wilson

A181123 Numbers that are the differences of two positive cubes.

Original entry on oeis.org

0, 7, 19, 26, 37, 56, 61, 63, 91, 98, 117, 124, 127, 152, 169, 189, 208, 215, 217, 218, 271, 279, 296, 316, 331, 335, 342, 386, 387, 397, 448, 469, 485, 488, 504, 511, 513, 547, 602, 604, 631, 657, 665, 702, 721, 728, 784, 817, 819, 866, 875, 919, 936, 973
Offset: 1

Views

Author

T. D. Noe, Oct 06 2010

Keywords

Comments

Because x^3-y^3 = (x-y)(x^2+xy+y^2), the difference of two cubes is a prime number only if x=y+1, in which case all the primes are cuban, see A002407.
The difference can be a square (see A038597), but Fermat's Last Theorem prevents the difference from ever being a cube. Beal's Conjecture implies that there are no higher odd powers in this sequence.
If n is in the sequence, it must be x^3-y^3 where 0 < y <= x < n^(1/2). - Robert Israel, Dec 24 2017

Crossrefs

Cf. A024352 (squares), A147857 (4th powers), A181124-A181128 (5th to 9th powers).

Programs

  • Maple
    N:= 10^4: # to get all terms <= N
    sort(convert(select(`<=`, {0, seq(seq(x^3-y^3, y=1..x-1),x=1..floor(sqrt(N)))}, N),list)); # Robert Israel, Dec 24 2017
  • Mathematica
    nn=10^5; p=3; Union[Reap[Do[n=i^p-j^p; If[n<=nn, Sow[n]], {i,Ceiling[(nn/p)^(1/(p-1))]}, {j,i}]][[2,1]]]
    With[{nn=60},Take[Union[Abs[Flatten[Differences/@Tuples[ Range[ nn]^3,2]]]], nn]] (* Harvey P. Dale, May 11 2014 *)
  • PARI
    list(lim)=my(v=List([0]),a3); for(a=2,sqrtint(lim\3), a3=a^3; for(b=if(a3>lim,sqrtnint(a3-lim-1,3)+1,1), a-1, listput(v,a3-b^3))); Set(v) \\ Charles R Greathouse IV, Jan 25 2018

A097268 Numbers that are both the sum of two nonzero squares and the difference of two nonzero squares.

Original entry on oeis.org

5, 8, 13, 17, 20, 25, 29, 32, 37, 40, 41, 45, 52, 53, 61, 65, 68, 72, 73, 80, 85, 89, 97, 100, 101, 104, 109, 113, 116, 117, 125, 128, 136, 137, 145, 148, 149, 153, 157, 160, 164, 169, 173, 180, 181, 185, 193, 197, 200, 205, 208, 212, 221, 225, 229, 232, 233
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Intersection of A000404 (sum of squares) and A024352 (difference of squares).
Also: Numbers of the form x^2+4y^2, where x and y are positive integers. Cf. A154777, A092572, A154778 for analogous sequences. - M. F. Hasler, Jan 24 2009

Crossrefs

Programs

  • PARI
    isA097268(n) = forstep( b=2,sqrtint(n-1),2, issquare(n-b^2) && return(1)) \\ M. F. Hasler, Jan 24 2009

A139491 Numbers arising in A139490.

Original entry on oeis.org

3, 8, 9, 12, 15, 16, 21, 24, 40, 45, 48, 60, 72, 120, 168, 240, 840, 1848
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008, Apr 26 2008

Keywords

Comments

M. F. Hasler, Apr 24 2008, observed that the numbers in this sequence are differences of two squares. For example: 3=2^2-1^2, 8=3^2-1^2, 9=5^2-4^2, 15=4^2-1^2, 16=5^2-3^2, 21=5^2-2^2, 24=5^2-1^2, 40=7^2-3^2, 45=7^2-2^2, 48=7^2-1^2, 60=8^2-2^2.
This sequence is a subsequence of A024352.
These numbers appear to be a subset of the idoneal numbers A000926. If so, then the sequence is probably complete. - T. D. Noe, Apr 27 2009

Crossrefs

Programs

  • Mathematica
    f = 200; g = 300; h = 30; j = 100; b = {}; Do[a = {}; Do[Do[If[PrimeQ[x^2 + n y^2], AppendTo[a, x^2 + n y^2]], {x, 0, g}], {y, 1, g}]; AppendTo[b, Take[Union[a], h]], {n, 1, f}]; Print[b]; c = {}; Do[a = {}; Do[Do[If[PrimeQ[n^2 + w*n*m + m^2], AppendTo[a, n^2 + w*n*m + m^2]], {n, m, g}], {m, 1, g}]; AppendTo[c, Take[Union[a], h]], {w, 1, j}]; Print[c]; bb = {}; cc = {}; Do[Do[If[b[[p]] == c[[q]], AppendTo[bb, p]; AppendTo[cc, q]], {p, 1, f}], {q, 1, j}]; Union[bb]

Extensions

Extended by T. D. Noe, Apr 27 2009

A097269 Numbers that are the sum of two nonzero squares but not the difference of two nonzero squares.

Original entry on oeis.org

2, 10, 18, 26, 34, 50, 58, 74, 82, 90, 98, 106, 122, 130, 146, 162, 170, 178, 194, 202, 218, 226, 234, 242, 250, 274, 290, 298, 306, 314, 338, 346, 362, 370, 386, 394, 410, 442, 450, 458, 466, 482, 490, 514, 522, 530, 538, 554, 562, 578, 586, 610, 626, 634
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Intersection of A000404 (sum of squares) and complement of A024352 (difference of squares).
Numbers of the form 4k+2 = double of an odd number, with the odd number equal to the sum of 2 squares (sequence A057653). - Jean-Christophe Hervé, Oct 24 2015
Numbers that are the sum of two odd squares. - Jean-Christophe Hervé, Oct 25 2015

Examples

			2 = 1^2 + 1^2, 10 = 1^2 + 3^2, 18 = 3^2 + 3^2.
		

Crossrefs

Programs

  • PARI
    is(n)=if(n%4!=2,return(0)); my(f=factor(n/2)); for(i=1,#f[,1],if(bitand(f[i,2],1)==1&&bitand(f[i,1],3)==3, return(0))); 1 \\ Charles R Greathouse IV, May 31 2013
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A097269_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n//2).items()),count(2,4))
    A097269_list = list(islice(A097269_gen(),30)) # Chai Wah Wu, Jun 28 2022

A181124 Difference of two positive 5th powers.

Original entry on oeis.org

0, 31, 211, 242, 781, 992, 1023, 2101, 2882, 3093, 3124, 4651, 6752, 7533, 7744, 7775, 9031, 13682, 15783, 15961, 16564, 16775, 16806, 24992, 26281, 29643, 31744, 32525, 32736, 32767, 40951, 42242, 51273, 55924, 58025, 58806, 59017, 59048, 61051
Offset: 1

Views

Author

T. D. Noe, Oct 06 2010

Keywords

Comments

Because x^5-y^5 = (x-y)(x^4+x^3*y+x^2*y^2+x*y^3+y^4), the difference of two 5th powers is a prime number only if x=y+1, in which case all the primes are in A121616. The number 7744 is the first of an infinite number of squares in this sequence.

Crossrefs

Cf. A024352 (squares), A181123 (cubes), A147857 (4th powers), A181125-A181128 (6th to 9th powers)

Programs

  • Mathematica
    nn=10^9; p=5; Union[Reap[Do[n=i^p-j^p; If[n<=nn, Sow[n]], {i,Ceiling[(nn/p)^(1/(p-1))]}, {j,i}]][[2,1]]]

A024359 Number of primitive Pythagorean triangles with short leg n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence gives number of times A takes value n.
Number of times n occurs in A020884.
a(A139544(n)) = 0; a(A024352(n)) > 0. - Reinhard Zumkeller, Nov 09 2012

Crossrefs

Cf. A020884, A024352, A024360, A024361, A132404 (where records occur), A139544.

Programs

  • Haskell
    a024359_list = f 0 1 a020884_list where
       f c u vs'@(v:vs) | u == v = f (c + 1) u vs
                        | u /= v = c : f 0 (u + 1) vs'
    -- Reinhard Zumkeller, Nov 09 2012
    
  • Mathematica
    solns[a_] := Module[{b, c, soln}, soln = Reduce[a^2 + b^2 == c^2 && a < b && c > 0 && GCD[a, b, c] == 1, {b, c}, Integers]; If[soln === False, 0, If[soln[[1, 1]] === b, 1, Length[soln]]]]; Table[solns[n], {n, 100}]
    (* Second program: *)
    a[n_] := Module[{s = 0, b, c, d, g}, Do[g = Quotient[n^2, d]; If[d <= g && Mod[d+g, 2] == 0, c = Quotient[d+g, 2]; b = g-c; If[n < b && GCD[b, c] == 1, s++]], {d, Divisors[n^2]}]; s]; Array[a, 100] (* Jean-François Alcover, Apr 27 2019, from PARI *)
  • PARI
    nppt(a) = {
      my(s=0, b, c, d, g);
      fordiv(a^2, d,
        g=a^2\d;
        if(d<=g && (d+g)%2==0,
          c=(d+g)\2; b=g-c;
          if(aColin Barker, Oct 25 2015

Formula

a(n) = A024361(n) - A024360(n). - Ray Chandler, Feb 03 2020

A181128 Difference of two positive 9th powers.

Original entry on oeis.org

0, 511, 19171, 19682, 242461, 261632, 262143, 1690981, 1933442, 1952613, 1953124, 8124571, 9815552, 10058013, 10077184, 10077695, 30275911, 38400482, 40091463, 40333924, 40353095, 40353606, 93864121, 124140032, 132264603, 133955584
Offset: 1

Author

T. D. Noe, Oct 06 2010

Keywords

Comments

No term is a prime number.

Crossrefs

Cf. A024352 (squares), A181123 (cubes), A147857 (4th powers), A181124-A181127 (5th to 8th powers)

Programs

  • Mathematica
    nn=10^15; p=9; Union[Reap[Do[n=i^p-j^p; If[n<=nn, Sow[n]], {i,Ceiling[(nn/p)^(1/(p-1))]}, {j,i}]][[2,1]]]

A105020 Array read by antidiagonals: row n (n >= 0) contains the numbers m^2 - n^2, m >= n+1.

Original entry on oeis.org

1, 3, 4, 5, 8, 9, 7, 12, 15, 16, 9, 16, 21, 24, 25, 11, 20, 27, 32, 35, 36, 13, 24, 33, 40, 45, 48, 49, 15, 28, 39, 48, 55, 60, 63, 64, 17, 32, 45, 56, 65, 72, 77, 80, 81, 19, 36, 51, 64, 75, 84, 91, 96, 99, 100, 21, 40, 57, 72, 85, 96, 105, 112, 117, 120, 121
Offset: 0

Author

Keywords

Comments

A "Goldbach Conjecture" for this sequence: when there are n terms between consecutive odd integers (2n+1) and (2n+3) for n > 0, at least one will be the product of 2 primes (not necessarily distinct). Example: n=3 for consecutive odd integers a(7)=7 and a(11)=9 and of the 3 sequence entries a(8)=12, a(9)=15 and a(10)=16 between them, one is the product of 2 primes a(9)=15=3*5. - Michael Hiebl, Jul 15 2007
A024352 gives distinct values in the array, minus the first row (1, 4, 9, 16, etc.). a(n) gives all solutions to the equation x^2 + xy = n, with y mod 2 = 0, x > 0, y >= 0. - Andrew S. Plewe, Oct 19 2007
Alternatively, triangular sequence of coefficients of Dynkin diagram weights for the Cartan groups C_n: t(n,m) = m*(2*n - m). Row sums are A002412. - Roger L. Bagula, Aug 05 2008

Examples

			Array begins:
  1  4  9 16 25 36  49  64  81 100 ...
  3  8 15 24 35 48  63  80  99 120 ...
  5 12 21 32 45 60  77  96 117 140 ...
  7 16 27 40 55 72  91 112 135 160 ...
  9 20 33 48 65 84 105 128 153 180 ...
  ...
Triangle begins:
   1;
   3,  4;
   5,  8,  9;
   7, 12, 15, 16;
   9, 16, 21, 24, 25;
  11, 20, 27, 32, 35, 36;
  13, 24, 33, 40, 45, 48, 49;
  15, 28, 39, 48, 55, 60, 63, 64;
  17, 32, 45, 56, 65, 72, 77, 80, 81;
  19, 36, 51, 64, 75, 84, 91, 96, 99, 100;
		

References

  • R. N. Cahn, Semi-Simple Lie Algebras and Their Representations, Dover, NY, 2006, ISBN 0-486-44999-8, p. 139.

Programs

  • Magma
    [(k+1)*(2*n-k+1): k in [0..n], n in [0..15]]; // G. C. Greubel, Mar 15 2023
    
  • Mathematica
    t[n_, m_]:= (n^2 - m^2); Flatten[Table[t[i, j], {i,12}, {j,i-1,0,-1}]]
    (* to view table *) Table[t[i, j], {j,0,6}, {i,j+1,10}]//TableForm (* Robert G. Wilson v, Jul 11 2005 *)
    Table[(k+1)*(2*n-k+1), {n,0,15}, {k,0,n}]//Flatten (* Roger L. Bagula, Aug 05 2008 *)
  • SageMath
    def A105020(n,k): return (k+1)*(2*n-k+1)
    flatten([[A105020(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Mar 15 2023

Formula

a(n) = r^2 - (r^2 + r - m)^2/4, where r = round(sqrt(m)) and m = 2*n+2. - Wesley Ivan Hurt, Sep 04 2021
a(n) = A128076(n+1) * A105020(n+1). - Wesley Ivan Hurt, Jan 07 2022
From G. C. Greubel, Mar 15 2023: (Start)
Sum_{k=0..n} T(n, k) = A002412(n+1).
Sum_{k=0..n} (-1)^k*T(n, k) = (1/2)*((1+(-1)^n)*A000384((n+2)/2) - (1- (-1)^n)*A000384((n+1)/2)). (End)

Extensions

More terms from Robert G. Wilson v, Jul 11 2005
Showing 1-10 of 25 results. Next