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 24 results. Next

A057757 Least nonnegative square root of 2 mod n for n in A057126.

Original entry on oeis.org

0, 0, 3, 4, 6, 5, 8, 6, 17, 18, 7, 10, 8, 12, 32, 9, 24, 25, 40, 14, 10, 38, 51, 11, 16, 31, 12, 32, 46, 70, 18, 13, 64, 57, 52, 14, 20, 38, 39, 15, 62, 85, 74, 99, 22, 16, 60, 110, 96, 106, 132, 17, 45
Offset: 1

Views

Author

N. J. A. Sloane, Nov 01 2000

Keywords

Crossrefs

Cf. A057126.

Programs

  • Mathematica
    A057126 = Prepend[ Select[ Range[300], Reduce[ Mod[2 - k^2, #] == 0, k, Integers] =!= False &], 1]; a[n_] := Min[ r /. {ToRules[ Reduce[ Mod[r^2 - 2, A057126[[n]]] == 0, r, Integers] /. C[1] -> 0]}]; a[1] = 0; Table[a[n], {n, 1, 53}] (* Jean-François Alcover, Sep 20 2012 *)

Extensions

Corrected by T. D. Noe, Apr 19 2007 [The errors were caused by the faulty Maple command "mroot"]

A385449 Irregular triangle, read by rows: row n gives the pair of proper positive fundamental solutions (x, y) of the form x^2 - 2*y^2 representing -A057126(n).

Original entry on oeis.org

1, 1, 4, 3, 1, 2, 5, 4, 2, 3, 6, 5, 1, 3, 9, 7, 3, 4, 7, 6, 1, 4, 13, 10, 4, 5, 8, 7, 3, 5, 11, 9, 2, 5, 14, 11, 5, 6, 9, 8, 1, 5, 17, 13, 6, 7, 10, 9, 1, 6, 21, 16, 5, 7, 13, 11, 7, 8, 11, 10, 4, 7, 16, 13, 3, 7, 19, 15, 2, 7, 22, 17, 1, 7, 25, 19, 8, 9, 12, 11, 5, 8, 17, 14, 7, 9, 15, 13, 3, 8, 23, 18, 9, 10, 13, 12
Offset: 1

Views

Author

Wolfdieter Lang, Jul 11 2025

Keywords

Comments

The number of (x, y) pairs in row n is 1 for n = 1 and 2, and 2^P, with P = P1 + P7, where P1 and P7 are the number of prime factors 1 modulo 8 and 7 modulo 8, respectively, of A057126(n), for n >= 3.
See A057126 for comments concerning its representation by x^2 - 2*y^2.
The numbers A057126 are given by 2^e_2 * Product_{i=1..P1} p_{1,i}^e_{1,i} * Product_{j=1..P7} p_{7,j}^e_{7,j}, with the odd primes p_{1,i} and p_{7,j} congruent to 1 and 7 modulo 8, respectively. See A007519 and A007522 for these odd primes. Together with 2 these primes are given in A038873, and without 2 in A001132. The exponents are e_2 = 0 or 1, and e_{1,i} and e_{7,j} are nonnegative. The a(1) = 1 is obtained if all exponents vanish. For the proof see Lemma 18 of the linked W. Lang paper, pp. 22 - 23.
The general solutions are obtained from each fundamental solution by application of integer powers of the matrix Auto' = Mat([3,4], [2,3]). See the linked paper eq (28), p. 14, and eq. (40), p. 17 for D = 2, and k = A057126(n). For the explicit form of the powers of Auto' in terms of Chebyshev polynomials S(n, 6) = A001109(n+1) see there eq. (38), and Lemma 10, eq. (43), p. 17.
The conversion to the pair of proper solutions (X, Y) of X^2 - 2*Y^2 = A057126(n) is given by (X, Y) = (2*y - x, x - y). This may result in solutions with negative Y values. They are then transformed to the fundamental positive proper solutions via the mentioned matrix Auto'. See the right part of the example below. For this conversion see also the Nov 09 2009 comment in A035251 by Franklin T. Adams-Watters.

Examples

			n, A057126(n) /k  1  2   3  4 ...   2^P | (X, Y) = (2*y - x, x - y)
-------------------------------------------------------------------
1,  1           | 1  1               1  |  1   0 (3   2)
2,  2           | 4  3               1  |  2   1
3,  7           | 1  2,  5  4        2  |  3  -1 (5   3),  3  1
4, 14 = 2*7     | 2  3,  6  5        2  |  4  -1 (8   5),  4  1
5, 17           | 1  3,  9  7        2  |  5  -2 (7   4),  5  2
6, 23           | 3  4,  7  6        2  |  5  -1 (11  7),  5, 1
7, 31           | 1  4, 13 10        2  |  7  -3 (9   5),  7  3
8, 34 = 2*17    | 4  5,  8  7        2  |  6  -1 (14  9),  6  1
9, 41           | 3  5, 11  9        2  |  7  -2 (13  8),  7  2
10, 46 = 2*23   | 2  5, 14 11        2  |  8  -3 (12  7),  8  3
11, 47          | 5  6,  9  8        2  |  7  -1 (17 11),  7  1
12, 49 = 7^2    | 1  5, 17 13        2  |  9  -4 (11  6),  9  4
13, 62 = 2*31   | 6  7, 10  9        2  |  8  -1 (20 13),  8  1
14, 71          | 1  6, 21 16        2  | 11  -5 (13  7), 11  5
15, 73          | 5  7, 13 11        2  |  9  -2 (19 12),  9  2
16, 79          | 7  8, 11 10        2  |  9  -1 (23 15),  9  1
17, 82 = 2*41   | 4  7, 16 13        2  | 10  -3 (18 11), 10  3
18, 89          | 3  7, 19 15        2  | 11  -4 (17 10), 11  4
19, 94 = 2*47   | 2  7, 22 17        2  | 12  -5 (16  9), 12  5
20, 97          | 1  7, 25 19        2  | 13  -6 (15  8), 13  6
21, 98 = 2*7^2  | 8  9, 12 11        2  | 10  -1 (26 17), 10  1
...
The corresponding fundamental positive proper solutions of X^2 - 2*Y^2 = +119 are: [13 -5 (19 11), 13, 5] and [11 -1 (29 19), 11 1].
		

Crossrefs

A038873 Primes p such that 2 is a square mod p; or, primes congruent to {1, 2, 7} mod 8.

Original entry on oeis.org

2, 7, 17, 23, 31, 41, 47, 71, 73, 79, 89, 97, 103, 113, 127, 137, 151, 167, 191, 193, 199, 223, 233, 239, 241, 257, 263, 271, 281, 311, 313, 337, 353, 359, 367, 383, 401, 409, 431, 433, 439, 449, 457, 463, 479, 487, 503, 521, 569, 577, 593, 599, 601, 607, 617
Offset: 1

Views

Author

Keywords

Comments

Same as A001132 except for initial term.
Primes p such that x^2 = 2 has a solution mod p.
The primes of the form x^2 + 2xy - y^2 coincide with this sequence. These are also primes of the form u^2 - 2v^2. - Tito Piezas III, Dec 28 2008
Therefore these are composite in Z[sqrt(2)], as they can be factored as (u^2 - 2v^2)*(u^2 + 2v^2). - Alonso del Arte, Oct 03 2012
After a(1) = 2, these are the primes p such that p^4 == 1 (mod 96). - Gary Detlefs, Jan 22 2014
Also primes of the form 2v^2 - u^2. For example, 23 = 2*4^2 - 3^2. - Jerzy R Borysowicz, Oct 27 2015
Prime factors of A008865 and A028884. - Klaus Purath, Dec 07 2020

References

  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, Theorem 5-5, p. 68.

Crossrefs

Cf. A057126, A087780, A226523, A003629 (complement).
Primes in A035251.
For primes p such that x^m == 2 mod p has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...

Programs

  • Magma
    [ p: p in PrimesUpTo(617) | IsSquare(R!2) where R:=ResidueClassRing(p) ]; // Klaus Brockhaus, Dec 02 2008
    
  • Maple
    seq(`if`(member(ithprime(n) mod 8, {1,2,7}),ithprime(n),NULL),n=1..113); # Nathaniel Johnston, Jun 26 2011
  • Mathematica
    fQ[n_] := MemberQ[{1, 2, 7}, Mod[n, 8]]; Select[ Prime[Range[114]], fQ] (* Robert G. Wilson v, Oct 18 2011 *)
  • PARI
    is(n)=isprime(n) && issquare(Mod(2,n)) \\ Charles R Greathouse IV, Apr 23 2015
    
  • PARI
    is(n)=abs(centerlift(Mod(n,8)))<3 && isprime(n) \\ Charles R Greathouse IV, Nov 14 2017

Formula

a(n) ~ 2n log n. - Charles R Greathouse IV, Nov 29 2016

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
    

A057128 Numbers n such that -3 is a square mod n.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 12, 13, 14, 19, 21, 26, 28, 31, 37, 38, 39, 42, 43, 49, 52, 57, 61, 62, 67, 73, 74, 76, 78, 79, 84, 86, 91, 93, 97, 98, 103, 109, 111, 114, 122, 124, 127, 129, 133, 134, 139, 146, 147, 148, 151, 156, 157, 158, 163, 169, 172, 181, 182, 183, 186, 193
Offset: 1

Views

Author

Henry Bottomley, Aug 10 2000

Keywords

Comments

The fact that there are no numbers in this sequence of the form 6k+5 leads to the result that all prime factors of central polygonal numbers (A002061 of the form n^2-n+1) are either 3 or of the form 6k+1. This in turn leads to there being an infinite number of primes of the form 6k+1, since if P=product[all known primes of form 6k+1] then all the prime factors of 9P^2-3P+1 must be unknown primes of form 6k+1.
Numbers that are not multiples of 8 or 9 and for which all prime factors greater than 3 are congruent to 1 mod 6. - Eric M. Schmidt, Apr 21 2013
Numbers that divide at least some member of A117950. - Robert Israel, Feb 19 2016

Examples

			a(7)=13 since -3 mod 13=10 mod 13=6^2 mod 13.
		

Crossrefs

Includes the primes in A045331 and these (primes congruent to {1, 2, 3} mod 6) are the prime factors of the terms in this sequence. Cf. A008784, A057125, A057126, A057127, A057129.
Cf. A117950.

Programs

  • Maple
    select(t -> numtheory:-quadres(-3,t) = 1, {$1..1000}); # Robert Israel, Feb 19 2016
  • Mathematica
    Select[Range[200], IntegerQ[PowerMod[-3, 1/2, #]]&] // Quiet (* Jean-François Alcover, Mar 05 2019 *)
  • PARI
    isok(n) = issquare(Mod(-3,n)); \\ Michel Marcus, Feb 19 2016
  • Sage
    def A057128(n) :
        if n%8==0 or n%9==0: return False
        for (p, m) in factor(n) :
            if p % 6 not in [1, 2, 3] : return False
            return True
    # 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

A057762 Numbers k such that 5 is a square mod k.

Original entry on oeis.org

1, 2, 4, 5, 10, 11, 19, 20, 22, 29, 31, 38, 41, 44, 55, 58, 59, 61, 62, 71, 76, 79, 82, 89, 95, 101, 109, 110, 116, 118, 121, 122, 124, 131, 139, 142, 145, 149, 151, 155, 158, 164, 178, 179, 181, 190, 191, 199, 202, 205, 209, 211, 218, 220, 229
Offset: 1

Views

Author

N. J. A. Sloane, Nov 01 2000

Keywords

Comments

Numbers not divisible by 3, 8, or 25 and whose prime factors > 5 are congruent to +/- 1 mod 5. - Eric M. Schmidt, Jan 24 2014

Crossrefs

Programs

  • Maple
    with(numtheory); [seq(mroot(5,2,p),p=1..400)];
  • Mathematica
    Prepend[ Select[ Range[300], Reduce[ Mod[5 - k^2, #] == 0, k, Integers] =!= False &], 1] (* Jean-François Alcover, Sep 20 2012 *)
    Join[{1, 2, 4, 5}, Select[Range[6, 300], MemberQ[Mod[Range[#]^2, #], 5] &]] (* T. D. Noe, Sep 20 2012 *)

A175035 Offsets i such that i + n*(n+1)/2 is a perfect square for some positive integer n.

Original entry on oeis.org

1, 3, 4, 6, 8, 9, 10, 13, 15, 16, 19, 21, 22, 24, 25, 26, 28, 30, 33, 34, 35, 36, 39, 43, 45, 46, 48, 49, 53, 54, 55, 58, 60, 61, 63, 64, 66, 71, 72, 75, 76, 78, 79, 80, 81, 85, 89, 90, 91, 93, 94, 97, 99, 100, 103, 105, 106, 108, 111, 114, 115, 116, 118, 120
Offset: 1

Views

Author

Ctibor O. Zizka, Nov 10 2009

Keywords

Comments

The ansatz n*(n+1)/2+i=s^2 can be transformed into (2*n+1)^2-2*(2*s)^2 =1-8*i.
A necessary condition for solutions to this Diophantine equation is that D=2 is a quadratic residue of the squarefree part of 8*i-1 (see A057126).
A sufficient condition is then available by a sequence of tests on the continued fractions of a quadratic surd that originates from a solution of this congruence.
See Mollin and Matthews for details. - R. J. Mathar, Nov 16 2009

Crossrefs

Programs

  • Mathematica
    Take[Rest[Ceiling[Sqrt[#]]^2-#&/@Accumulate[Range[1000]]//Union],70] (* Harvey P. Dale, Sep 07 2019 *)
  • PARI
    is(n)=#bnfisintnorm(bnfinit(z^2-8),-8*n+1) /* Ralf Stephan, Oct 14 2013 */

Extensions

Extended by R. J. Mathar, Nov 26 2009

A164131 Numbers k such that k^2 == 2 (mod 31).

Original entry on oeis.org

8, 23, 39, 54, 70, 85, 101, 116, 132, 147, 163, 178, 194, 209, 225, 240, 256, 271, 287, 302, 318, 333, 349, 364, 380, 395, 411, 426, 442, 457, 473, 488, 504, 519, 535, 550, 566, 581, 597, 612, 628, 643, 659, 674, 690, 705, 721, 736, 752, 767, 783, 798, 814
Offset: 1

Views

Author

Vincenzo Librandi, Aug 11 2009

Keywords

Comments

Sequences of the type n^2 == 2 (mod m) are basically defined for each m of A057126. See A047341 (m=7), A113804 (m=14), A155449 (m=17), A155450 (m=23), A158803 (m=41) etc. - R. J. Mathar, Aug 26 2009

Examples

			At n= 4, a(4)=(31-1+186)/4=54. At n=5, a(5)=(31+1+248)/4=70.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[850],Mod[#^2,31]==2&]  (* Harvey P. Dale, Feb 04 2011 *)
  • PARI
    isok(k) = Mod(k, 31)^2 == 2; \\ Michel Marcus, Nov 22 2022

Formula

a(n) = a(n-1)+a(n-2)-a(n-3).
a(n) = (31+(-1)^(n-1)+62(n-1))/4.
G.f.: x*(8+15*x+8*x^2)/((1+x)*(x-1)^2). - R. J. Mathar, Aug 26 2009
a(n) = 31*(n-1)-a(n-1) with n>1, a(1)=8. - Vincenzo Librandi, Nov 30 2010
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(15*Pi/62)*Pi/31. - Amiram Eldar, Feb 28 2023

Extensions

Entries checked by R. J. Mathar, Aug 26 2009
Showing 1-10 of 24 results. Next