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-10 of 14 results. Next

A002145 Primes of the form 4*k + 3.

Original entry on oeis.org

3, 7, 11, 19, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 127, 131, 139, 151, 163, 167, 179, 191, 199, 211, 223, 227, 239, 251, 263, 271, 283, 307, 311, 331, 347, 359, 367, 379, 383, 419, 431, 439, 443, 463, 467, 479, 487, 491, 499, 503, 523, 547, 563, 571
Offset: 1

Views

Author

Keywords

Comments

Or, odd primes p such that -1 is not a square mod p, i.e., the Legendre symbol (-1/p) = -1. [LeVeque I, p. 66]. - N. J. A. Sloane, Jun 28 2008
Primes which are not the sum of two squares, see the comment in A022544. - Artur Jasinski, Nov 15 2006
Natural primes which are also Gaussian primes. (It is a common error to refer to this sequence as "the Gaussian primes".)
Inert rational primes in the field Q(sqrt(-1)). - N. J. A. Sloane, Dec 25 2017
Numbers n such that the product of coefficients of (2n)-th cyclotomic polynomial equals -1. - Benoit Cloitre, Oct 22 2002
For p and q both belonging to the sequence, exactly one of the congruences x^2 = p (mod q), x^2 = q (mod p) is solvable, according to Gauss reciprocity law. - Lekraj Beedassy, Jul 17 2003
Also primes p that divide L((p-1)/2) or L((p+1)/2), where L(n) = A000032(n), the Lucas numbers. Union of A122869 and A122870. - Alexander Adamchuk, Sep 16 2006
Also odd primes p that divide ((p-1)!! + 1) or ((p-2)!! + 1). - Alexander Adamchuk, Nov 30 2006
Also odd primes p that divide ((p-1)!! - 1) or ((p-2)!! - 1). - Alexander Adamchuk, Apr 18 2007
This sequence is a proper subset of the set of the absolute values of negative fundamental discriminants (A003657). - Paul Muljadi, Mar 29 2008
Bernard Frénicle de Bessy discovered that such primes cannot be the hypotenuse of a Pythagorean triangle in opposition to primes of the form 4*n+1 (see A002144). - after Paul Curtz, Sep 10 2008
A079261(a(n)) = 1; complement of A145395. - Reinhard Zumkeller, Oct 12 2008
Subsequence of A007970. - Reinhard Zumkeller, Jun 18 2011
A151763(a(n)) = -1.
Primes p such that p XOR 2 = p - 2. Brad Clardy, Oct 25 2011 (Misleading in the sense that this is a formula for the super-sequence A004767. - R. J. Mathar, Jul 28 2014)
It appears that each term of A004767 is the mean of two terms of this subsequence of primes therein; cf. A245203. - M. F. Hasler, Jul 13 2014
Numbers n > 2 such that ((n-2)!!)^2 == 1 (mod n). - Thomas Ordowski, Jul 24 2016
Odd numbers n > 1 such that ((n-1)!!)^2 == 1 (mod n). - Thomas Ordowski, Jul 25 2016
Primes p such that (p-2)!! == (p-3)!! (mod p). - Thomas Ordowski, Jul 28 2016
See Granville and Martin for a discussion of the relative numbers of primes of the form 4k+1 and 4k+3. - Editors, May 01 2017
Sometimes referred to as Blum primes for their connection to A016105 and the Blum Blum Shub generator. - Charles R Greathouse IV, Jun 14 2018
Conjecture: a(n) for n > 4 can be written as a sum of 3 primes of the form 4k+1, which would imply that primes of the form 4k+3 >= 23 can be decomposed into a sum of 6 nonzero squares. - Thomas Scheuerle, Feb 09 2023

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 146-147.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 219, th. 252.
  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, p. 66.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 90.

Crossrefs

Apart from initial term, same as A045326.
Cf. A016105.
Cf. A004614 (multiplicative closure).

