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

A128106 Sizes of possible gaps around a Gaussian prime: 1 and the even numbers in A001481.

Original entry on oeis.org

1, 2, 4, 8, 10, 16, 18, 20, 26, 32, 34, 36, 40, 50, 52, 58, 64, 68, 72, 74, 80, 82, 90, 98, 100, 104, 106, 116, 122, 128, 130, 136, 144, 146, 148, 160, 162, 164, 170, 178, 180, 194, 196, 200, 202, 208, 212, 218, 226, 232, 234, 242, 244, 250, 256, 260, 272, 274
Offset: 1

Views

Author

T. D. Noe, Feb 15 2007

Keywords

Comments

For a given Gaussian prime u, the size of its gap is the minimum of norm(u-v) as v varies over all other Gaussian primes, where norm(a+b*i)=a^2+b^2. Only the small Gaussian primes 1+i and 2+i (and their associates and reflections) have gaps of diameter 1.

Crossrefs

Programs

  • Mathematica
    q=12; imax=2*q^2; lst=Select[Union[Flatten[Table[2*x^2+2*y^2, {x,0,q}, {y,0,x}]]], #<=imax&]; Join[{1},Drop[lst,1]] (* Vladimir Joseph Stephan Orlovsky, Apr 20 2011 *)
  • Sage
    def A128106_list(max):
        R = []; s = 1; sq = 1
        for n in (0..max//2):
            if n == s:
                sq += 1;
                s = sq*sq;
            for k in range(sq):
                if is_square(n-k*k):
                    R.append(2*n)
                    break
        R[0] = 1
        return R
    A128106_list(274) # Peter Luschny, Jun 20 2014

A070176 Let s(n) be smallest number >= n which is a sum of two squares (A001481); sequence gives s(n) - n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 13 2002

Keywords

Comments

It is an unsolved problem to determine the rate of growth of this sequence.
a(A001481(n)) = 0; a(A022544(n)) > 0. [Reinhard Zumkeller, Feb 04 2012]

References

  • H. L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 208.

Programs

  • Haskell
    a070176 n = (head $ dropWhile (< n) a001481_list) - n
    a070176_list = map a070176 [0..]
    -- Reinhard Zumkeller, Feb 04 2012
  • Mathematica
    sumOfTwoSquaresQ[n_] := With[{r = Ceiling[Sqrt[n]]}, Do[ Which[n == x^2 + y^2, Return[True], x == r && y == r, Return[False]], {x, 0, r}, {y, x, r}]]; a[n_] := For[s = n, True, s++, If[sumOfTwoSquaresQ[s], Return[s - n]]]; Table[a[n], {n, 0, 104}](* Jean-François Alcover, May 23 2012 *)
    s2s[n_]:=Module[{i=0},While[SquaresR[2,n+i]==0,i++];i]; Array[s2s,110,0] (* Harvey P. Dale, Jun 16 2012 *)

Extensions

More terms from Jason Earls, Jun 15 2002

A328803 The minimum value of j + k where j and k are positive integers with j^2 + k^2 = A001481(n).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 3, 4, 5, 4, 5, 6, 6, 5, 6, 7, 8, 8, 6, 7, 8, 9, 9, 7, 8, 10, 9, 10, 11, 8, 9, 10, 12, 11, 12, 12, 9, 10, 11, 13, 12, 13, 14, 10, 11, 12, 14, 13, 15, 14, 15, 11, 12, 13, 16, 14, 16, 15, 12, 13, 16, 14, 17, 15, 17, 16, 18, 18, 13, 14, 15, 16
Offset: 1

Views

Author

Peter Kagey, Oct 27 2019

Keywords

Examples

			For n = 14, A001481(14) = 25 = 0^2 + 5^2 = 3^2 + 4^2, so a(14) = min{0+5, 3+4} = 5.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms where A001481(n)<=N
    for s from 0 to isqrt(N) do
       for i from 0 to s/2 do
          t:= i^2 + (s-i)^2;
          if t > N then break fi;
          if not assigned(R[t]) then R[t]:= s fi;
    od od:
    A1481:= sort(map(op, [indices(R)])):
    seq(R[i],i=A1481); # Robert Israel, Oct 28 2019
  • Python
    from itertools import count, islice
    from sympy.solvers.diophantine.diophantine import diop_DN
    from sympy import factorint
    def A328803_gen(): # generator of terms
        return map(lambda n: min((a+b for a, b in diop_DN(-1,n))), filter(lambda n:(lambda m:all(d&3!=3 or m[d]&1==0 for d in m))(factorint(n)), count(0)))
    A328803_list = list(islice(A328803_gen(),30)) # Chai Wah Wu, Sep 09 2022

A344123 Decimal expansion of Sum_{i > 0} 1/A001481(i)^2.

Original entry on oeis.org

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

Views

Author

A.H.M. Smeets, May 09 2021

Keywords

Comments

This constant can be considered as an equivalent of zeta(2) (= Pi^2/6 = A013661), where Euler's zeta(2) is over all positive integers, with prime elements in A000040, while this constant is over all positive integers that can be written as the sum of two squares (A001481) with prime elements given in A055025.
Close to the value of e^(3/2)/Pi.

Examples

			1.4265560635125928786968093161550816361276693636770...
		

Crossrefs

Formula

Equals Sum_{i > 0} 1/A001481(i)^2.
Equals Product_{i > 0} 1/(1-A055025(i)^-2).
Equals 1/(1-prime(1)^(-2)) * Product_{i>1 and prime(i) == 1 (mod 4)} 1/(1-prime(i)^(-2)) * Product_{i>1 and prime(i) == 3 (mod 4)} 1/(1-prime(i)^(-4)), where prime(n) = A000040(n).
Equals (4/3)/(A243379*A334448).
Equals zeta_{2,0} (2) * zeta_{4,1} (2) * zeta_{4,3} (4), where zeta_{4,1} (2) = A175647 and zeta_{2,0} (s) = 2^s/(2^s - 1).

A155562 Intersection of A001481 and A002479: N = a^2 + b^2 = c^2 + 2d^2 for some integers a,b,c,d.

Original entry on oeis.org

0, 1, 2, 4, 8, 9, 16, 17, 18, 25, 32, 34, 36, 41, 49, 50, 64, 68, 72, 73, 81, 82, 89, 97, 98, 100, 113, 121, 128, 136, 137, 144, 146, 153, 162, 164, 169, 178, 193, 194, 196, 200, 225, 226, 233, 241, 242, 256, 257, 272, 274, 281, 288, 289, 292, 306, 313, 324, 328
Offset: 1

Views

Author

M. F. Hasler, Jan 24 2009

Keywords

Comments

Contains A155561 as a subsequence (obtained by restricting a,b,c,d to be nonzero). Also contains A000290 (squares) and A001105 (twice the squares) as subsequence.
From Warut Roonguthai, Oct 13 2009: (Start)
N is also of the form x^2 - 2y^2.
N = (p^2-q^2-2*r*s)^2+(r^2-s^2-2*p*q)^2
= (p^2+q^2-r^2-s^2)^2+2*(p*r-p*s-q*r-q*s)^2
= (p^2+q^2+r^2+s^2)^2-2*(p*r+p*s+q*r-q*s)^2
for some nonnegative integers p, q, r, s. (End)
Numbers k such that in the prime factorization of k, all odd primes that occur with an odd exponent are congruent to 1 (mod 8). - Robert Israel, Jun 24 2024

Programs

  • PARI
    isA155562(n,/* use optional 2nd arg to get other analogous sequences */c=[2,1]) = { for(i=1,#c, for(b=0,sqrtint(n\c[i]), issquare(n-c[i]*b^2) & next(2)); return);1}
    for( n=1,500, isA155562(n) & print1(n","))
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A155562_gen(): # generator of terms
        return filter(lambda n:all((p & 3 != 3 and p & 7 < 5) or e & 1 == 0 for p, e in factorint(n).items()),count(0))
    A155562_list = list(islice(A155562_gen(),30)) # Chai Wah Wu, Jun 27 2022

A229140 Smallest k such that k^2 + l^2 = n-th number expressible as sum of two squares (A001481).

Original entry on oeis.org

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

Views

Author

Ralf Stephan, Sep 15 2013

Keywords

Comments

Conjecture: the values between two zeros are always distinct from each other.

Examples

			The 6th number expressible as sum of two squares A001481(6) = 8 = 2^2 + 2^2, so a(6)=2.
		

Crossrefs

Cf. A001481, A385236 (largest k), A385237, A283303, A283304.

Programs

  • PARI
    for(n=0, 300, s=sqrtint(n); forstep(i=s, 0, -1, if(issquare(n-i*i), print1(sqrtint(n-i*i), ", "); break))); \\ shift corrected by Michel Marcus, Jul 08 2025

Formula

a(n) = 0 if A001481(n) is square.
a(n) = sqrt(A001481(n)-A385236(n)^2). - Zhuorui He, Jul 08 2025

A344124 Decimal expansion of Sum_{i > 0} 1/A001481(i)^3.

Original entry on oeis.org

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

Views

Author

A.H.M. Smeets, May 09 2021

Keywords

Comments

This constant can be considered as an analog of zeta(3) (= Apéry's constant = A002117), where Euler's zeta(3) is over all positive integers, with prime elements in A000040, while this constant is over all positive integers that can be written as the sum of two squares (A001481) with prime elements given in A055025.

Examples

			1.1545383304763889439221065945555168298987751974487...
		

Crossrefs

Formula

Equals Sum_{i > 0} 1/A001481(i)^3.
Equals Product_{i > 0} 1/(1-A055025(i)^-3).
Equals 1/(1-prime(1)^(-3)) * Product_{i>1 and prime(i) == 1 (mod 4)} 1/(1-prime(i)^(-3)) * Product_{i>1 and prime(i) == 3 (mod 4)} 1/(1-prime(i)^(-6)), where prime(n) = A000040(n).
Equals zeta_{2,0} (3) * zeta_{4,1} (3) * zeta_{4,3} (6), where zeta_{2,0} (s) = 2^s/(2^s - 1).

A344125 Decimal expansion of Sum_{i > 0} 1/A001481(i)^4.

Original entry on oeis.org

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

Views

Author

A.H.M. Smeets, May 09 2021

Keywords

Comments

This constant can be considered as an analog of zeta(4) (= Pi^4/90 = A013662), where Euler's zeta(4) is over all positive integers, with prime elements in A000040, while this constant is over all positive integers that can be written as the sum of two squares (A001481) with prime elements given in A055025.

Examples

			1.0685921056549901352029480207432436136133359081017...
		

Crossrefs

Formula

Equals Sum_{i > 0} 1/A001481(i)^4.
Equals Product_{i > 0} 1/(1-A055025(i)^-4).
Equals 1/(1-prime(1)^(-4)) * Product_{i>1 and prime(i) == 1 (mod 4)} 1/(1-prime(i)^(-4)) * Product_{i>1 and prime(i) == 3 (mod 4)} 1/(1-prime(i)^(-8)), where prime(n) = A000040(n).
Equals zeta_{2,0} (4) * zeta_{4,1} (4) * zeta_{4,3} (8), where zeta_{2,0} (s) = 2^s/(2^s - 1).

A386838 Minimum number of unit squares that a straight line drawn from (0,0) to (x,y) passes through on the square lattice where x^2 + y^2 = A001481(n). If A001481(n) can be written as a sum of two squares in two or more ways, x and y are chosen such that a(n) is the least value.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 0, 3, 4, 0, 4, 3, 4, 0, 5, 6, 4, 7, 0, 6, 6, 8, 6, 0, 5, 8, 8, 9, 10, 0, 8, 8, 6, 10, 11, 8, 0, 9, 10, 12, 9, 12, 7, 0, 10, 10, 13, 12, 14, 12, 12, 0, 11, 10, 8, 13, 14, 14, 0, 12, 15, 12, 16, 12, 16, 12, 9, 16, 0, 13, 14, 15, 12, 18, 16, 18, 17, 0, 14
Offset: 1

Views

Author

Miles Englezou, Aug 05 2025

Keywords

Comments

a(n) is the minimal area of the graph formed under the requirement that the straight line (0,0) to (x,y) passes through an enclosed space on the square lattice, with the graph drawn using only vertical and horizontal edges.
Every nonnegative integer n appears in this sequence. Proof: Since 2*n^2 = n^2 + n^2 then by the first formula in the formula section n + n - gcd(n,n) = n. To prove that a(m) = n when A001481(m) = 2*n^2, we have to prove that x = n and y = n is the choice such that a(m) is minimal. Let r and s be two other numbers such that 2*n^2 = r^2 + s^2. Let r > n: consequently s < n, 1 <= gcd(r,s) <= s, and s - gcd(r,s) >= 0. If r + s - gcd(r,s) <= n, then s - gcd(r,s) < 0. But s - gcd(r,s) >= 0. Therefore r + s - gcd(r,s) >= r > n, and a(m) = n.

Examples

			a(4) = 0 since A001481(4) = 4 and 4 = 2^2 + 0^2. A straight line from (0,0) to (2,0) stays on the x axis and therefore passes through no unit squares.
a(5) = 2 since A001481(5) = 5 and 5 = 2^2 + 1^2. A straight line from (0,0) to (2,1) passes through two unit squares. It looks like this:
      _ _ (2,1)
     |_|_|
(0,0)
a(6) = 2 since A001481(6) = 8 and 8 = 2^2 + 2^2. A straight line from (0,0) to (2,2) passes through two unit squares. It looks like this:
        _ (2,2)
      _|_|
     |_|
(0,0)
a(16) = 6 since A001481(16) = 29 and 29 = 5^2 + 2^2. A straight line from (0,0) to (5,2) passes through six unit squares. It looks like this:
          _ _ _ (5,2)
      _ _|_|_|_|
     |_|_|_|
(0,0)
a(14) = 0 since A001481(14) = 25 and 25 = 5^2 + 0^2 = 4^2 + 3^2. x + y - gcd(x,y) is minimal for x = 5 and y = 0 and is equal to zero, therefore a(14) = 0.
		

Crossrefs

Programs

  • PARI
    a(n) = my(f, S, T = []); (f(n) = my(P = []); for(x=0, sqrtint(n), my(y2 = n - x^2); if(issquare(y2), my(y = sqrtint(y2)); if(x <= y, P = concat(P, [[x, y]])))); return(P)); S = f(n); if(#S == 0, return(0), for(k = 1, #S, T = concat(T, S[k][1] + S[k][2] - gcd(S[k][1], S[k][2]))); return(vecmin(T))) \\ function will also return 0 for n not in A001481 so any loop of a(n) must filter n

Formula

For x and y defined in the title, a(n) = x + y - gcd(x,y).
a(n) = 0 when A001481(n) is square.
a(n) = k when A001481(n) = 2*k^2, for k >= 0.
a(n) = A328803(n) - gcd(x,y) for A001481(n) = x^2 + y^2 with exactly one decomposition into a sum of two squares.

A071011 Numbers n such that n is a sum of 2 squares (i.e., n is in A001481(k)) and sigma(n) == 0 (mod 4).

Original entry on oeis.org

65, 85, 125, 130, 145, 170, 185, 205, 221, 250, 260, 265, 290, 305, 340, 365, 370, 377, 410, 442, 445, 481, 485, 493, 500, 505, 520, 530, 533, 545, 565, 580, 585, 610, 629, 680, 685, 689, 697, 730, 740, 745, 754, 765, 785, 793, 820, 865, 884, 890, 901, 905
Offset: 1

Views

Author

Benoit Cloitre, May 19 2002

Keywords

Comments

It is conjectured that if m is not a sum of 2 squares (i.e., m is in A022544(k)) sigma(m) == 0 (mod 4).

Crossrefs

Programs

  • Mathematica
    Select[Range[10^3], And[SquaresR[2, #] > 0, Divisible[DivisorSigma[1, #], 4]] &] (* Michael De Vlieger, Jul 30 2017 *)
  • PARI
    for(n=1,1000,if(1-sign(sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1))))+sigma(n)%4==0,print1(n,",")))
    
  • Python
    from math import prod
    from itertools import count, islice
    from sympy import factorint
    def A071011_gen(): # generator of terms
        return filter(lambda n:(lambda f:all(p & 3 != 3 or e & 1 == 0 for p, e in f) and prod((p**(e+1)-1)//(p-1) & 3 for p, e in f) & 3 == 0)(factorint(n).items()),count(0))
    A071011_list = list(islice(A071011_gen(),30)) # Chai Wah Wu, Jun 27 2022
Showing 1-10 of 239 results. Next