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.

A212709 Positive integers not of the form p * c^2 + b^2, with p prime and c and b nonzero integers.

Original entry on oeis.org

1, 2, 5, 10, 25, 58, 130
Offset: 1

Views

Author

Alonso del Arte, May 24 2012

Keywords

Comments

Many numbers can be ruled out from membership in this sequence with the case c = 1, which then corresponds to p + b^2 (see A064233).
If a positive integer is of the form p * c^2 + b^2, then it may potentially have two different factorizations in Z[sqrt(-p)] (assuming that is not a unique factorization domain, of course): the familiar factorization in Z, and (c + b sqrt(-p))(c - b sqrt(-p)).
There are no more terms <= 2*10^9. - Donovan Johnson, May 30 2012

Examples

			Since 24 can be expressed as 5 * 2^2 + 2^2, it is not in the sequence.
No such expression exists for 25, hence it is in the sequence.
Since 26 can be expressed as 17 * 1^2 + 3^2, it is not in the sequence.
		

Programs

  • Mathematica
    max = 10^5; Complement[Range[max], Flatten[Table[Prime[p]a^2 + b^2, {p, PrimePi[max]}, {a, Ceiling[Sqrt[max/2]]}, {b, Ceiling[Sqrt[max]]}]]]
  • PARI
    v=vectorsmall(10^5,i,1);forprime(p=2,#v,for(a=1,sqrtint(#v\p), b=0; while((t=p*a^2+b++^2)<=#v,v[t]=0)));for(i=1,#v,if(v[i], print1(i", "))) \\ Charles R Greathouse IV, May 29 2012