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

A057126 Numbers k such that 2 is a square mod k.

Original entry on oeis.org

1, 2, 7, 14, 17, 23, 31, 34, 41, 46, 47, 49, 62, 71, 73, 79, 82, 89, 94, 97, 98, 103, 113, 119, 127, 137, 142, 146, 151, 158, 161, 167, 178, 191, 193, 194, 199, 206, 217, 223, 226, 233, 238, 239, 241, 254, 257, 263, 271, 274, 281, 287, 289, 302, 311, 313, 322
Offset: 1

Views

Author

Henry Bottomley, Aug 10 2000

Keywords

Comments

Numbers that are not multiples of 4 and for which all odd prime factors are congruent to +/- 1 mod 8. - Eric M. Schmidt, Apr 20 2013
Apparently the same as the list of numbers primitively represented by the indefinite quadratic form x^2 - 2y^2 (cf. A035251). - N. J. A. Sloane, Jun 11 2014
From Wolfdieter Lang, Jul 11 2025: (Start)
Also the negative sequence lists the numbers properly represented by the indefinite quadratic form x^2 - 2*y^2 of discriminant 4*2 = 8. For the proof see the W. Lang paper linked in A385449, Lemma 18, pp. 22-23.
The connection between the proper positive fundamental solutions (X, Y) of X^2 - 2*Y^2 = -a(n), given in A385449, and the solutions (x, y) of x^2 - 2*y^2 = a(n) is (x, y) = (2*Y - X, X - Y). If y becomes nonpositive a transformation with the matrix Mat([3,4], [2,3]) will give the positive proper fundamental solution. See the example section of A385449. See also the Nov 09 2009 comment in A035251 by Franklin T. Adams-Watters for this connection, and for the matrix eq. (38) p. 14 of the mentioned linked paper.
Therefore the previous statement on the representation of a(n) is true.(End)

Crossrefs

Includes the primes in A038873 and these (primes congruent to {1, 2, 7} mod 8) are the prime factors of the terms in this sequence.
Cf. A087780 (number of solutions mod n).

Programs

  • Maple
    with(numtheory); [seq(mroot(2,2,p),p=1..300)];
  • Mathematica
    ok[n_] := Reduce[ Mod[2 - k^2, n] == 0, k, Integers] =!= False; Prepend[ Select[ Range[400], ok], 1] (* Jean-François Alcover, Sep 20 2012 *)
  • PARI
    isok(n) = issquare(Mod(2,n)); \\ Michel Marcus, Feb 19 2016

Extensions

Checked by T. D. Noe, Apr 19 2007

A045331 Primes congruent to {1, 2, 3} mod 6; or, -3 is a square mod p.

Original entry on oeis.org

2, 3, 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103, 109, 127, 139, 151, 157, 163, 181, 193, 199, 211, 223, 229, 241, 271, 277, 283, 307, 313, 331, 337, 349, 367, 373, 379, 397, 409, 421, 433, 439, 457, 463, 487, 499, 523, 541, 547, 571, 577, 601, 607, 613
Offset: 1

Views

Author

Keywords

Comments

-3 is a quadratic residue mod a prime p iff p is in this sequence.

Crossrefs

Apart from initial term, same as A007645; apart from initial two terms, same as A002476.
Subsequence of A047246.

