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-4 of 4 results.

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

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

A062316 Neither the sum or difference of 2 squares.

Original entry on oeis.org

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, 342, 350, 354, 358
Offset: 1

Views

Author

Michel ten Voorde, Jul 05 2001

Keywords

Comments

Elements of A022544 congruent to 2 (mod 4).
Union of numbers congruent to 6 mod 8 (A017137) with numbers of the form 2 * A084109(n). - Franklin T. Adams-Watters, Jan 21 2007
Explanation: odd numbers are equal to the difference between two successive squares and among even numbers, multiples of 4 are of the form (k+2)^2-k^2, thus odd numbers and multiples of 4 are not in the sequence. Conversely, a difference of 2 squares cannot equal 2 (mod 4), thus this sequence contains the integers of the form 4k+2 that are in A022544 (not the sum of two squares); among integers of form 4k+2, this sequence contains all the integers of the form 8n+6 (A017137) that are not the sum of 2 squares because they have at least one prime factor congruent to 3 (mod 4) to an odd power; it also contains integers of the form 8n+2 = 2(4n+1) with 4n+1 not the sum of two squares, which is sequence A084109. - Jean-Christophe Hervé, Oct 24 2015

Examples

			From _Jean-Christophe Hervé_, Oct 24 2015: (Start)
6, 14, 22, 30, 38, 46, ... are in the sequence because they equal 6 (mod 8).
42 = 2*3*7, 66 = 2*3*11, 114 = 2*7*11 are also in the sequence: of the form 2*(4n+1) with 4n+1 not the sum of 2 squares.
(End)
		

Crossrefs

Cf. A022544, A016825, union of A017137 and 2*A084109, complement of A263715.

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    S:= {seq(4*i+2,i=0..floor((N-2)/4))}
      minus {seq(seq(x^2 + y^2, y = x .. floor(sqrt(N-x^2)),2),x=1..floor(sqrt(N)))}:
    sort(convert(S,list)); # Robert Israel, Oct 25 2015
  • Mathematica
    Select[Range@ 360, SquaresR[2, #] == 0 && Mod[#, 4] == 2 &] (* Michael De Vlieger, Oct 26 2015, after Harvey P. Dale at A022544 *)

Formula

a(n) == 2 (mod 4). Subsequence of A016825 (non-differences of squares). All first differences are either 4 or 8, each of which occurs infinitely often. - David W. Wilson, Mar 09 2005
Lim_{n->inf} a(n)/n = 4.

Extensions

More terms from David W. Wilson, Feb 11 2003

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

Showing 1-4 of 4 results.