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

A139544 Numbers which are not the difference of two squares of positive integers.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230
Offset: 1

Views

Author

Artur Jasinski, Apr 25 2008

Keywords

Comments

Conjecture: these numbers do not occur in A139491.
Complement sequence to A024352.
All odd numbers 2k+1 for k>0 can be represented by (k+1)^2-k^2. All multiples 4k for k>1 can be represented by (k+1)^2-(k-1)^2. No number of the form 4k+2 is the difference of two squares because, modulo 4, the differences of two squares are 0, 1, or 3. [T. D. Noe, Apr 27 2009]
A024359(a(n)) = 0. - Reinhard Zumkeller, Nov 09 2012

Crossrefs

Programs

  • Haskell
    a139544 n = a139544_list !! (n-1)
    a139544_list = 1 : 2 : 4 : tail a016825_list
    -- Reinhard Zumkeller, Nov 09 2012
    
  • Mathematica
    a[1] = 1; a[2] = 2; a[3] = 4; a[n_] := 4*n-10; Array[a, 60] (* Jean-François Alcover, May 27 2015 *)
  • PARI
    is(n)=n%4==2||n==1||n==4 \\ Charles R Greathouse IV, May 31 2013
    
  • Python
    def A139544(n): return 1<Chai Wah Wu, Feb 11 2025

Extensions

Corrected by T. D. Noe, Apr 27 2009

A097271 Numbers that are neither the sum of two nonzero squares nor the difference of two nonzero squares.

Original entry on oeis.org

1, 4, 6, 14, 22, 30, 38, 42, 46, 54, 62, 66, 70, 78, 86, 94, 102, 110, 114, 118, 126, 134, 138, 142, 150, 154, 158, 166, 174, 182, 186, 190, 198, 206, 210, 214, 222, 230, 238, 246, 254, 258, 262, 266, 270, 278, 282, 286, 294, 302, 310, 318, 322, 326, 330, 334
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Complement of union of A000404 (sum of squares) and A024352 (difference of squares).
Differs from A062316 only in having an initial 1,4.

Crossrefs