Programs

  • Haskell
    a045331 n = a045331_list !! (n-1)
    a045331_list = filter ((< 4) . (`mod` 6)) a000040_list
    -- Reinhard Zumkeller, Jan 15 2013
  • Magma
    [p: p in PrimesUpTo(700) | p mod 6 in [1, 2, 3]]; // Vincenzo Librandi, Aug 08 2012
    
  • Mathematica
    Select[Prime[Range[200]],MemberQ[{1,2,3},Mod[#,6]]&]  (* Harvey P. Dale, Mar 31 2011 *)
    Join[{2,3},Select[Range[7,10^3,6],PrimeQ]] (* Zak Seidov, May 20 2011 *)
  • PARI
    select(n->n%6<5,primes(100)) \\ Charles R Greathouse IV, May 20 2011
    

Extensions

More terms from Henry Bottomley, Aug 10 2000

A057125 Numbers n such that 3 is a square mod n.

Original entry on oeis.org

1, 2, 3, 6, 11, 13, 22, 23, 26, 33, 37, 39, 46, 47, 59, 61, 66, 69, 71, 73, 74, 78, 83, 94, 97, 107, 109, 111, 118, 121, 122, 131, 138, 141, 142, 143, 146, 157, 166, 167, 169, 177, 179, 181, 183, 191, 193, 194, 213, 214, 218, 219, 222, 227, 229, 239, 241, 242
Offset: 1

Views

Author

Henry Bottomley, Aug 10 2000

Keywords

Comments

Numbers that are not multiples of 4 or 9 and for which all prime factors greater than 3 are congruent to +/- 1 mod 12. - Eric M. Schmidt, Apr 21 2013

Examples

			3^2==3 (mod 6), so 6 is a member.
		

Crossrefs

Includes the primes in A038874 and these (primes congruent to {1, 2, 3, 11} mod 12) are the prime factors of the terms in this sequence. Cf. A008784, A057126, A057127, A057128, A057129.
Cf. A057759.

Programs

  • Magma
    [n: n in [1..300] | exists(t){x : x in ResidueClassRing(n) | x^2 eq 3}]; // Vincenzo Librandi, Feb 20 2016
  • Maple
    # Beware: Since 2007 at least and up to Maple 16 at least, the following Maple code returns the wrong answer for n = 6:
    with(numtheory): [seq(`if`(mroot(3,2,n)=FAIL,NULL,n), n=1..400)];
    # second Maple program:
    with(numtheory): mroot(3, 2, 6):=3:
    a:= proc(n) option remember; local m;
          for m from 1+`if`(n=1, 0, a(n-1))
          while mroot(3, 2, m)=FAIL do od; m
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Feb 24 2017
  • Mathematica
    Prepend[ Select[ Range[300], Reduce[Mod[3 - k^2, #] == 0, k, Integers] =!= False &], 1]  (* Jean-François Alcover, Sep 20 2012 *)
  • PARI
    isok(n) = issquare(Mod(3,n)); \\ Michel Marcus, Feb 19 2016
    

Extensions

Edited by N. J. A. Sloane, Oct 25 2008 at the suggestion of R. J. Mathar.

A057127 -2 is a square mod n.

Original entry on oeis.org

1, 2, 3, 6, 9, 11, 17, 18, 19, 22, 27, 33, 34, 38, 41, 43, 51, 54, 57, 59, 66, 67, 73, 81, 82, 83, 86, 89, 97, 99, 102, 107, 113, 114, 118, 121, 123, 129, 131, 134, 137, 139, 146, 153, 162, 163, 166, 171, 177, 178, 179, 187, 193, 194, 198, 201, 209, 211, 214, 219
Offset: 1

Views

Author

Henry Bottomley, Aug 10 2000

Keywords

Comments

Includes the primes in A033203 and these (primes congruent to {1, 2, 3} mod 8) are the prime factors of the terms in this sequence.
Numbers that are not multiples of 4 and for which all odd prime factors are congruent to {1, 3} mod 8. - Eric M. Schmidt, Apr 21 2013
Positive integers primitively represented by x^2 + 2y^2. - Ray Chandler, Jul 22 2014
The set of the divisors of numbers of the form k^2+2. - Michel Lagneau, Jun 28 2015
The number of proper solutions (x, y) with nonnegative x of the positive definite primitive quadratic form x^2 + 2*y*2 (discriminant -8) representing a(n) is 1 for n = 1 and for n >= 2 it is 2^(P_1 + P_3), where P_1 and P_3 are the number of distinct prime divisors of a(n) congruent to 1 and 3 modulo 8, respectively. See the above comments on A033203 and this binary form. - Wolfdieter Lang, Feb 25 2021

Examples

			Binary quadratic form x^2 + 2*y^2 representing a(n), with x >= 0: a(1) = 1: one solution (x, y) = (1,0); a(2) = 2: one solution (0,1); a(3) = 3: two solutions (1, pm 1), with pm = +1 or -1; a(5) = 9 = 3^2: two solutions (1, pm 2); a(12) = 33 = 3*11: 4 solutions (1, pm 4) and (5, pm 2); a(137) = 3*11*17 = 561: eight solutions (7, pm 16), (13, pm 14), (19, pm 10) and (23, pm 4). - _Wolfdieter Lang_, Feb 25 2021
		

Crossrefs

Programs

  • Maple
    select(n -> numtheory:-msqrt(-2,n) <> FAIL, [$1..1000]); # Robert Israel, Jun 29 2015
  • Mathematica
    Select[Range[300], IntegerQ[PowerMod[-2, 1/2, #]]&] // Quiet (* Jean-François Alcover, Mar 04 2019 *)
  • PARI
    isok(n) = issquare(Mod(-2, n)); \\ Michel Marcus, Jun 28 2015
  • Sage
    def isA057127(n):
        if n % 4 == 0: return False
        return all(p % 8 in [1, 2, 3] for p, _ in factor(n))
    [n for n in range(1, 300) if isA057127(n)]
    # Eric M. Schmidt, Apr 21 2013
    

A057129 -4 is a square mod n.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 13, 17, 20, 25, 26, 29, 34, 37, 40, 41, 50, 52, 53, 58, 61, 65, 68, 73, 74, 82, 85, 89, 97, 100, 101, 104, 106, 109, 113, 116, 122, 125, 130, 136, 137, 145, 146, 148, 149, 157, 164, 169, 170, 173, 178, 181, 185, 193, 194, 197, 200, 202, 205, 212
Offset: 1

Views

Author

Henry Bottomley, Aug 10 2000

Keywords

Comments

Numbers that are not multiples of 16 and for which all odd prime factors are congruent to 1 mod 4. - Eric M. Schmidt, Apr 21 2013

Crossrefs

Includes the primes in A002313 and these (primes congruent to {1, 2} mod 4) are the prime factors of the terms in this sequence. Cf. A008784, A057125, A057126, A057127, A057128.

Programs

  • Mathematica
    Select[Range[100], IntegerQ[PowerMod[-4, 1/2, #]] &] // Quiet (* After Jean-François Alcover *) (* Robert Price, Apr 19 2025 *)
  • Sage
    def A057129(n) :
        if n%16==0: return False
        for (p, m) in factor(n) :
            if p % 4 not in [1, 2] : return False
        return True
    # Eric M. Schmidt, Apr 21 2013

A318527 Numbers k such that -3 is a quadratic residue (not necessarily coprime) modulo k, k + 1, k + 2 and k + 3.

Original entry on oeis.org

1, 721, 4681, 6121, 6481, 7201, 7561, 9001, 11161, 14401, 16921, 18361, 19441, 20521, 24481, 24841, 27361, 29881, 32761, 36721, 39241, 39601, 42121, 42841, 43201, 47161, 47521, 48241, 49681, 51121, 52201, 53641, 60481, 61561, 62641, 63361, 64441, 65521, 65881, 68041, 73441, 73801, 74521, 74881, 75961, 76321, 78481, 82441, 82801, 84241, 88201, 91081, 94681
Offset: 1

Views

Author

Jianing Song, Aug 30 2018

Keywords

Comments

Start of 4 consecutive terms in A057128. Note that there are no 5 consecutive terms there.
Two interesting properties:
(a) All terms are congruent to 1 mod 360.
Proof: since -3 is not a quadratic residue modulo any prime == 5 (mod 6) we have k == 1 (mod 5) and k == 0 or 1 (mod 6). If k is even, then k == 6 (mod 30). -3 is not a quadratic residue modulo 9 so k == 3 (mod 9), then k == 66 (mod 90), k + 3 = 90*t + 69 = 3*(30*t + 23) but 30*t + 23 == 5 (mod 6), so -3 is not a quadratic residue modulo 30*t + 23, a contradiction. Thus k must be odd, then k == 1 (mod 30). For the same reason k == 1 or 4 (mod 9). If k == 4 (mod 9), then k == 31 (mod 90), k + 2 = 90*t + 33 = 3*(30t + 11) but 30*t + 11 == 5 (mod 6), a contradiction. So k == 1 (mod 9), then k == 1 (mod 90). If k == 91 (mod 180), then k + 3 = 180*t + 94 = 2*(90*t + 47) but 90*t + 47 == 5 (mod 6), a contradiction. So k == 1 (mod 180). -3 is not a quadratic residue modulo 8 so k == 1, 2, 3 or 4 (mod 8), thus k == 1 (mod 360) which is what we wanted.
(b) k is a term iff -3 is a quadratic residue modulo k*(k + 1)*(k + 2)*(k + 3)/2.
Proof: "<=" is obvious, since k*(k + 1)*(k + 2)*(k + 3)/2 is multiple of k, k + 1, k + 2 and k + 3. "=>": Note that -3 is a quadratic residue modulo lcm(k, k + 1, k + 2, k + 3). Now we show that lcm(k, k + 1, k + 2, k + 3) = k*(k + 1)*(k + 2)*(k + 3)/2. If not, then k is a multiple of 3, but by (a) we have k == 1 (mod 3), a contradiction.

Examples

			721 is a term since 93^2 == -3 (mod 721), 137^2 == -3 (mod 722), 210^2 == -3 (mod 723) and 97^2 == -3 (mod 724).
		

Crossrefs

Cf. A057128.
Cf. A305864 (start of 3 consecutive terms in A057128), A318911.

Programs

Formula

a(n) = 360*A318911(n) + 1.

A305864 Numbers k such that -3 is a quadratic residue (not necessarily coprime) modulo k, k + 1 and k + 2.

Original entry on oeis.org

1, 2, 12, 37, 146, 156, 181, 217, 397, 541, 721, 722, 732, 876, 937, 1082, 1092, 1117, 1226, 1236, 1261, 1442, 1621, 1657, 1812, 1981, 2017, 2197, 2306, 2316, 2557, 2676, 2917, 3061, 3097, 3252, 3396, 3457, 3601, 3612, 3746, 3781, 3962, 3997, 4106, 4177, 4357, 4501
Offset: 1

Views

Author

Jianing Song, Aug 06 2018

Keywords

Comments

Start of 3 consecutive terms in A057128. All terms are congruent to {1, 2} mod 5 and {0, 1, 2} mod 6.
If k is a term of this sequence then -3 is a quadratic residue modulo k*(k + 1)*(k + 2)/2, but the converse is not true if k, (k + 1)/2 and k + 2 are terms in A057128 and k == 7 (mod 16) (k = 487, 631, 2071, ...).

Examples

			12 is a term since 3^2 == -3 (mod 12), 6^2 == -3 (mod 13) and 5^2 == -3 (mod 14).
		

Crossrefs

Cf. A057128.
Cf. A318527 (start of 4 consecutive terms in A057128).

Programs

Showing 1-7 of 7 results.