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.

A166687 Numbers of the form x^2 + y^2 + 1, x, y integers.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 11, 14, 17, 18, 19, 21, 26, 27, 30, 33, 35, 37, 38, 41, 42, 46, 50, 51, 53, 54, 59, 62, 65, 66, 69, 73, 74, 75, 81, 82, 83, 86, 90, 91, 98, 99, 101, 102, 105, 107, 110, 114, 117, 118, 122, 123, 126, 129, 131, 137, 138, 145, 146, 147, 149, 150, 154, 158, 161
Offset: 1

Views

Author

N. J. A. Sloane, Mar 05 2010

Keywords

Comments

A001481 is the main entry for this sequence.
As Ng points out (Lemma 2.2), each prime divides some member of this sequence: 2 divides a(2) = 2, 3 divides a(3) = 3, 5 divides a(4) = 5, 7 divides a(9) = 14, etc. - Charles R Greathouse IV, Jan 04 2016

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    S:= {seq(seq(x^2+y^2+1,y=0..floor(sqrt(N-1-x^2))),x=0..floor(sqrt(N-1)))}:
    sort(convert(S,list)); # Robert Israel, Jan 05 2016
  • Mathematica
    Select[Range@ 162, Resolve[Exists[{x, y}, Reduce[# == x^2 + y^2 + 1, {x, y}, Integers]]] &] (* Michael De Vlieger, Jan 05 2016 *)
  • PARI
    is(n)=my(f=factor(n-1)); for(i=1, #f~, if(f[i,1]%4==3 && f[i,2]%2, return(0))); 1 \\ Charles R Greathouse IV, Jan 04 2016
    
  • PARI
    list(lim)=my(v=List(),t); lim\=1; for(m=0,sqrtint(lim-1), t=m^2+1; for(n=0, min(sqrtint(lim-t),m), listput(v,t+n^2))); Set(v) \\ Charles R Greathouse IV, Jan 05 2016