Programs

  • Mathematica
    Module[{nn=70,sq},sq=Flatten[{Total[#],Abs[#[[1]]-#[[2]]]}&/@Tuples[ Range[ 3nn]^2,2]]//Union;Take[Complement[Range[Max[sq]],sq],nn]] (* Harvey P. Dale, Nov 04 2016 *)

A181125 Difference of two positive 6th powers.

Original entry on oeis.org

0, 63, 665, 728, 3367, 4032, 4095, 11529, 14896, 15561, 15624, 31031, 42560, 45927, 46592, 46655, 70993, 102024, 113553, 116920, 117585, 117648, 144495, 215488, 246519, 258048, 261415, 262080, 262143, 269297, 413792, 468559, 484785, 515816
Offset: 1

Views

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-A181128 (5th to 9th powers).
Cf. A022522 (a subsequence, except its first term). - Mathew Englander, Jun 01 2014

Programs

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

A379815 a(n) is the smallest integer k > n such that sqrt(1/n + 1/k) is a rational number; or 0 if no such k exists.

Original entry on oeis.org

0, 16, 9, 0, 20, 12, 441, 64, 16, 90, 1089, 36, 4212, 98, 225, 0, 272, 144, 549081, 25, 567, 2156, 13225, 48, 144, 650, 81, 98, 142100, 150, 71622369, 256, 363, 578, 1225, 64, 1332, 684, 468, 360, 41984, 252, 521345889, 198, 180, 559682, 108241, 144, 63, 400, 127449, 117, 1755572, 108, 2420, 392, 4275, 568458
Offset: 1

Views

Author

Felix Huber, Feb 07 2025

Keywords

Comments

a(1) = a(4) = a(16) = 0. Proof: See Huber link.
k > n exists for n > 16.

Examples

			a(3) = 9 because sqrt(1/3 + 1/4) = sqrt(7/12) is irrational, sqrt(1/3 + 1/5) = sqrt(8/15) is irrational, sqrt(1/3 + 1/6) = sqrt(1/2) is irrational, sqrt(1/3 + 1/7) = sqrt(10/21) is irrational, sqrt(1/3 + 1/8) = sqrt(11/24) is irrational, but sqrt(1/3 + 1/9) = sqrt(4/9) = 2/3 is rational.
		

Crossrefs

Programs

  • Maple
    A379815:=proc(n)
        local k;
        if n=1 or n=4 or n=16 then
            return 0
        else
            for k from n+1 do
                if type(sqrt(1/n+1/k),rational) then
                    return k
                fi
            od
        fi;
    end proc;
    seq(A379815(n),n=1..58);
  • PARI
    a(n) = if ((n==1) || (n==4) || (n==16), return(0)); my(k=n+1); while (!issquare(1/n + 1/k), k++); k; \\ Michel Marcus, Feb 08 2025

Formula

a(n) <= n*A002350(n)^2 - n if n is not a square; a(m^2) <= A076600(m)^2. - Jinyuan Wang, Feb 11 2025

A379816 a(n) is the smallest integer k > n such that sqrt(1/n - 1/k) is a rational number; or 0 if no such k exists.

Original entry on oeis.org

0, 4, 12, 0, 25, 18, 448, 16, 12, 100, 1100, 18, 4225, 112, 240, 18, 289, 36, 549100, 25, 588, 2178, 13248, 72, 45, 676, 108, 126, 142129, 180, 71622400, 64, 396, 612, 1260, 48, 1369, 722, 507, 400, 42025, 294, 521345932, 242, 225, 559728, 108288, 72, 112, 100, 127500, 169, 1755625, 162, 2475, 448, 4332, 568516, 16573100, 150
Offset: 1

Views

Author

Felix Huber, Feb 07 2025

Keywords

Comments

a(1) = a(4) = 0. Proof: See Huber link.
k > n exists for n > 4.
Continues a(61) <= 53872731025, a(62) = 1984, a(63) = 112, a(64) = 72, a(65) = 4225, a(66) = 2178, a(67) <= 159831244588, a(68) = 1156, a(69) = 268272, a(70) = 8820, a(71) <= 859838400, a(72) = 144, a(73) <= 83265625, a(74) = 136900, a(75) = 300, a(76) = 6498, a(77) = 13552, a(78) = 2106, a(79) = 505600, a(80) = 100, a(81) = 108, a(82) = 6724, a(83) = 558092, a(84) = 147, a(85) = 12145225, a(86) = 447458, a(87) = 68208, a(88) = 8712, a(89) = 22250089, a(90) = 100, a(91) = 225450316, a(92)=1150, a(93) = 565068, a(97) <= 3046267249, a(101) = 10201, a(103) <= 5332206050752, a(107) = 99022508. - R. J. Mathar, Feb 21 2025
For nonsquare n, solutions k (not necessarily the smallest ones) are given by k= n*A002350(n)^2 such that 1/n-1/k= (A002349(n)/A002350(n))^2. - R. J. Mathar, Feb 25 2025
For n=p^2, squared odd primes, solutions k (not necessarily the smallest) are constructed by k=p*(p+1)^2/4 such that 1/n -1/k = 1/p^2-1/k = [(p-1)/(p*(p+1))]^2 is a rational square. For other perfect squares n, start from such a solution for a prime factor p|n, n=(p*f)^2, and multiply the 3 terms of both sides of that solution with 1/f^2 to find a solution for n. - R. J. Mathar, Feb 25 2025

Examples

			a(16) = 18 because sqrt(1/16 - 1/17) = sqrt(1/272) is irrational but sqrt(1/16 - 1/18) = sqrt(1/144) = 1/12 is rational.
		

Crossrefs

Programs

  • Maple
    A379816:=proc(n)
        local k;
        if n=1 or n=4 then
            return 0
        else
            for k from n+1 do
                if type(sqrt(1/n-1/k),rational) then
                    return k
                fi
            od
        fi;
    end proc;
    seq(A379816(n),n=1..58);
  • PARI
    a(n) = if ((n==1) || (n==4), return(0)); my(k=n+1); while (!issquare(1/n - 1/k), k++); k; \\ Michel Marcus, Feb 08 2025

Extensions

Terms a(59-60) from R. J. Mathar, Feb 12 2025

A024411 Short leg of more than one primitive Pythagorean triangle.

Original entry on oeis.org

20, 28, 33, 36, 39, 44, 48, 51, 52, 57, 60, 65, 68, 69, 75, 76, 84, 85, 87, 88, 92, 93, 95, 96, 100, 104, 105, 108, 111, 115, 116, 119, 120, 123, 124, 129, 132, 133, 135, 136, 140, 141, 145, 147, 148, 152, 155, 156, 159, 160, 161, 164, 165, 168, 172, 175, 177, 180, 183, 184
Offset: 1

Views

Author

Keywords

Comments

Every term is composite. - Clark Kimberling, Feb 04 2024
Proof by contradiction: let p prime be the short leg. Then p^2 + b^2 = c^2 i.e., p^2 = (c - b) * (c + b). Then (c - b, c + b) in {(1, p^2), (p, p)}. If (c - b, c + b) = (p, p) then c = p and b = 0 which is impossible. Hence there is at most one solution for (c - b, c + b). A contradiction. - David A. Corneth, Feb 04 2024

Crossrefs

Programs

  • Mathematica
    aa=1;s="";For[a=1,a<=10^2,For[b=a+1,((b+1)^2-b^2)<=a^2,c=(a^2+b^2)^0.5;If[c==Round[c]&&GCD[a,b]==1,If[a==aa,s=s<>ToString[a]<>","];If[a!=aa,aa=a,aa=1]];b++ ];a++ ];s (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
  • PARI
    is(n) = {
    	my(d = divisors(n^2), q = 0, b, c);
    	for(i = 1, #d\2,
    		if(!bitand(d[#d + 1 - i] - d[i], 1),
    			c = (d[i] + d[#d + 1 - i])/2;
    			b = d[#d + 1 - i] - c;
    			if(gcd(n, b) == 1 && n < b,
    				q++;
    				if(q >= 2,
    					return(1)
    				)
    			)
    		)
    	); 0
    } \\ David A. Corneth, Feb 04 2024

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

Original entry on oeis.org

3, 7, 9, 11, 12, 15, 16, 19, 21, 23, 24, 27, 28, 31, 33, 35, 36, 39, 43, 44, 47, 48, 49, 51, 55, 56, 57, 59, 60, 63, 64, 67, 69, 71, 75, 76, 77, 79, 81, 83, 84, 87, 88, 91, 92, 93, 95, 96, 99, 103, 105, 107, 108, 111, 112, 115, 119, 120, 121, 123, 124, 127, 129, 131, 132
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Intersection of A024352 (difference of squares) and complement of A000404 (sum of squares).

Crossrefs

A181126 Difference of two positive 7th powers.

Original entry on oeis.org

0, 127, 2059, 2186, 14197, 16256, 16383, 61741, 75938, 77997, 78124, 201811, 263552, 277749, 279808, 279935, 543607, 745418, 807159, 821356, 823415, 823542, 1273609, 1817216, 2019027, 2080768, 2094965, 2097024, 2097151, 2685817
Offset: 1

Views

Author

T. D. Noe, Oct 06 2010

Keywords

Comments

Because x^7-y^7 = (x-y)(x^6+x^5*y+x^4*y^2+x^3*y^3+x^2*y^4+x*y^5+y^6), the difference of two 7th powers is a prime number only if x=y+1, in which case all the primes are in A121618.
The number 67675234241018881 = 127^8 is the first of an infinite number of squares of the form (b^(7k)-1)^8 in this sequence. Are any other squares possible?

Crossrefs

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

Programs

  • Mathematica
    nn=10^12; p=7; Union[Reap[Do[n=i^p-j^p; If[n<=nn, Sow[n]], {i,Ceiling[(nn/p)^(1/(p-1))]}, {j,i}]][[2,1]]]
    Join[{0},#[[2]]-#[[1]]&/@Subsets[Range[10]^7,{2}]//Union] (* Harvey P. Dale, Oct 23 2024 *)

A181127 Difference of two positive 8th powers.

Original entry on oeis.org

0, 255, 6305, 6560, 58975, 65280, 65535, 325089, 384064, 390369, 390624, 1288991, 1614080, 1673055, 1679360, 1679615, 4085185, 5374176, 5699265, 5758240, 5764545, 5764800, 11012415, 15097600, 16386591, 16711680, 16770655, 16776960
Offset: 1

Views

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-A181128 (5th to 9th powers)

Programs

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

A303744 Numbers that are not a difference between same powers (greater than 1) of positive numbers.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 18, 22, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 222, 226, 230, 234, 238, 246, 250, 254, 258, 262, 266, 270, 274, 278, 282, 286, 290
Offset: 1

Views

Author

Adam Kertesz, Apr 29 2018

Keywords

Comments

Apart from 1 and 4, all terms == 2 (mod 4). - Robert Israel, Jun 25 2018

Examples

			Odd numbers greater than 1 are differences of squares, so they are not here.
8 is not a term, 9 - 1: difference of two squares;
26 is not a term, 27 - 1: difference of two cubes.
		

Crossrefs

Sequences of numbers that are difference of powers: A024352 (squares), A181123 (cubes).
And of further n-th powers: A147857 (4th), A181124 (5th), A181125 (6th), A181126 (7th), A181127 (8th), A181128 (9th).

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    S:= {1,2,4,seq(i,i=6..N,4)}:
    for p from 3 to ilog2(N+1) do
      for n from 1 while n^p - (n-1)^p <= N do
        if n^p > N then m0:= ceil((n^p - N)^(1/p)) else m0:= 1 fi;
        for m from m0 to n-1 do
          v:= n^p-m^p;
          S:= S minus {v};
        od
    od od:
    sort(convert(S,list)); # Robert Israel, Jun 25 2018
Previous Showing 11-20 of 25 results. Next