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

A079739 Primes of the form x^2 + y^2 + 2 (x,y nonnegative).

Original entry on oeis.org

2, 3, 7, 11, 19, 31, 43, 47, 67, 83, 103, 127, 139, 151, 199, 223, 227, 263, 271, 283, 307, 367, 379, 443, 463, 479, 487, 523, 547, 571, 587, 607, 619, 631, 643, 659, 691, 727, 787, 811, 823, 859, 883, 907, 911, 967, 983, 1019, 1039, 1051, 1063, 1091, 1231
Offset: 1

Views

Author

N. J. A. Sloane, Feb 18 2003

Keywords

Crossrefs

Programs

  • Maple
    S := {}: for x from 0 to 100 do for y from 0 to 100 do S := S union {x^2+y^2+2} od:od:S := sort(convert(S, list)): for i from 1 to 500 do if isprime(S[i]) then printf(`%d,`,S[i]) fi:od: # James Sellers, Feb 25 2003
  • Mathematica
    f[upto_]:=Module[{max=Ceiling[Sqrt[upto]]},Select[Select[ Union[Total[#]+2&/@(Tuples[Range[0,max],{2}]^2)], PrimeQ], #<=upto&]]; f[1250] (* Harvey P. Dale, Mar 19 2011 *)

Extensions

More terms from James Sellers, Feb 25 2003

A079544 Primes of the form x^2 + y^2 + 1, x>0, y>0.

Original entry on oeis.org

3, 11, 19, 41, 53, 59, 73, 83, 101, 107, 131, 137, 149, 163, 179, 181, 227, 233, 251, 293, 307, 347, 389, 401, 443, 467, 491, 521, 523, 563, 587, 593, 613, 641, 677, 739, 773, 809, 811, 821, 883
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2003

Keywords

Comments

Sequence is known to be infinite due to a result of Linnik.

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, p. 11.

Crossrefs

Cf. A079545.

Programs

  • Mathematica
    iMax=7!; a=Floor[Sqrt[iMax]]; lst={}; Do[Do[p=x^2+y^2+1; If[PrimeQ@p&&p<=iMax,AppendTo[lst,p]],{y,1,a}],{x,1,a}]; Union[lst] (* Vladimir Joseph Stephan Orlovsky, Aug 11 2009 *)
  • PARI
    list(lim)=my(v=List(),t); lim\=1; for(x=1,sqrtint(lim-2), forstep(y=2-x%2,min(x,sqrtint(lim-x^2-1)), 2, if(isprime(t=x^2+y^2+1), listput(v,t)))); vecsort(Vec(v),,8) \\ Charles R Greathouse IV, Jun 13 2012

A079740 Primes of the form x^2 + y^2 + 2 (x,y positive).

Original entry on oeis.org

7, 19, 31, 43, 47, 67, 103, 127, 139, 151, 199, 223, 227, 263, 271, 283, 307, 367, 379, 463, 479, 487, 523, 547, 571, 587, 607, 619, 631, 643, 659, 691, 727, 787, 811, 823, 859, 883, 907, 911, 967, 983, 1019, 1039, 1051, 1063, 1231, 1279, 1291, 1303, 1307
Offset: 1

Views

Author

N. J. A. Sloane, Feb 18 2003

Keywords

Crossrefs

Programs

  • Maple
    S := {}: for x from 1 to 100 do for y from 1 to 100 do S := S union {x^2+y^2+2} od:od:S := sort(convert(S, list)): for i from 1 to 500 do if isprime(S[i]) then printf(`%d,`,S[i]) fi:od: # James Sellers, Feb 25 2003

Extensions

More terms from James Sellers, Feb 25 2003

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

A333909 Numbers k such that phi(k) is the sum of 2 squares, where phi is the Euler totient function (A000010).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 15, 16, 17, 19, 20, 22, 24, 25, 27, 30, 32, 33, 34, 37, 38, 40, 41, 44, 48, 50, 51, 53, 54, 55, 57, 59, 60, 63, 64, 66, 68, 73, 74, 75, 76, 80, 82, 83, 85, 88, 91, 95, 96, 100, 101, 102, 106, 107, 108, 110, 111, 114, 117, 118, 120
Offset: 1

Views

Author

Amiram Eldar, Apr 09 2020

Keywords

Examples

			1 is a term since phi(1) = 1 = 0^2 + 1^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[120], SquaresR[2, EulerPhi[#]] > 0 &]
  • Python
    from itertools import count, islice
    from sympy import factorint, totient
    def A333909_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(totient(n)).items()),count(1))
    A333909_list = list(islice(A333909_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

c1 * x/log(x)^(3/2) < N(x) < c2 * x/log(x)^(3/2), where N(x) is the number of terms <= x, and c1 and c2 are two positive constants (Banks et al., 2005).

A333911 Numbers k such that sigma(k) is the sum of 2 squares, where sigma is the sum of divisors function (A000203).

Original entry on oeis.org

1, 3, 7, 9, 10, 17, 19, 21, 22, 27, 30, 31, 40, 46, 51, 52, 55, 57, 58, 63, 66, 67, 70, 71, 73, 79, 81, 88, 89, 90, 93, 94, 97, 103, 106, 115, 118, 119, 120, 127, 133, 138, 145, 153, 154, 156, 163, 165, 170, 171, 174, 179, 184, 189, 190, 193, 198, 199, 201, 202
Offset: 1

Views

Author

Amiram Eldar, Apr 09 2020

Keywords

Examples

			1 is a term since sigma(1) = 1 = 0^2 + 1^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], SquaresR[2, DivisorSigma[1, #]] > 0 &]
  • Python
    from itertools import count, islice
    from collections import Counter
    from sympy import factorint
    def A333911_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in sum((Counter(factorint((p**(e+1)-1)//(p-1))) for p, e in factorint(n).items()),start=Counter()).items()),count(1))
    A333911_list = list(islice(A333911_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

c1 * x/log(x)^(3/2) < N(x) < c2 * x/log(x)^(3/2), where N(x) is the number of terms <= x, and c1 and c2 are two positive constants (Banks et al., 2005).

A194627 a(1)=1, a(n+1) = p(n)^2 + q(n)^2 + 1, where p(n) and q(n) are the number of prime and nonprime numbers respectively in the sequence so far.

Original entry on oeis.org

1, 2, 3, 6, 9, 14, 21, 30, 41, 46, 59, 66, 81, 98, 117, 138, 161, 186, 213, 242, 273, 306, 341, 378, 417, 458, 501, 546, 593, 602, 651, 702, 755, 810, 867, 926, 987, 1050, 1115, 1182, 1251, 1322, 1395, 1470, 1547, 1626, 1707, 1790, 1875, 1962, 2051, 2142
Offset: 1

Views

Author

Greg Knowles, Sep 15 2011

Keywords

Examples

			For n=1, we have no primes and one nonprime (a(1)=1), so a(2)=0^2+1^2+1=2. Now we have one prime (a(2)=2) and one nonprime, so a(3)=1^2+1^2+1=3.
		

Crossrefs

Programs

A333910 Numbers k such that psi(k) is the sum of 2 squares, where psi is the Dedekind psi function (A001615).

Original entry on oeis.org

1, 3, 7, 10, 17, 18, 19, 20, 21, 22, 27, 30, 31, 36, 40, 44, 45, 46, 50, 51, 55, 57, 58, 60, 66, 67, 70, 71, 72, 73, 79, 80, 88, 89, 92, 93, 94, 97, 99, 100, 103, 106, 115, 116, 118, 119, 120, 126, 127, 132, 133, 138, 140, 144, 145, 150, 154, 160, 162, 163, 165
Offset: 1

Views

Author

Amiram Eldar, Apr 09 2020

Keywords

Examples

			1 is a term since psi(1) = 1 = 0^2 + 1^2.
		

Crossrefs

Programs

  • Mathematica
    psi[1] = 1; psi[n_] := n * Times @@ (1 + 1/Transpose[FactorInteger[n]][[1]]); Select[Range[200], SquaresR[2, psi[#]] > 0 &]
  • Python
    from itertools import count, islice
    from collections import Counter
    from sympy import factorint
    def A333910_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in sum((Counter(factorint(1+p))+Counter({p:e-1}) for p ,e in factorint(n).items()),start=Counter()).items()),count(1))
    A333910_list = list(islice(A333910_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

c1 * x/log(x)^(3/2) < N(x) < c2 * x/log(x)^(3/2), where N(x) is the number of terms <= x, and c1 and c2 are two positive constants (Banks et al., 2005).

A258839 Carmichael numbers whose prime factors all have the form p=1+x^2+y^2 for some x,y in Z.

Original entry on oeis.org

561, 162401, 410041, 488881, 656601, 2433601, 36765901, 109393201, 171454321, 176659201, 178837201, 189941761, 221884001, 288120421, 600892993, 618068881, 721244161, 931694401, 985052881, 1183104001, 1828377001, 1848112761, 1943951041, 2361232477, 2438403661
Offset: 1

Views

Author

Michel Marcus, Jun 12 2015

Keywords

Comments

Banks & Freiberg show that this sequence is infinite.

Crossrefs

Cf. A002997 (Carmichael numbers), A079545 (primes of the form x^2 + y^2 + 1).

Programs

  • PARI
    has(n)=for(x=sqrtint(n\2),sqrtint(n-1), if(issquare(n-x^2-1), return(1)));0
    Korselt(n,f=factor(n))=for(i=1,#f~,if(f[i, 2]>1||(n-1)%(f[i, 1]-1),return(0))); 1
    is(n)=my(f); if(n%2==0||isprime(n)||!Korselt(n,f=factor(n))||n<9, return(0)); for(i=1,#f~,if(!has(f[i,1]), return(0))); 1 \\ Charles R Greathouse IV, Jun 12 2015
Showing 1-9 of 9 results.