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

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.

A020893 Squarefree sums of two squares; or squarefree numbers with no prime factors of the form 4k+3.

Original entry on oeis.org

1, 2, 5, 10, 13, 17, 26, 29, 34, 37, 41, 53, 58, 61, 65, 73, 74, 82, 85, 89, 97, 101, 106, 109, 113, 122, 130, 137, 145, 146, 149, 157, 170, 173, 178, 181, 185, 193, 194, 197, 202, 205, 218, 221, 226, 229, 233, 241, 257, 265, 269, 274, 277, 281, 290, 293, 298, 305, 313, 314, 317, 337, 346, 349
Offset: 1

Views

Author

Keywords

Comments

Primitively but not imprimitively represented by x^2 + y^2.
The disjoint union of {1}, A003654, and A031398. - Max Alekseyev, Mar 09 2010
Squarefree members of A202057. - Artur Jasinski, Dec 10 2011
Union of A231754 and 2*A231754. Squarefree numbers whose prime factors are in A002313. - Robert Israel, Aug 23 2017
It appears that a(n) is the n-th index, k, such that f(k) = 2, where f(k) = 3*(Sum_{i=1..k} floor(i^2/k)) - k^2 (see A175908). - John W. Layman, May 16 2011

References

  • Srinivasa Ramanujan, The Lost Notebook and Other Unpublished Papers, Narosa Publishing House, New Delhi, 1988; see page 123.

Crossrefs

