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.

Previous Showing 11-20 of 52 results. Next

A014556 Euler's "Lucky" numbers: n such that m^2-m+n is prime for m=0..n-1.

Original entry on oeis.org

2, 3, 5, 11, 17, 41
Offset: 1

Views

Author

Keywords

Comments

Same as n such that 4n-1 is a Heegner number 1,2,3,7,11,19,43,67,163 (see A003173 and Conway and Guy's book).

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 225.
  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 41, p. 16, Ellipses, Paris 2008.
  • I. N. Herstein and I. Kaplansky, Matters Mathematical, Chelsea, NY, 2nd. ed., 1978, see p. 38.
  • F. Le Lionnais, Les Nombres Remarquables. Paris: Hermann, pp. 88 and 144, 1983.

Crossrefs

Programs

  • Mathematica
    A003173 = Union[Select[-NumberFieldDiscriminant[Sqrt[-#]] & /@ Range[200], NumberFieldClassNumber[Sqrt[-#]] == 1 &] /. {4 -> 1, 8 -> 2}]; a[n_] := (A003173[[n + 4]] + 1)/4; Table[a[n], {n, 0, 5}] (* Jean-François Alcover, Jul 16 2012, after M. F. Hasler *)
    Select[Range[50],AllTrue[Table[m^2-m+#,{m,0,#-1}],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 12 2017 *)
  • PARI
    is(n)=n>1 && qfbclassno(1-4*n)==1 \\ Charles R Greathouse IV, Jan 29 2013
    
  • PARI
    is(p)=for(n=1,p-1, if(!isprime(n*(n-1)+p),return(0))); 1 \\ naive; Charles R Greathouse IV, Aug 26 2022
    
  • PARI
    is(p)=for(n=1,sqrt(p/3)\/1, if(!isprime(n*(n-1)+p),return(0))); 1 \\ Charles R Greathouse IV, Aug 26 2022

Formula

a(n) = (A003173(n+3) + 1)/4. - M. F. Hasler, Nov 03 2008

A139491 Numbers arising in A139490.

Original entry on oeis.org

3, 8, 9, 12, 15, 16, 21, 24, 40, 45, 48, 60, 72, 120, 168, 240, 840, 1848
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008, Apr 26 2008

Keywords

Comments

M. F. Hasler, Apr 24 2008, observed that the numbers in this sequence are differences of two squares. For example: 3=2^2-1^2, 8=3^2-1^2, 9=5^2-4^2, 15=4^2-1^2, 16=5^2-3^2, 21=5^2-2^2, 24=5^2-1^2, 40=7^2-3^2, 45=7^2-2^2, 48=7^2-1^2, 60=8^2-2^2.
This sequence is a subsequence of A024352.
These numbers appear to be a subset of the idoneal numbers A000926. If so, then the sequence is probably complete. - T. D. Noe, Apr 27 2009

Crossrefs

Programs

  • Mathematica
    f = 200; g = 300; h = 30; j = 100; b = {}; Do[a = {}; Do[Do[If[PrimeQ[x^2 + n y^2], AppendTo[a, x^2 + n y^2]], {x, 0, g}], {y, 1, g}]; AppendTo[b, Take[Union[a], h]], {n, 1, f}]; Print[b]; c = {}; Do[a = {}; Do[Do[If[PrimeQ[n^2 + w*n*m + m^2], AppendTo[a, n^2 + w*n*m + m^2]], {n, m, g}], {m, 1, g}]; AppendTo[c, Take[Union[a], h]], {w, 1, j}]; Print[c]; bb = {}; cc = {}; Do[Do[If[b[[p]] == c[[q]], AppendTo[bb, p]; AppendTo[cc, q]], {p, 1, f}], {q, 1, j}]; Union[bb]

Extensions

Extended by T. D. Noe, Apr 27 2009

A025052 Numbers not of form ab + bc + ca for 1<=a<=b<=c (probably the list is complete).

Original entry on oeis.org

1, 2, 4, 6, 10, 18, 22, 30, 42, 58, 70, 78, 102, 130, 190, 210, 330, 462
Offset: 1

Views

Author

Keywords

Comments

According to Borwein and Choi, if the Generalized Riemann Hypothesis is true, then this sequence has no larger terms, otherwise there may be one term greater than 10^11. - T. D. Noe, Apr 08 2004
Note that n+1 must be prime for all n in this sequence. - T. D. Noe, Apr 28 2004
Borwein and Choi prove (Theorem 6.2) that the equation N=xy+xz+yz has an integer solution x,y,z>0 if N contains a square factor and N is not 4 or 18. In the following simple proof explicit solutions are given. Let N=mn^2, m,n integer, m>0, n>1. If n3: x=6, y=n-3, z=n^2-4n+6. If n>m+1: if n=0 (mod m+1): x=m+1, y=m(m+1), z=m(n^2/(m+1)^2-1), if n=k (mod m+1), 0

Crossrefs

Subsequence of A000926 (numbers not of the form ab+ac+bc, 0A006093.
Cf. A093669 (numbers having a unique representation as ab+ac+bc, 0A093670 (numbers having a unique representation as ab+ac+bc, 0<=a<=b<=c).

Programs

  • Mathematica
    n=500; lim=Ceiling[(n-1)/2]; lst={}; Do[m=a*b+a*c+b*c; If[m<=n, lst=Union[lst, {m}]], {a, lim}, {b, lim}, {c, lim}]; Complement[Range[n], lst]

Extensions

Corrected by R. H. Hardin

A139490 Numbers n such that the quadratic form x^2 + n*x*y + y^2 represents exactly the same primes as the quadratic form x^2 + m*y^2 for some m.

Original entry on oeis.org

1, 4, 6, 7, 8, 10, 14, 16, 18, 22, 26, 38, 58, 82, 86
Offset: 1

Author

Artur Jasinski, Apr 24 2008, Apr 26 2008, Apr 27 2008

Keywords

Comments

For the numbers m see A139491.
Conjecture: This sequence is finite and complete (checked for range n<=200 and m<=500).
Three more terms were found by searching n <= 1000 and m <= 4000. The corresponding m are 840, 840, and 1848, which are idoneal numbers A000926. The sequence is probably complete now. [T. D. Noe, Apr 27 2009]

Examples

			a(1)=1 because the primes represented by x^2+xy+y^2 are the same as the primes represented by x^2 + 3*y^2 (see A007645).
The known pairs (n,m) are the following (checked for range n<=200 and m<=500):
n={1, 4, 4, 6, 6, 7, 8, 8, 10, 10, 10, 14, 14, 14, 16, 18, 22, 22, 26, 38, 38}
m={3, 9, 12, 8, 16, 15, 45, 60, 24, 48, 72, 24, 48, 72, 21, 40, 120, 240, 168, 120, 240}.
		

Programs

  • Mathematica
    f = 200; g = 300; h = 30; j = 100; b = {}; Do[a = {}; Do[Do[If[PrimeQ[x^2 + n y^2], AppendTo[a, x^2 + n y^2]], {x, 0, g}], {y, 1, g}]; AppendTo[b, Take[Union[a], h]], {n, 1, f}]; Print[b]; c = {}; Do[a = {}; Do[Do[If[PrimeQ[n^2 + w*n*m + m^2], AppendTo[a, n^2 + w*n*m + m^2]], {n, m, g}], {m, 1, g}]; AppendTo[c, Take[Union[a], h]], {w, 1, j}]; Print[c]; bb = {}; cc = {}; Do[Do[If[b[[p]] == c[[q]], AppendTo[bb, p]; AppendTo[cc, q]], {p, 1, f}], {q, 1, j}]; Union[cc] (*Artur Jasinski*)

Extensions

Edited by N. J. A. Sloane, Apr 25 2008
Extended by T. D. Noe, Apr 27 2009
Typo fixed by Charles R Greathouse IV, Oct 28 2009

A080715 Numbers k such that for any positive integers (a, b), if a * b = k then a + b is prime.

Original entry on oeis.org

1, 2, 6, 10, 22, 30, 42, 58, 70, 78, 82, 102, 130, 190, 210, 310, 330, 358, 382, 442, 462, 478, 562, 658, 742, 838, 862, 970, 1038, 1222, 1282, 1318, 1618, 1810, 1870, 1978, 2038, 2062, 2098, 2242, 2398, 2458, 2578, 2902, 2938, 2962, 3018, 3082, 3322, 3642, 3862, 4218, 4258, 4282, 4678, 5098, 5590, 5938, 6042, 6078
Offset: 1

Author

Matthew Vandermast, Mar 23 2003

Keywords

Comments

Sequence includes all even, squarefree "idoneal" or "convenient" numbers (A000926); all members are even and squarefree except 1 (which is also idoneal).
Is it known, or can it be proved, that this sequence is infinite?
Let p and p+2 be twin primes. If 2p+1 is also prime, 2p is in this sequence. - T. D. Noe, Jun 06 2006, Nov 26 2007
2*A045536 are the n with two prime factors. 2*A128279 are the n with three prime factors. 2*A128278 are the n with four prime factors. 2*A128277 are the n with five prime factors. 2*A128276 lists the least n having k prime factors. - T. D. Noe, Nov 14 2010
Numbers n such that d + n/d is prime for every d|n. Then n+1 is a prime p = 2 or p == 3 (mod 4). - Thomas Ordowski, Apr 12 2013

Examples

			1 is the product of two positive integers in one way: 1 * 1. The sum of the multiplicands is 2, which is prime.
310 (2*5*31) is the product of two positive integers in 4 ways: 1 * 310, 2 * 155, 5 * 62 and 10 * 31. The sums of the pairs of multiplicands are 311, 157, 67 and 41, respectively; all are primes.
		

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. 844.

Crossrefs

Programs

  • Haskell
    a080715 n = a080715_list !! (n-1)
    a080715_list = 1 : filter (\x -> all ((== 1) . a010051) $
       zipWith (+) (a027750_row x) (reverse $ a027750_row x)) [2,4..]
    -- Reinhard Zumkeller, Apr 12 2012
    
  • Mathematica
    t={}; Do[ds=Divisors[n]; If[EvenQ[Length[ds]], ok=True; k=1; While[k<=Length[ds]/2 && (ok=PrimeQ[ds[[k]]+ds[[ -k]]]), k++ ]; If[ok, AppendTo[t,n]]], {n,2,4000}]; t (* T. D. Noe, Jun 06 2006 *)
    Select[Range[10^4], (d=Divisors[#]; And@@PrimeQ[d + # / d])&] (* Vincenzo Librandi, Jul 14 2017 *)
  • PARI
    is_ok(n)=fordiv(n,d,if(!isprime(d+n/d),return(0)));return(1);
    for(n=1,10^4,if(is_ok(n),print1(n,", "))); \\ Joerg Arndt, Jul 10 2014

A093669 Numbers having a unique representation as ab+ac+bc, with 0 < a < b < c.

Original entry on oeis.org

11, 14, 17, 19, 20, 27, 32, 34, 36, 43, 46, 49, 52, 64, 67, 73, 82, 97, 100, 142, 148, 163, 193
Offset: 1

Author

T. D. Noe, Apr 08 2004

Keywords

Comments

Are there more terms?
No more terms < 10^6. - Joerg Arndt, Oct 01 2017

Examples

			11 is on the list because 11 = 1*2+1*3+2*3.
		

References

Crossrefs

Cf. A000926 (numbers not of the form ab+ac+bc, 0

Programs

  • Mathematica
    oneSol={}; Do[lim=Ceiling[(n-2)/3]; cnt=0; Do[If[n>a*b && Mod[n-a*b, a+b]==0 && Quotient[n-a*b, a+b]>b, cnt++; If[cnt>1, Break[]]], {a, 1, lim-1}, {b, a+1, lim}]; If[cnt==1, AppendTo[oneSol, n]], {n, 10000}]; oneSol
  • Python
    from collections import Counter
    def aupto(N):
        acount = Counter()
        for i in range(1, N-1):
            for j in range(i+1, N//i + 1):
                p, s = i*j, i+j
                for k in range(j+1, (N-p)//s + 1):
                    acount.update([p + s*k])
        return sorted([k for k in acount if acount[k] == 1])
    print(aupto(10**5)) # Michael S. Branicky, Nov 14 2021

A025060 Numbers of the form i*j + j*k + k*i, where 1 <= i < j < k.

Original entry on oeis.org

11, 14, 17, 19, 20, 23, 26, 27, 29, 31, 32, 34, 35, 36, 38, 39, 41, 43, 44, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 89, 90, 91, 92, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 106, 107, 108, 109
Offset: 1

Keywords

Comments

A025058 without duplicates.
Non-Idoneal Numbers. [Artur Jasinski, Oct 27 2008]
Conjecture: If i, j and k are allowed to be negative, but not zero, and are still distinct, then the sequence is all the integers. - Jon Perry, Apr 21 2013

Crossrefs

Cf. A000926 (complement), A025058, A093669.

Programs

  • Maple
    N:= 200: # to get all terms <= N
    sort(convert({seq(seq(seq(i*j + j*k + i*k, i=1..min(j-1, (N-j*k)/(j+k))),j=2..min(k-1,(N-k)/(1+k))),k=3..(N-2)/3)},list)); # Robert Israel, Sep 06 2016
  • Mathematica
    aa = {}; Do[Do[Do[k = a b + b c + c a; AppendTo[aa, a b + b c + c a], {a, 1, b - 1}], {b, 2, c - 1}], {c, 3, 10}]; Union[aa] (* Artur Jasinski, Oct 27 2008 *)
  • Python
    def aupto(N):
        aset = set()
        for i in range(1, N-1):
            for j in range(i+1, N//i + 1):
                p, s = i*j, i+j
                for k in range(j+1, (N-p)//s + 1):
                    aset.add(p + s*k)
        return sorted(aset)
    print(aupto(109)) # Michael S. Branicky, Nov 14 2021

A003171 Negated discriminants of orders of imaginary quadratic fields with 1 class per genus (a finite sequence).

Original entry on oeis.org

3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 24, 27, 28, 32, 35, 36, 40, 43, 48, 51, 52, 60, 64, 67, 72, 75, 84, 88, 91, 96, 99, 100, 112, 115, 120, 123, 132, 147, 148, 160, 163, 168, 180, 187, 192, 195, 228, 232, 235, 240, 267, 280, 288, 312, 315, 340, 352, 372, 403
Offset: 1

Keywords

Comments

It is conjectured that a(101) = 7392 is the last term. If it would exist, a(102) > 10^6. - Hugo Pfoertner, Dec 01 2019

References

  • Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966, pp. 425-430.
  • L. E. Dickson, Introduction to the Theory of Numbers. Dover, NY, 1957, p. 85.
  • 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).

Crossrefs

The fundamental terms are given in A003644.

Programs

  • PARI
    ok(n)={(-n)%4<2 && !#select(k->k<>2, quadclassunit(-n).cyc)} \\ Andrew Howroyd, Jul 20 2018

Extensions

Terms a(44) and beyond from Andrew Howroyd, Jul 20 2018

A065428 Numbers k such that no x^2 mod k is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 12, 15, 16, 24, 28, 40, 48, 56, 60, 72, 88, 112, 120, 168, 232, 240, 280, 312, 408, 520, 760, 840, 1320, 1848
Offset: 1

Author

Joerg Arndt, Nov 16 2001

Keywords

Comments

All numbers in this sequence except 56 are idoneal (A000926) - Joerg Arndt, Jul 13 2005
No more terms < 10^6. - T. D. Noe, Aug 10 2007
No more terms < 10^11. - Charles R Greathouse IV, Dec 15 2008
Numbers x such that all x^3 mod k are nonprimes are 1, 2, 7, 9, 63, and apparently no more.

Crossrefs

Cf. A179402 (x^4 mod n).
Cf. A214583 (n such that for all k with gcd(n, k) = 1 and n > k^2, n - k^2 is prime).

Programs

  • Haskell
    a065428 n = a065428_list !! (n-1)
    a065428_list = filter f [1..] where
       f x = all (== 0) $
             map (a010051' . (`mod` x) . a000290) [a000196 x .. x-1]
    -- Reinhard Zumkeller, Aug 01 2012, Aug 15 2011
    
  • Mathematica
    t={}; Do[s=Union[Mod[Range[n]^2,n]]; If[Select[s,PrimeQ]=={}, AppendTo[t,n]], {n,1000}]; t  (* T. D. Noe, Aug 10 2007 *)
    nx2pQ[n_]:=Module[{m=PowerMod[Range[3n],2,n]},Count[ FindTransientRepeat[ m,2][[2]], ?PrimeQ]==0]; Select[Range[2000],nx2pQ] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Jun 11 2019 *)
  • PARI
    for(n=1, 10^9, q=1; for(x=1, n-1, if(isprime(lift(Mod(x,n)^2)), q=0; break())); if(q, print1(n, ", "))); \\ edited, Joerg Arndt, Jan 28 2015
    
  • Python
    from sympy import isprime
    def ok(n): return not any(isprime((x**2)%n) for x in range(2, n))
    print(list(filter(ok, range(1, 2000)))) # Michael S. Branicky, May 08 2021

A232550 Number of distinct primitive quadratic forms of discriminant = -4n that exist such that every prime p for which p is a quadratic residue (mod 4n) or p-n is a quadratic residue (mod 4n) can be represented by one of them.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 5, 1, 2, 3, 2, 2, 2, 2, 2, 3, 2, 1, 4, 1, 2, 3, 2, 2, 2, 1, 3, 2, 2, 2, 5, 2, 1, 3, 2, 1, 4, 2, 2, 2, 1, 3, 3, 2, 2, 3, 2, 2
Offset: 1

Author

V. Raman, Nov 26 2013

Keywords

Comments

A quadratic form is primitive if the GCD of the coefficients is 1. For example, the quadratic form 2*x^2+4*y^2 is not primitive.
Two quadratic forms f(x,y) = a*x^2+b*x*y+c*y^2 and g(x,y) = p*x^2+q*x*y+r*y^2 are distinct (or inequivalent) if and only if one cannot be obtained by a linear transformation (of the variables x, y) from the other. For example, the three quadratic forms u(x,y) = 3*x^2+2*x*y+3*y^2, v(x,y) = 3*x^2+4*x*y+4*y^2 and w(x,y) = 3*x^2+10*x*y+11*y^2 are equivalent because v(x,y) = u(x+y,-y) and w(x,y) = v(x+y,y). Also, w(x,y) = u(x+2*y,-y). Similarly, the two quadratic forms s(x,y) = 8*x^2+9*y^2 and t(x,y) = 17*x^2+50*x*y+41*y^2 are equivalent because t(x,y) = s(x+2*y,x+y).
The quadratic form x^2+n*y^2 is one such form and the only such form if n is a convenient number (A000926).
a(n) = 1 if and only if n is a convenient number (A000926).
Any prime p such that p is a quadratic residue (mod 4n) or p-n is a quadratic residue (mod 4n) can be represented by exactly one of the a(n) distinct primitive quadratic forms of discriminant = -4n in at most four different ways (if n >= 2) or in at most eight different ways (if n = 1).
If a prime p can be written in the form x^2+n*y^2, then either p is a quadratic residue (mod 4n) or p-n is a quadratic residue (mod 4n), assuming that p^2 does not divide n.
For primes p such that p is a quadratic residue (mod 4n) or p-n is a quadratic residue (mod 4n), there is a lowest square m^2 such that m^2*p can be written in form x^2+n*y^2, where x and y are nonnegative integers (see A232529 and A232530).
If n is a prime congruent to 3 (mod 4), then a(n) = A232551(n).
The product of two numbers (prime or composite, same or different) which can be represented by the same quadratic form of discriminant = -4n can be written in the form x^2+n*y^2, as the following identity shows.
(X*a^2+Y*a*b+Z*b^2)*(X*c^2+Y*c*d+Z*d^2) = (a*c*X+b*d*Z+a*d*(Y/2)+b*c*(Y/2))^2 + ((X*Z)-(Y^2/4))*(a*d-b*c)^2.
(X*a^2+Y*a*b+Z*b^2)*(X*c^2+Y*c*d+Z*d^2) = (a*c*X+b*d*((Y^2/(2*X))-Z)+a*d*(Y/2)+b*c*(Y/2))^2 + ((X*Z)-(Y^2/4))*(b*d*(Y/X)+a*d+b*c)^2.
Note that for the latter equation, (a*c*X+b*d*((Y^2/(2*X))-Z)+a*d*(Y/2)+b*c*(Y/2)) and (b*d*(Y/X)+a*d+b*c) need not always be integers. If they are both integers, then it will be a second representation of the product of (X*a^2+Y*a*b+Z*b^2) and (X*c^2+Y*c*d+Z*d^2) in the form x^2+((X*Z)-(Y^2/4))*y^2.

Examples

			If n is a convenient number (A000926), then the only such available quadratic form is x^2+n*y^2.
For n = 11, every prime that is congruent to {0, 1, 3, 4, 5, 9} mod 11 can be represented by either of the two distinct primitive quadratic forms of discriminant = -44: x^2+11*y^2 or 3*x^2+2*x*y+4*y^2.
For n = 14, every prime that is congruent to {1, 2, 7, 9, 15, 23, 25, 39} mod 56 can be represented by either of the two distinct primitive quadratic forms of discriminant = -56: x^2+14*y^2 or 2*x^2+7*y^2.
For n = 17, every prime that is congruent to {1, 2, 9, 13, 17, 21, 25, 33, 49, 53} mod 68 can be represented by either of the two distinct primitive quadratic forms of discriminant = -68: x^2+17*y^2 or 2*x^2+2*x*y+9*y^2.
For n = 19, every prime that is congruent to {0, 1, 4, 5, 6, 7, 9, 11, 16, 17} mod 19 can be represented by either of the two distinct primitive quadratic forms of discriminant = -76: x^2+19*y^2 or 4*x^2+2*x*y+5*y^2.
For n = 20, every prime that is congruent to {1, 5, 9} mod 20 can be represented by either of the two distinct primitive quadratic forms of discriminant = -80: x^2+20*y^2 or 4*x^2+5*y^2.
		

Crossrefs

Cf. A000003, A000926, A232529, A232530, A232551 (Number of distinct primitive quadratic forms of discriminant = -4*n needed to generate all primes p for which -n is a quadratic residue (mod p)).
Previous Showing 11-20 of 52 results. Next