Programs

  • Haskell
    a002145 n = a002145_list !! (n-1)
    a002145_list = filter ((== 1) . a010051) [3, 7 ..]
    -- Reinhard Zumkeller, Aug 02 2015, Sep 23 2011
    
  • Magma
    [4*n+3 : n in [0..142] | IsPrime(4*n+3)]; // Arkadiusz Wesolowski, Nov 15 2013
    
  • Maple
    A002145 := proc(n)
        option remember;
        if n = 1 then
            3;
        else
            a := nextprime(procname(n-1)) ;
            while a mod 4 <>  3 do
                a := nextprime(a) ;
            end do;
            return a;
        end if;
    end proc:
    seq(A002145(n),n=1..20) ; # R. J. Mathar, Dec 08 2011
  • Mathematica
    Select[4Range[150] - 1, PrimeQ] (* Alonso del Arte, Dec 19 2013 *)
    Select[ Prime@ Range[2, 110], Length@ PowersRepresentations[#^2, 2, 2] == 1 &] (* or *)
    Select[ Prime@ Range[2, 110], JacobiSymbol[-1, #] == -1 &] (* Robert G. Wilson v, May 11 2014 *)
  • PARI
    forprime(p=2,1e3,if(p%4==3,print1(p", "))) \\ Charles R Greathouse IV, Jun 10 2011
    
  • Sage
    def A002145_list(n): return [p for p in prime_range(1, n + 1) if p % 4 == 3]  # Peter Luschny, Jul 29 2014

Formula

Remove from A000040 terms that are in A002313.
Intersection of A000040 and A004767. - Alonso del Arte, Apr 22 2014
From Vaclav Kotesovec, Apr 30 2020: (Start)
Product_{k>=1} (1 - 1/a(k)^2) = A243379.
Product_{k>=1} (1 + 1/a(k)^2) = A243381.
Product_{k>=1} (1 - 1/a(k)^3) = A334427.
Product_{k>=1} (1 + 1/a(k)^3) = A334426.
Product_{k>=1} (1 - 1/a(k)^4) = A334448.
Product_{k>=1} (1 + 1/a(k)^4) = A334447.
Product_{k>=1} (1 - 1/a(k)^5) = A334452.
Product_{k>=1} (1 + 1/a(k)^5) = A334451. (End)
From Vaclav Kotesovec, May 05 2020: (Start)
Product_{k>=1} (1 + 1/a(k)) / (1 + 1/A002144(k)) = Pi/(4*A064533^2) = 1.3447728438248695625516649942427635670667319092323632111110962...
Product_{k>=1} (1 - 1/a(k)) / (1 - 1/A002144(k)) = Pi/(8*A064533^2) = 0.6723864219124347812758324971213817835333659546161816055555481... (End)
Sum_{k >= 1} 1/a(k)^s = (1/2) * Sum_{n >= 1 odd numbers} moebius(n) * log(2 * (2^(n*s) - 1) * (n*s - 1)! * zeta(n*s) / (Pi^(n*s) * abs(EulerE(n*s - 1))))/n, s >= 3 odd number. - Dimitris Valianatos, May 20 2020

Extensions

More terms from James Sellers, Apr 21 2000

A088539 Decimal expansion of (4K/Pi)^2 where K is the Landau-Ramanujan constant.

Original entry on oeis.org

9, 4, 6, 8, 0, 6, 4, 0, 7, 1, 8, 0, 0, 7, 9, 3, 3, 4, 2, 1, 6, 0, 9, 4, 4, 1, 3, 1, 0, 9, 7, 5, 6, 2, 3, 3, 2, 5, 0, 0, 6, 9, 5, 0, 2, 6, 4, 7, 1, 6, 5, 3, 1, 2, 1, 8, 1, 9, 7, 9, 5, 6, 5, 5, 3, 5, 8, 2, 0, 1, 0, 6, 6, 3, 9, 3, 6, 3, 7, 9, 2, 8, 1, 3, 9, 8, 9, 1, 3, 3, 0, 0, 4, 9, 9, 6, 2, 6, 0, 5, 2, 3, 4, 3
Offset: 0

Views

Author

Benoit Cloitre, Nov 16 2003

Keywords

Examples

			0.9468064071800793342160944131097562332500695...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, p. 100

Crossrefs

Programs

  • Mathematica
    digits = 104; LandauRamanujanK = 1/Sqrt[2]*NProduct[((1-2^(-2^n)) * Zeta[2^n] / DirichletBeta[2^n])^(1/2^(n+1)), {n, 1, 24}, WorkingPrecision -> digits+5]; (4*LandauRamanujanK/Pi)^2 // RealDigits[#, 10, digits]& // First (* Jean-François Alcover, Mar 04 2013, updated Mar 14 2018 *)

Formula

Equals prod(1-1/p^2) where p runs through the primes p==1 mod 4
A088539 * A243379 = 8 / Pi^2. - Vaclav Kotesovec, Apr 30 2020
Equals 1/A175647. - Vaclav Kotesovec, May 05 2020

A243381 Decimal expansion of Pi^2/(16*K^2*G) = Product_{p prime congruent to 3 modulo 4} (1 + 1/p^2), where K is the Landau-Ramanujan constant and G Catalan's constant.

Original entry on oeis.org

1, 1, 5, 3, 0, 8, 0, 5, 6, 1, 5, 8, 5, 4, 4, 7, 8, 7, 0, 3, 6, 5, 2, 5, 8, 0, 6, 8, 5, 6, 1, 7, 6, 3, 3, 6, 5, 1, 0, 4, 8, 4, 4, 8, 7, 0, 8, 0, 3, 9, 3, 1, 8, 8, 6, 7, 7, 9, 2, 3, 1, 9, 0, 2, 1, 0, 3, 5, 4, 6, 8, 4, 1, 3, 2, 5, 2, 9, 8, 2, 0, 0, 4, 3, 5, 4, 9, 2, 5, 3, 5, 9, 2, 8, 1, 2, 0, 7, 8, 1, 2
Offset: 1

Views

Author

Jean-François Alcover, Jun 04 2014

Keywords

Examples

			1.1530805615854478703652580685617633651...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, Section 2.3 Landau-Ramanujan constant, p. 101.

Crossrefs

Programs

  • Mathematica
    digits = 101; LandauRamanujanK = 1/Sqrt[2]*NProduct[((1 - 2^(-2^n))*Zeta[2^n]/DirichletBeta[2^n])^(1/2^(n + 1)), {n, 1, 24}, WorkingPrecision -> digits + 5]; Pi^2/(16*LandauRamanujanK^2*Catalan) // RealDigits[#, 10, digits] & // First (* updated Mar 14 2018 *)

Formula

Equals Pi^2/(16*K^2*G), where K is the Landau-Ramanujan constant (A064533) and G Catalan's constant (A006752).
A243380 * A243381 = 12/Pi^2. - Vaclav Kotesovec, Apr 30 2020

A334427 Decimal expansion of Product_{k>=1} (1 - 1/A002145(k)^3).

Original entry on oeis.org

9, 5, 9, 1, 4, 2, 7, 1, 1, 0, 4, 3, 2, 0, 7, 3, 4, 4, 9, 9, 9, 7, 0, 5, 9, 1, 3, 7, 5, 0, 2, 0, 9, 8, 1, 5, 3, 6, 5, 4, 2, 3, 6, 5, 9, 7, 7, 4, 4, 5, 7, 1, 0, 6, 3, 4, 8, 6, 2, 6, 6, 4, 3, 2, 8, 0, 6, 8, 5, 4, 9, 8, 8, 3, 8, 6, 4, 2, 2, 3, 8, 9, 3, 4, 1, 2, 3, 9, 3, 7, 7, 5, 3, 7, 4, 3, 9, 7, 1, 3, 5, 8, 1, 1, 1, 3
Offset: 0

Views

Author

Vaclav Kotesovec, Apr 30 2020

Keywords

Examples

			0.959142711043207344999705913750209815365423...
		

References

  • B. C. Berndt, Ramanujan's notebook part IV, Springer-Verlag, 1994, p. 64-65.

Crossrefs

Formula

A334426 / A334427 = 28*zeta(3)/Pi^3.
A334425 * A334427 = 8/(7*zeta(3)).

Extensions

More digits from Vaclav Kotesovec, Jun 27 2020

A167181 Squarefree numbers such that all prime factors are == 3 mod 4.

Original entry on oeis.org

1, 3, 7, 11, 19, 21, 23, 31, 33, 43, 47, 57, 59, 67, 69, 71, 77, 79, 83, 93, 103, 107, 127, 129, 131, 133, 139, 141, 151, 161, 163, 167, 177, 179, 191, 199, 201, 209, 211, 213, 217, 223, 227, 231, 237, 239, 249, 251, 253, 263, 271, 283, 301, 307, 309, 311, 321, 329
Offset: 1

Views

Author

Arnaud Vernier, Oct 29 2009

Keywords

Comments

Or, numbers that are not divisible by the sum of two squares (other than 1). - Clarified by Gabriel Conant, Apr 18 2016
If a term divides the sum of two squares, then it divides each of the two numbers individually. Moreover, only the numbers in this sequence have this property. See link for proof. - V Sai Prabhav, Jul 15 2025

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    S:= {1};
    for p from 3 by 4 to N do
      if isprime(p) then
        S:= S union select(`<=`, map(t -> t*p, S),N)
      fi
    od:
    sort(convert(S,list)); # Robert Israel, Apr 18 2016
  • Mathematica
    Select[Range@ 1000, #==1 || ({{3}, {1}} == Union /@ {Mod[ #[[1]], 4], #[[2]]} &@ Transpose@ FactorInteger@ #) &] (* Giovanni Resta, Apr 18 2016 *)
  • PARI
    isok(n) = if (! issquarefree(n), return (0)); f = factor(n); for (i=1, #f~, if (f[i, 1] % 4 != 3, return (0))); 1 \\ Michel Marcus, Sep 04 2013

Formula

A005117 INTERSECT A004614. - R. J. Mathar, Nov 05 2009
The number of terms that do not exceed x is ~ c * x / sqrt(log(x)), where c = A243379/(2*sqrt(A175647)) = 0.4165140462... (Jakimczuk, 2024, Theorem 3.10, p. 26). - Amiram Eldar, Mar 08 2024

Extensions

Edited by Zak Seidov, Oct 30 2009
Narrowed definition down to squarefree numbers - R. J. Mathar, Nov 05 2009

A334448 Decimal expansion of Product_{k>=1} (1 - 1/A002145(k)^4).

Original entry on oeis.org

9, 8, 7, 1, 6, 2, 6, 2, 5, 4, 2, 2, 2, 2, 6, 8, 5, 6, 4, 8, 2, 7, 0, 1, 2, 6, 4, 5, 7, 7, 3, 7, 0, 8, 2, 7, 7, 2, 4, 0, 3, 2, 7, 9, 7, 2, 9, 2, 8, 2, 4, 1, 4, 7, 4, 3, 4, 8, 3, 2, 6, 5, 0, 8, 5, 5, 7, 3, 0, 8, 9, 4, 7, 5, 6, 6, 7, 0, 0, 1, 8, 8, 9, 0, 8, 4, 1, 5, 0, 4, 9, 9, 8, 9, 0, 7, 3, 3, 4, 7, 7, 0, 3, 5, 3, 6
Offset: 0

Views

Author

Vaclav Kotesovec, Apr 30 2020

Keywords

Comments

In general, for s>1, Product_{k>=1} (1 + 1/A002145(k)^s)/(1 - 1/A002145(k)^s) = 2^s * (2^s - 1) * zeta(s) / (zeta(s, 1/4) - zeta(s, 3/4)).

Examples

			0.98716262542222685648270126457737082772403279729282414743483...
		

References

  • B. C. Berndt, Ramanujan's notebook part IV, Springer-Verlag, 1994, p. 64-65.

Crossrefs

Formula

A334447 / A334448 = 1/(PolyGamma(3, 1/4)/(8*Pi^4) - 1).
A334446 * A334448 = 96/Pi^4.

Extensions

More digits from Vaclav Kotesovec, Jun 27 2020

A334452 Decimal expansion of Product_{k>=1} (1 - 1/A002145(k)^5).

Original entry on oeis.org

9, 9, 5, 8, 1, 8, 7, 2, 9, 8, 6, 8, 0, 8, 0, 5, 9, 5, 9, 4, 3, 3, 8, 5, 1, 6, 1, 6, 4, 3, 1, 6, 5, 9, 7, 1, 8, 7, 4, 3, 4, 7, 2, 7, 3, 1, 8, 4, 9, 1, 0, 5, 6, 6, 3, 9, 8, 3, 5, 7, 7, 1, 4, 6, 9, 8, 0, 3, 9, 6, 3, 9, 6, 7, 0, 3, 1, 0, 4, 6, 7, 9, 7, 0, 0, 5, 4, 4, 0, 1, 9, 6, 8, 0, 3, 1, 8, 2, 3, 3, 9, 3, 9, 8, 4, 5
Offset: 0

Views

Author

Vaclav Kotesovec, Apr 30 2020

Keywords

Comments

In general, for s>0, Product_{k>=1} (1 + 1/A002145(k)^(2*s+1))/(1 - 1/A002145(k)^(2*s+1)) = (2*s)! * (2^(2*s + 2) - 2) * zeta(2*s+1) / (Pi^(2*s+1) * A000364(s)). - Dimitris Valianatos, May 01 2020
In general, for s>1, Product_{k>=1} (1 + 1/A002145(k)^s)/(1 - 1/A002145(k)^s) = 2^s * (2^s - 1) * zeta(s) / (zeta(s, 1/4) - zeta(s, 3/4)).

Examples

			0.99581872986808059594338516164316597187434727318491056639835771469803963967031...
		

References

  • B. C. Berndt, Ramanujan's notebook part IV, Springer-Verlag, 1994, p. 64-65.

Crossrefs

Formula

A334451 / A334452 = 1488*zeta(5)/(5*Pi^5).
A334450 * A334452 = 32/(31*zeta(5)).

Extensions

More digits from Vaclav Kotesovec, Jun 27 2020

A242822 Decimal expansion of B. Davis' constant Pi^2/(8*G), a Riesz-Kolmogorov constant, where G is Catalan's constant.

Original entry on oeis.org

1, 3, 4, 6, 8, 8, 5, 2, 5, 1, 9, 9, 9, 4, 0, 6, 5, 9, 5, 1, 8, 2, 0, 0, 7, 5, 5, 5, 4, 4, 1, 1, 0, 7, 7, 9, 4, 7, 1, 5, 2, 5, 1, 6, 2, 5, 5, 6, 8, 9, 6, 8, 8, 2, 0, 8, 1, 9, 4, 2, 6, 2, 2, 8, 1, 2, 7, 0, 0, 8, 1, 0, 7, 3, 4, 2, 9, 5, 8, 3, 5, 2, 1, 0, 8, 2, 2, 9, 6, 3, 7, 7, 5, 4, 4, 7, 9, 8, 4, 7, 5
Offset: 1

Views

Author

Jean-François Alcover, May 23 2014

Keywords

Examples

			1.3468852519994065951820075554411...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, Section 7.7 Riesz-Kolmogorov Constants, p. 474.

Crossrefs

Programs

  • Magma
    SetDefaultRealField(RealField(100)); R:=RealField(); Pi(R)^2/(8*Catalan(R)); // G. C. Greubel, Aug 25 2018
  • Maple
    s:= convert(evalf(Pi^2/(8*Catalan), 140), string):
    map(parse, subs("."=NULL, [seq(i, i=s)]))[]; # Alois P. Heinz, May 23 2014
  • Mathematica
    RealDigits[Pi^2/(8*Catalan), 10, 100] // First
  • PARI
    default(realprecision, 100); Pi^2/(8*Catalan) \\ G. C. Greubel, Aug 25 2018
    

Formula

(Sum_{n>=0} 1/(2*n + 1)^2) / (Sum_{n>=0} (-1)^n/(2*n + 1)^2) = A111003/A006752.
Equals Product_{k>=1} (1 + 1/A002145(k)^2)/(1 - 1/A002145(k)^2) = A243381 / A243379. - Vaclav Kotesovec, Apr 30 2020
Equals Sum_{q in A004614} 2^A001221(q)/q^2. - R. J. Mathar, Jan 27 2021
Equals 1/A377753. - Hugo Pfoertner, Nov 22 2024

A053443 x^2 + y^2 does not take on all possible values mod n.

Original entry on oeis.org

4, 8, 9, 12, 16, 18, 20, 24, 27, 28, 32, 36, 40, 44, 45, 48, 49, 52, 54, 56, 60, 63, 64, 68, 72, 76, 80, 81, 84, 88, 90, 92, 96, 98, 99, 100, 104, 108, 112, 116, 117, 120, 121, 124, 126, 128, 132, 135, 136, 140, 144, 147, 148, 152, 153, 156, 160, 162, 164, 168, 171
Offset: 1

Views

Author

Keywords

Comments

Sequence gives values of n such there is not always a solution 1 < z < n to x^2 + y^2 = z (mod n). - Benoit Cloitre, Jan 04 2002; corrected by Carmine Suriano, Jun 19 2013
The asymptotic density of this sequence is 1- 3/(8*K^2) = 1 - (3/4) * A243379 = 0.35791..., where K is the Landau-Ramanujan constant (A064533). - Amiram Eldar, Dec 19 2020

Crossrefs

Complement of A240370.

Programs

  • Mathematica
    Select[Range[200], AnyTrue[FactorInteger[#], Mod[First[#1], 4] > 1 && Last[#1] > 1 &] &] (* Amiram Eldar, Dec 19 2020 *)
  • PARI
    is(n)=my(v=vectorsmall(n,i,1));for(x=0,n\2, for(y=0,x, v[(x^2+y^2)%n+1]=0)); vecmax(v) \\ Charles R Greathouse IV, Jun 19 2013
    
  • PARI
    is(n)=forprime(p=2,97,my(o=valuation(n,p));if(o,if(o>1&&p%4>1,return(1));n/=p^o));my(f=factor(n));for(i=1,#f[,1],if(f[i,2]>1&&f[i,1]%4>1,return(1)));0 \\ Charles R Greathouse IV, Jun 19 2013

Formula

n divisible by p^2 where p = 2 or prime p == 3 (mod 4).

A240370 Positive integers n such that every element in the ring of integers modulo n can be written as the sum of two squares modulo n.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 25, 26, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 46, 47, 50, 51, 53, 55, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 71, 73, 74, 75, 77, 78, 79, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 101, 102, 103, 105, 106, 107, 109, 110, 111, 113, 114, 115, 118, 119, 122, 123, 125, 127, 129, 130, 131, 133, 134, 137, 138, 139, 141, 142, 143, 145, 146, 149, 150, 151, 154, 155, 157, 158, 159, 161, 163, 165, 166, 167, 169
Offset: 1

Views

Author

Keywords

Comments

Numbers n such that, if p^2 divides n for any prime p, then p = 1 mod 4.
Equivalently, squarefree numbers times A004613.
Thus, numbers k such that A065338(A057521(k)) = 1. - Antti Karttunen, Jun 21 2014
Different from A193304: terms 169, 289, 338, 507, 578, 841, 845, 867, ... are here but not in A193304. - Michel Marcus, Jun 20 2014
The asymptotic density of this sequence is 3/(8*K^2) = (3/4) * A243379 = 0.64208..., where K is the Landau-Ramanujan constant (A064533). - Amiram Eldar, Dec 19 2020

Examples

			In Z_7, 0^2 + 0^2 = 0, 1^2 + 0^2 = 1, 1^2 + 1^2 = 2, 3^2 + 1^2 = 3, 2^2 + 0^2 = 4, 2^2 + 1^2 = 5, 3^2 + 2^2 = 6. Therefore 7 is in the sequence.
In Z_8, there is no way to express 3 as a sum of two squares. Therefore 8 is not in the sequence.
		

Crossrefs

The subsequence A240109 is a version not allowing 0.
Different from A193304.
Complement of A053443. Subsequence of A192450.

Programs

  • Mathematica
    rad[n_] := Times @@ First /@ FactorInteger[n];
    a57521[n_] := n/Denominator[n/rad[n]^2];
    a65338[n_] := a65338[n] = If[n==1, 1, Mod[p = FactorInteger[n][[1, 1]], 4]* a65338[n/p]];
    Select[Range[200], a65338[a57521[#]] == 1&] (* Jean-François Alcover, Sep 22 2018, after Antti Karttunen *)
    Select[Range[200], AllTrue[FactorInteger[#], Mod[First[#1], 4] == 1 || Last[#1] == 1 &] &] (* Amiram Eldar, Dec 19 2020 *)
  • PARI
    is(n)=my(f=factor(n)); for(i=1,#f~,if(f[i,2]>1 && f[i,1]%4>1, return(0))); 1
    
  • PARI
    isok(n) = { if (n < 2, return (0)); if ((n % 4) == 0, return (0)); forprime(q = 2, n, if (((q % 4) == 3) && ((n % q) == 0) && ((n % q^2) == 0), return (0)); ); return (1); } \\ Michel Marcus, Jun 08 2014
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A240370 (MATCHING-POS 1 1 (lambda (k) (= 1 (A065338 (A057521 k))))))
    ;; Antti Karttunen, Jun 21 2014
Showing 1-10 of 14 results. Next