Programs

  • Haskell
    a020893 n = a020893_list !! (n-1)
    a020893_list = filter (\x -> any (== 1) $ map (a010052 . (x -)) $
                                 takeWhile (<= x) a000290_list) a005117_list
    -- Reinhard Zumkeller, May 28 2015
    
  • Maple
    N:= 1000: # to get all terms <= N
    R:= {1,2}:
    p:= 2:
    do
    p:= nextprime(p);
    if p > N then break fi;
    if p mod 4 <> 1 then next fi;
    R:= R union select(`<=`,map(`*`,R,p),N);
    od:
    sort(convert(R,list)); # Robert Israel, Aug 23 2017
  • Mathematica
    lim = 17; t = Join[{1}, Select[Union[Flatten[Table[x^2 + y^2, {x, lim}, {y, x}]]], # < lim^2 && SquareFreeQ[#] &]]
    Select[Union[Total/@Tuples[Range[0,20]^2,2]],SquareFreeQ] (* Harvey P. Dale, Jul 26 2017 *)
    Block[{nn = 350, p}, p = {1, 2}~Join~Select[Prime@ Range@ PrimePi@ nn, Mod[#, 4] == 1 &]; Select[Range@ nn, And[SquareFreeQ@ #, SubsetQ[p, FactorInteger[#][[All, 1]]]] &]] (* Michael De Vlieger, Aug 23 2017 *)
    (* or *)
    Select[Range[350], SquareFreeQ@ # && ! MemberQ[Mod[First /@ FactorInteger@ #, 4], 3] &] (* Giovanni Resta, Aug 25 2017 *)
  • PARI
    is(n)=my(f=factor(n)); for(i=1,#f~,if(f[i,2]>1 || f[i,1]%4==3, return(0))); 1 \\ Charles R Greathouse IV, Apr 20 2015
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A020893_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 and e == 1 for p, e in factorint(n).items()),count(1))
    A020893_list = list(islice(A020893_gen(),30)) # Chai Wah Wu, Jun 28 2022

Formula

a(n) ~ k*n*sqrt(log n), where k = 2.1524249... = A013661/A064533. - Charles R Greathouse IV, Apr 20 2015

Extensions

Edited by N. J. A. Sloane, Aug 30 2017

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
    

A145047 Primes p of the form 4k+1 for which s=10 is the least positive integer such that sp-(floor(sqrt(sp)))^2 is a square.

Original entry on oeis.org

1237, 1621, 1721, 1933, 1949, 1993, 2221, 2237, 2309, 2341, 2473, 2621, 2657, 2789, 2797, 2857, 2953, 3221, 3361, 3533, 3677, 3881, 3889, 3917, 4133, 4457, 4481, 4549, 4813, 4889, 4973, 5153, 5189, 5261, 5441, 5653, 5717, 5813, 6101, 6217, 6301, 6329
Offset: 1

Views

Author

Vladimir Shevelev, Sep 30 2008, Oct 05 2008

Keywords

Comments

Conjecture: The least positive integer s can take values only from A008784 (see for s=1,2,5,10 sequences A145016, A145022, A145023 and this sequence).

Examples

			a(1)=1237 since p=1237 is the least prime of the form 4k+1 for which sp-(floor(sqrt(sp)))^2 is not a square for s=1..9, but 10p-(floor(sqrt(10p)))^2 is a square (for p=1237 it is 49).
		

Crossrefs

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

A193138 Number of square satins of order n.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 3

Views

Author

N. J. A. Sloane, Jul 16 2011

Keywords

Comments

a(n) = A157228(n) for all entries known. - R. J. Mathar, Aug 10 2011
This sequence is conjectured to coincide with the multiplicities of the representation of n >= 3 as primitive sums of two squares. Neither the order of the squares nor the signs of the numbers to be squared are taken into account. a(n) = 0 if no such representation exists. Checked for n = 3,4, ..., 1000 (using the program below). The two squares are in each case nonzero and distinct. If one includes also 0 as a square in the primitive sum of two squares one could take a(0) = 0, a(1) = 1, a(2) = 1. If only nonzero squares are considered, then one could take a(0) = 0, a(1) = 0, a(2) = 1.
For the numbers n with a(n) > 0 (in this conjectured interpretation of a(n)) see A008784. - Wolfdieter Lang, Apr 17 2013
The stated conjecture is true because it follows immediately from Theorem 3.22, p. 165, of the Niven-Zuckerman-Montgomery reference. There r(n) gives the number of primitive solutions of n = x^2 + y^2 with ordered and signed pairs of integers x,y. Because x and y are distinct if n >= 3 one needs here a(n) = r(n)/2^3. This then coincides with the formula for u(n) given in the Grünbaum-Shephard Theorem 5. - Wolfdieter Lang, Apr 18 2013
The equality noted by R. J. Mathar above indeed holds for all n > 2. Regarding n = 2 case: if we consider periodic twills as satins (which seems more consistent), we'll get a(2) = 1 from the plain weave; otherwise (following Grünbaum and Shephard), a(1) = a(2) = 0 (so we get A157228). In the former case, the all-black pattern can formally be counted as a(1) = 1, but physically it is dubious (this pattern corresponds to unweaved warp and weft). - Andrey Zabolotskiy, May 09 2018

Examples

			Primitive sums of two squares stated as a comment above: a(3) = 0  because 3 is not a sum of two squares.  a(5) = 1 because 5 = 1^2 + 2^2, denoted by the unique (primitive) doublet [1, 2].  a(65) = 2 from the two (primitive) doublets [1, 8] and [4, 7]. a(85) = 2 with the (primitive) doublets [2, 9] and  [6, 7]. a(8) = 0 because the doublet [2, 2] is imprimitive. - _Wolfdieter Lang_, Apr 18 2013
		

References

  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991.

Crossrefs

Programs

  • Maple
    U:=proc(n) local nop,p3,i,t1,t2,al,even;
    t1:=ifactors(n)[2];
    t2:=nops(t1);
    if (n mod 2) = 0 then even:=1; al:=t1[1][2]; else even:=0; al:=0; fi;
    nop:=t2-even;
    p3:=0;
    for i from 1 to t2 do if t1[i][1] mod 4 = 3 then p3:=1; fi; od:
    if (al >= 2) or (p3=1) then RETURN(0) else RETURN(2^(nop-1)); fi;
    end;
    [seq(U(n),n=3..120)];
  • Mathematica
    a[n_] := Select[ PowersRepresentations[n, 2, 2], GCD @@ # == 1 &] // Length; a[2] = 0; Table[a[n], {n, 3, 120}] (* Jean-François Alcover, Apr 18 2013 *)

Formula

Take the prime number factorization (symbolically) as n = 2^a*product(p^b)*product(q^c) with primes p == 1(mod 4) and primes q == 3(mod 4) and n>=3. If a = 0 or 1 and all c's vanish then a(n) = 2^(t-1) with t the number of distinct primes congruent 1(mod 4). Otherwise a(n) = 0. (See the Niven-Zuckerman-Montgomery reference, Theorem 3.22, p. 165, and the Grünbaum-Shephard Theorem 5 formula for u(n)). - Wolfdieter Lang, Apr 18 2013

A034023 Imprimitively represented by x^2+y^2.

Original entry on oeis.org

4, 8, 9, 16, 18, 20, 25, 32, 36, 40, 45, 49, 50, 52, 64, 68, 72, 80, 81, 90, 98, 100, 104, 116, 117, 121, 125, 128, 136, 144, 148, 153, 160, 162, 164, 169, 180, 196, 200, 208, 212, 225, 232, 234, 242, 244, 245, 250, 256, 260, 261, 272, 288, 289
Offset: 0

Views

Author

Keywords

Crossrefs

A192453 Numbers k such that -1 is a 4th power mod k.

Original entry on oeis.org

1, 2, 17, 34, 41, 73, 82, 89, 97, 113, 137, 146, 178, 193, 194, 226, 233, 241, 257, 274, 281, 289, 313, 337, 353, 386, 401, 409, 433, 449, 457, 466, 482, 514, 521, 562, 569, 577, 578, 593, 601, 617, 626, 641, 673, 674, 697, 706, 761, 769, 802, 809, 818, 857
Offset: 1

Views

Author

Keywords

Comments

Complement of A192452. Subsequence of A008784. A further reduction to 8th powers yields 1, 2, 17, 34, 97, 113, 193, 194, ...
From Jianing Song, Mar 31 2019: (Start)
k is a term if and only if k is not divisible by 4 and all odd prime factors are congruent to 1 modulo 8. If k is a term of this sequence, then so are all divisors of k.
Decompose the multiplicative group of integers modulo k as a product of cyclic groups C_{s_1} x C_{s_2} x ... x C_{s_m}, where s_i divides s_j for i < j, then k is a term iff s_1 is divisible by 8. For k = 1 or 2, (Z/kZ)* is the trivial group, s_1 does not exist so 1 and 2 are also terms. This is an analog of A008784 (where s_1 is divisible by 4) and A319100 (where s_1 is divisible by 6). (End)

Examples

			1^4 == -1 (mod 1). 2^4 == -1 (mod 17). 9^4 == -1 (mod 34). 3^4 == -1 (mod 41). 10^4 == -1 (mod 73).
		

Crossrefs

Programs

  • Maple
    select(n -> numtheory:-factorset(n) mod 8 subset {1,2}, [seq(seq(4*i+j,j=1..3),i=0..400)]); # Robert Israel, May 24 2019
  • Mathematica
    Table[If[Reduce[x^4==-1,Modulus->n]===False,Null,n],{n,2,1000}]//Union
  • PARI
    for(n=1,1e3,if(ispower(Mod(-1,n),4),print1(n", "))) \\ Charles R Greathouse IV, Jul 03 2011

A224450 Numbers that are the primitive sum of two nonzero squares in exactly one way.

Original entry on oeis.org

2, 5, 10, 13, 17, 25, 26, 29, 34, 37, 41, 50, 53, 58, 61, 73, 74, 82, 89, 97, 101, 106, 109, 113, 122, 125, 137, 146, 149, 157, 169, 173, 178, 181, 193, 194, 197, 202, 218, 226, 229, 233, 241, 250, 257, 269, 274, 277, 281, 289, 293, 298, 313, 314, 317, 337
Offset: 1

Views

Author

Wolfdieter Lang, Apr 17 2013

Keywords

Comments

If one includes 1 as the first entry then this sequence gives the numbers that are the primitive sum of two squares (square 0 allowed) in exactly one way, if neither the order of the squares nor the signs of the numbers to be squared matters.
Compare this sequence with A025284.
If 2 is omitted from this sequence then all members are primitively represented by two distinct nonzero squares in exactly one way.
The sequence A193138(n), n >= 3, gives the multiplicities of the primitive sums of two squares (automatically distinct and nonzero for n >= 3 if such a sum exists at all).
Numbers such that there is exactly one pair (m,k) where m + k = a(n), and m*k == 1 (mod a(n)), m > 0 and m <= k. - Torlach Rush, Oct 19 2020
A pair (s,t) such that s+t = a(n) and s*t == +1 (mod a(n)) as above is obtained from a square root of -1 (mod a(n)) for s and t = a(n)-s. - Joerg Arndt, Oct 24 2020

Examples

			a(1) = 2 because m = 2 is the first number with a unique doublet (a,b) in question, namely (1,1) (gcd(1,1) = 1).
This is the only case with equal entries a and b (the non-distinct case).
8 is not a member of this sequence (but of A025284) because the only representation is 2^2 +2^2 and (2,2) is not primitive. Similarly for 18, 20, ...
a(2) = 5 because 5 is the second smallest number satisfying the given requirements. 3 and 4 have no representation as sum of two nonzero squares, and the unique doublet for 5 is (1,2) (with distinct a and b).
		

Crossrefs

Cf. A025284, A008784 (primitive sums of two squares with square 0 included), A224770 (exactly 2 ways), A193138 (multiplicities).

Programs

  • Mathematica
    nn = 20; t = Sort[Select[Flatten[Table[If[GCD[a, b] == 1, a^2 + b^2, 0], {a, nn}, {b, a, nn}]], 0 < # <= nn^2 &]]; t2 = Transpose[Select[Tally[t], #[[2]] == 1 &]][[1]] (* T. D. Noe, Apr 20 2013 *)

Formula

This sequence gives the increasingly ordered numbers m which satisfy m = a^2 + b^2, with a and b integers, 0 < a <= b, gcd(a,b) = 1, and there is only one such representation, denoted by one doublet (a,b).
Previous Showing 11-20 of 45 results. Next