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

A130226 Smallest integer x satisfying the Pell equation x^2-k*y^2=-1 for the values of k given in A031396.

Original entry on oeis.org

0, 1, 2, 3, 18, 4, 5, 70, 6, 32, 7, 182, 99, 29718, 8, 1068, 43, 9, 378, 500, 5604, 10, 4005, 8890182, 776, 11, 682, 57, 1744, 12, 113582, 4832118, 13, 1118, 1111225770, 68, 1764132, 14, 3141, 251, 15, 1710, 23156, 71011068, 4443, 16, 6072, 82, 1407
Offset: 1

Views

Author

Colin Barker, Aug 05 2007

Keywords

Examples

			a(5)=18 because A031396(5)=13, and the solution to x^2-13y^2=-1 with smallest possible x has x=18.
		

Crossrefs

Cf. A094048.

Programs

  • Maple
    A130226 := proc(m)
        local xm,x ,i,xmo,y2;
        xm := [] ; # x^2-m*y^2=-1 (mod m) requires x in xm[]
        for x from 0 to m-1 do
            if modp(x^2,m) = modp(-1,m) then
                xm := [op(xm),x] ;
            end if;
        end do:
        for i from 0 do
            for xmo in xm do
                x := i*m+xmo ;
                y2 := (x^2+1)/m ;
                if issqr(y2) then
                    return x ;
                end if;
            end do:
        end do:
    end proc:
    L := BFILETOLIST("b031396.txt") ;
    n := 1:
    for m in L do
        printf("%d %d\n",n,A130226(m)) ;
        n := n+1 ;
    end do: # R. J. Mathar, Oct 19 2014
  • Mathematica
    terms = 1000;
    a031396 = Cases[Import["https://oeis.org/A031396/b031396.txt", "Table"], {, }][[;; terms, 2]];
    sol[n_] := Solve[x > 0 && y > 0 && x^2 - n y^2 == -1, {x, y}, Integers];
    a[1] = 0; a[n_] := a[n] = x /. sol[a031396[[n]]] /. C[1] -> 0 // First // Simplify // Quiet;
    Table[Print[n, " ", a031396[[n]], " ", a[n]]; a[n], {n, 1, terms}] (* Jean-François Alcover, Apr 05 2020 *)

A130227 Smallest integer y satisfying the Pell equation x^2-ny^2=-1 for the values of n given in A031396.

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 13, 1, 5, 1, 25, 13, 3805, 1, 125, 5, 1, 41, 53, 569, 1, 389, 851525, 73, 1, 61, 5, 149, 1, 9305, 385645, 1, 85, 82596761, 5, 126985, 1, 221, 17, 1, 113, 1517, 4574225, 281
Offset: 1

Views

Author

Colin Barker, Aug 05 2007

Keywords

Crossrefs

A002522 a(n) = n^2 + 1.

Original entry on oeis.org

1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 101, 122, 145, 170, 197, 226, 257, 290, 325, 362, 401, 442, 485, 530, 577, 626, 677, 730, 785, 842, 901, 962, 1025, 1090, 1157, 1226, 1297, 1370, 1445, 1522, 1601, 1682, 1765, 1850, 1937, 2026, 2117, 2210, 2305, 2402, 2501
Offset: 0

Views

Author

Keywords

Comments

An n X n nonnegative matrix A is primitive (see A070322) iff every element of A^k is > 0 for some power k. If A is primitive then the power which should have all positive entries is <= n^2 - 2n + 2 (Wielandt).
a(n) = Phi_4(n), where Phi_k is the k-th cyclotomic polynomial.
As the positive solution to x=2n+1/x is x=n+sqrt(a(n)), the continued fraction expansion of sqrt(a(n)) is {n; 2n, 2n, 2n, 2n, ...}. - Benoit Cloitre, Dec 07 2001
a(n) is one less than the arithmetic mean of its neighbors: a(n) = (a(n-1) + a(n+1))/2 - 1. E.g., 2 = (1+5)/2 - 1, 5 = (2+10)/2 - 1. - Amarnath Murthy, Jul 29 2003
Equivalently, the continued fraction expansion of sqrt(a(n)) is (n;2n,2n,2n,...). - Franz Vrabec, Jan 23 2006
Number of {12,1*2*,21}-avoiding signed permutations in the hyperoctahedral group.
The number of squares of side 1 which can be drawn without lifting the pencil, starting at one corner of an n X n grid and never visiting an edge twice is n^2-2n+2. - Sébastien Dumortier, Jun 16 2005
Also, numbers m such that m^3 - m^2 is a square, (n*(1 + n^2))^2. - Zak Seidov
1 + 2/2 + 2/5 + 2/10 + ... = Pi*coth Pi [Jolley], see A113319. - Gary W. Adamson, Dec 21 2006
For n >= 1, a(n-1) is the minimal number of choices from an n-set such that at least one particular element has been chosen at least n times or each of the n elements has been chosen at least once. Some games define "matches" this way; e.g., in the classic Parker Brothers, now Hasbro, board game Risk, a(2)=5 is the number of cards of three available types (suits) required to guarantee at least one match of three different types or of three of the same type (ignoring any jokers or wildcards). - Rick L. Shepherd, Nov 18 2007
Positive X values of solutions to the equation X^3 + (X - 1)^2 + X - 2 = Y^2. To prove that X = n^2 + 1: Y^2 = X^3 + (X - 1)^2 + X - 2 = X^3 + X^2 - X - 1 = (X - 1)(X^2 + 2X + 1) = (X - 1)*(X + 1)^2 it means: (X - 1) must be a perfect square, so X = n^2 + 1 and Y = n(n^2 + 2). - Mohamed Bouhamida, Nov 29 2007
{a(k): 0 <= k < 4} = divisors of 10. - Reinhard Zumkeller, Jun 17 2009
Appears in A054413 and A086902 in relation to sequences related to the numerators and denominators of continued fractions convergents to sqrt((2*n)^2/4 + 1), n=1, 2, 3, ... . - Johannes W. Meijer, Jun 12 2010
For n > 0, continued fraction [n,n] = n/a(n); e.g., [5,5] = 5/26. - Gary W. Adamson, Jul 15 2010
The only real solution of the form f(x) = A*x^p with negative p which satisfies f^(m)(x) = f^[-1](x), x >= 0, m >= 1, with f^(m) the m-th derivative and f^[-1] the compositional inverse of f, is obtained for m=2*n, p=p(n)= -(sqrt(a(n))-n) and A=A(n)=(fallfac(p(n),2*n))^(-p(n)/(p(n)+1)), with fallfac(x,k):=Product_{j=0..k-1} (x-j) (falling factorials). See the T. Koshy reference, pp. 263-4 (there are also two solutions for positive p, see the corresponding comment in A087475). - Wolfdieter Lang, Oct 21 2010
n + sqrt(a(n)) = [2*n;2*n,2*n,...] with the regular continued fraction with period 1. This is the even case. For the general case see A087475 with the Schroeder reference and comments. For the odd case see A078370.
a(n-1) counts configurations of non-attacking bishops on a 2 X n strip [Chaiken et al., Ann. Combin. 14 (2010) 419]. - R. J. Mathar, Jun 16 2011
Also numbers k such that 4*k-4 is a square. Hence this sequence is the union of A053755 and A069894. - Arkadiusz Wesolowski, Aug 02 2011
a(n) is also the Moore lower bound on the order, A191595(n), of an (n,5)-cage. - Jason Kimberley, Oct 17 2011
Left edge of the triangle in A195437: a(n+1) = A195437(n,0). - Reinhard Zumkeller, Nov 23 2011
If h (5,17,37,65,101,...) is prime is relatively prime to 6, then h^2-1 is divisible by 24. - Vincenzo Librandi, Apr 14 2014
The identity (4*n^2+2)^2 - (n^2+1)*(4*n)^2 = 4 can be written as A005899(n)^2 - a(n)*A008586(n)^2 = 4. - Vincenzo Librandi, Jun 15 2014
a(n) is also the number of permutations simultaneously avoiding 213 and 321 in the classical sense which can be realized as labels on an increasing strict binary tree with 2n-1 nodes. See A245904 for more information on increasing strict binary trees. - Manda Riehl, Aug 07 2014
a(n-1) is the maximum number of stages in the Gale-Shapley algorithm for finding a stable matching between two sets of n elements given an ordering of preferences for each element (see Gura et al.). - Melvin Peralta, Feb 07 2016
Because of Fermat's little theorem, a(n) is never divisible by 3. - Altug Alkan, Apr 08 2016
For n > 0, if a(n) points are placed inside an n X n square, it will always be the case that at least two of the points will be a distance of sqrt(2) units apart or less. - Melvin Peralta, Jan 21 2017
Also the limit as q->1^- of the unimodal polynomial (1-q^(n*k+1))/(1-q) after making the simplification k=n. The unimodal polynomial is from O'Hara's proof of unimodality of q-binomials after making the restriction to partitions of size <= 1. See G_1(n,k) from arXiv:1711.11252. As the size restriction s increases, G_s->G_infinity=G: the q-binomials. Then substituting k=n and q=1 yields the central binomial coefficients: A000984. - Bryan T. Ek, Apr 11 2018
a(n) is the smallest number congruent to both 1 (mod n) and 2 (mod n+1). - David James Sycamore, Apr 04 2019
a(n) is the number of permutations of 1,2,...,n+1 with exactly one reduced decomposition. - Richard Stanley, Dec 22 2022
From Klaus Purath, Apr 03 2025: (Start)
The odd prime factors of these terms are always of the form 4*k + 1.
All a(n) = D satisfy the Pell equation (k*x)^2 - D*y^2 = -1. The values for k and the solutions x, y can be calculated using the following algorithm: k = n, x(0) = 1, x(1) = 4*D - 1, y(0) = 1, y(1) = 4*D - 3. The two recurrences are of the form (4*D - 2, -1). The solutions x, y of the Pell equations for n = {1 ... 14} are in OEIS.
It follows from the above that this sequence is a subsequence of A031396. (End)

Examples

			G.f. = 1 + 2*x + 5*x^2 + 10*x^3 + 17*x^4 + 26*x^5 + 37*x^6 + 50*x^7 + 65*x^8 + ...
		

References

  • S. J. Cyvin and I. Gutman, Kekulé structures in benzenoid hydrocarbons, Lecture Notes in Chemistry, No. 46, Springer, New York, 1988 (see p. 120).
  • E. Gura and M. Maschler, Insights into Game Theory: An Alternative Mathematical Experience, Cambridge, 2008; p. 26.
  • Thomas Koshy, Fibonacci and Lucas Numbers with Applications, John Wiley and Sons, New York, 2001.

Crossrefs

Left edge of A055096.
Cf. A059100, A117950, A087475, A117951, A114949, A117619 (sequences of form n^2 + K).
a(n+1) = A101220(n, n+1, 3).
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), this sequence (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A002496 (primes).
Cf. A254858.
Subsequence of A031396.

Programs

Formula

O.g.f.: (1-x+2*x^2)/((1-x)^3). - Eric Werley, Jun 27 2011
Sequences of the form a(n) = n^2 + K with offset 0 have o.g.f. (K - 2*K*x + K*x^2 + x + x^2)/(1-x)^3 and recurrence a(n) = 3*a(n-1) - 3*a(n-2) + a*(n-3). - R. J. Mathar, Apr 28 2008
For n > 0: a(n-1) = A143053(A000290(n)) - 1. - Reinhard Zumkeller, Jul 20 2008
A143053(a(n)) = A000290(n+1). - Reinhard Zumkeller, Jul 20 2008
a(n)*a(n-2) = (n-1)^4 + 4. - Reinhard Zumkeller, Feb 12 2009
a(n) = A156798(n)/A087475(n). - Reinhard Zumkeller, Feb 16 2009
From Reinhard Zumkeller, Mar 08 2010: (Start)
a(n) = A170949(A002061(n+1));
A170949(a(n)) = A132411(n+1);
A170950(a(n)) = A002061(n+1). (End)
For n > 1, a(n)^2 + (a(n) + 1)^2 + ... + (a(n) + n - 2)^2 + (a(n) + n - 1 + a(n) + n)^2 = (n+1) *(6*n^4 + 18*n^3 + 26*n^2 + 19*n + 6) / 6 = (a(n) + n)^2 + ... + (a(n) + 2*n)^2. - Charlie Marion, Jan 10 2011
From Eric Werley, Jun 27 2011: (Start)
a(n) = 2*a(n-1) - a(n-2) + 2.
a(n) = a(n-1) + 2*n - 1. (End)
a(n) = (n-1)^2 + 2(n-1) + 2 = 122 read in base n-1 (for n > 3). - Jason Kimberley, Oct 20 2011
a(n)*a(n+1) = a(n*(n+1) + 1) so a(1)*a(2) = a(3). More generally, a(n)*a(n+k) = a(n*(n+k) + 1) + k^2 - 1. - Jon Perry, Aug 01 2012
a(n) = (n!)^2* [x^n] BesselI(0, 2*sqrt(x))*(1+x). - Peter Luschny, Aug 25 2012
a(n) = A070216(n,1) for n > 0. - Reinhard Zumkeller, Nov 11 2012
E.g.f.: exp(x)*(1 + x + x^2). - Geoffrey Critzer, Aug 30 2013
a(n) = A254858(n-2,3) for n > 2. - Reinhard Zumkeller, Feb 09 2015
Sum_{n>=0} (-1)^n / a(n) = (1+Pi/sinh(Pi))/2 = 0.636014527491... = A367976 . - Vaclav Kotesovec, Feb 14 2015
Sum_{n>=0} 1/a(n) = (1 + Pi*coth(Pi))/2 = 2.076674... = A113319. - Vaclav Kotesovec, Apr 10 2016
4*a(n) = A001105(n-1) + A001105(n+1). - Bruno Berselli, Jul 03 2017
From Amiram Eldar, Jan 20 2021: (Start)
Product_{n>=0} (1 + 1/a(n)) = sqrt(2)*csch(Pi)*sinh(sqrt(2)*Pi).
Product_{n>=1} (1 - 1/a(n)) = Pi*csch(Pi). (End)
Sum_{n>=0} a(n)/n! = 3*e. - Davide Rotondo, Feb 16 2025

Extensions

Partially edited by Joerg Arndt, Mar 11 2010

A078370 a(n) = 4*(n+1)*n + 5.

Original entry on oeis.org

5, 13, 29, 53, 85, 125, 173, 229, 293, 365, 445, 533, 629, 733, 845, 965, 1093, 1229, 1373, 1525, 1685, 1853, 2029, 2213, 2405, 2605, 2813, 3029, 3253, 3485, 3725, 3973, 4229, 4493, 4765, 5045, 5333, 5629, 5933, 6245, 6565, 6893, 7229, 7573, 7925, 8285, 8653, 9029
Offset: 0

Views

Author

Wolfdieter Lang, Nov 29 2002

Keywords

Comments

This is the generic form of D in the (nontrivially) solvable Pell equation x^2 - D*y^2 = -4. See A078356, A078357.
1/5 + 1/13 + 1/29 + ... = (Pi/8)*tanh Pi [Jolley]. - Gary W. Adamson, Dec 21 2006
Appears in A054413 and A086902 in relation to sequences related to the numerators and denominators of continued fractions convergents to sqrt((2*n+1)^2 + 4), n = 1, 2, 3, ... . - Johannes W. Meijer, Jun 12 2010
(2*n + 1 + sqrt(a(n)))/2 = [2*n + 1; 2*n + 1, 2*n + 1, ...], n >= 0, with the regular continued fraction with period length 1. This is the odd case. See A087475 for the general case with the Schroeder reference and comments. For the even case see A002522.
Primes in the sequence are in A005473. - Russ Cox, Aug 26 2019
The continued fraction expansion of sqrt(a(n)) is [2n+1; {n, 1, 1, n, 4n+2}]. For n=0, this collapses to [2; {4}]. - Magus K. Chu, Aug 27 2022
Discriminant of the binary quadratic forms y^2 - x*y - A002061(n+1)*x^2. - Klaus Purath, Nov 10 2022
From Klaus Purath, Apr 08 2025: (Start)
There are no squares in this sequence. The prime factors of these terms are always of the form 4*k + 1.
All a(n) = D satisfy the Pell equation (k*x)^2 - D*(m*y)^2 = -1 for any integer n where m = (D - 3)/2. The values for k and the solutions x, y can be calculated using the following algorithm: k = sqrt(D*m^2 - 1), x(0) = 1, x(1) = 4*D*m^2 - 1, y(0) = 1, y(1) = 4*D*m^2 - 3. The two recurrences are of the form (4*D*m^2 - 2, -1).
It follows from the above that this sequence belongs to A031396. (End)

References

  • L. B. W. Jolley, "Summation of Series", Dover Publications, 1961, p. 176.

Crossrefs

Subsequence of A077426 (D values (not a square) for which Pell x^2 - D*y^2 = -4 is solvable in positive integers).
Subsequence of A031396.

Programs

  • Magma
    [4*n^2+4*n+5 : n in [0..80]]; // Wesley Ivan Hurt, Aug 29 2022
  • Mathematica
    Table[4 n (n + 1) + 5, {n, 0, 45}] (* or *)
    Table[8 Binomial[n + 1, 2] + 5, {n, 0, 45}] (* or *)
    CoefficientList[Series[(5 - 2 x + 5 x^2)/(1 - x)^3, {x, 0, 45}], x] (* Michael De Vlieger, Jan 04 2017 *)
  • PARI
    a(n)=4*n^2+4*n+5 \\ Charles R Greathouse IV, Sep 24 2015
    
  • Python
    a= lambda n: 4*n**2+4*n+5 # Indranil Ghosh, Jan 04 2017
    
  • Scala
    (1 to 99 by 2).map(n => n * n + 4) // Alonso del Arte, May 29 2019
    

Formula

a(n) = (2*n + 1)^2 + 4.
a(n) = 4*(n+1)*n + 5 = 8*binomial(n+1, 2) + 5, hence subsequence of A004770 (5 (mod 8) numbers). [Typo fixed by Zak Seidov, Feb 26 2012]
G.f.: (5 - 2*x + 5*x^2)/(1 - x)^3.
a(n) = 8*n + a(n-1), with a(0) = 5. - Vincenzo Librandi, Aug 08 2010
a(n) = A016754(n) + 4. - Leo Tavares, Feb 22 2023
From Elmo R. Oliveira, Oct 31 2024: (Start)
E.g.f.: (5 + 8*x + 4*x^2)*exp(x).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

Extensions

More terms from Max Alekseyev, Mar 03 2010

A003814 Numbers k such that the continued fraction for sqrt(k) has odd period length.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Walter Gilbert

Keywords

Comments

All primes of the form 4m + 1 are here. - T. D. Noe, Mar 19 2012
These numbers have no prime factors of the form 4m + 3. - Thomas Ordowski, Jul 01 2013
This sequence is a proper subsequence of the so-called 1-happy number products A007969. See the W. Lang link there, eq. (1), with B = 1, C = a(n), also with a table at the end. This is due to the soluble Pell equation R^2 - C*S^2 = -1 for C = a(n). See e.g., Perron, Satz 3.18. on p. 93, and the table on p. 91 with the numbers D of the first column that do not have a number in brackets in the second column (Teilnenner von sqrt(D)). - Wolfdieter Lang, Sep 19 2015

References

  • W. Paulsen, Calkin-Wilf sequences for irrational numbers, Fib. Q., 61:1 (2023), 51-59.
  • O. Perron, Die Lehre von den Kettenbrüchen, Band I, Teubner Verlagsgesellschaft, Stuttgart, 1954.
  • Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).

Crossrefs

Cf. A031396.
Cf. A206586 (period has positive even length).

Programs

  • Maple
    isA003814 := proc(n)
        local cf,p ;
        if issqr(n) then
            return false;
        end if;
        for p in numtheory[factorset](n) do
            if modp(p,4) = 3 then
                return false;
            end if;
        end do:
        cf := numtheory[cfrac](sqrt(n),'periodic','quotients') ;
        type( nops(op(2,cf)),'odd') ;
    end proc:
    A003814 := proc(n)
        option remember;
        if n = 1 then
            2;
        else
            for a from procname(n-1)+1 do
                if isA003814(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A003814(n),n=1..40) ; # R. J. Mathar, Oct 19 2014
  • Mathematica
    Select[Range[100], ! IntegerQ[Sqrt[#]] && OddQ[Length[ContinuedFraction[Sqrt[#]][[2]]]] &] (* T. D. Noe, Mar 19 2012 *)
  • PARI
    cyc(cf) = {
      if(#cf==1, return([])); \\ There is no cycle
      my(s=[]);
      for(k=2, #cf,
        s=concat(s, cf[k]);
        if(cf[k]==2*cf[1], return(s)) \\ Cycle found
      );
      0 \\ Cycle not found
    }
    select(n->#cyc(contfrac(sqrt(n)))%2==1, vector(400, n, n)) \\ Colin Barker, Oct 19 2014

A004613 Numbers that are divisible only by primes congruent to 1 mod 4.

Original entry on oeis.org

1, 5, 13, 17, 25, 29, 37, 41, 53, 61, 65, 73, 85, 89, 97, 101, 109, 113, 125, 137, 145, 149, 157, 169, 173, 181, 185, 193, 197, 205, 221, 229, 233, 241, 257, 265, 269, 277, 281, 289, 293, 305, 313, 317, 325, 337, 349, 353, 365, 373, 377, 389, 397, 401, 409, 421
Offset: 1

Views

Author

Keywords

Comments

Also gives solutions z to x^2+y^2=z^4 with gcd(x,y,z)=1 and x,y,z positive. - John Sillcox (johnsillcox(AT)hotmail.com), Feb 20 2004
A065338(a(n)) = 1. - Reinhard Zumkeller, Jul 10 2010
Product_{k=1..A001221(a(n))} A079260(A027748(a(n),k)) = 1. - Reinhard Zumkeller, Jan 07 2013
A062327(a(n)) = A000005(a(n))^2. (These are the only numbers that satisfy this equation.) - Benedikt Otten, May 22 2013
Numbers that are positive integer divisors of 1 + 4*x^2 where x is a positive integer. - Michael Somos, Jul 26 2013
Numbers k such that there is a "knight's move" of Euclidean distance sqrt(k) which allows the whole of the 2D lattice to be reached. For example, a knight which travels 4 units in any direction and then 1 unit at right angles to the first direction moves a distance sqrt(17) for each move. This knight can reach every square of an infinite chessboard.
Also 1/7 of the area of the n-th largest octagon with angles 3*Pi/4, along the perimeter of which there are only 8 nodes of the square lattice - at its vertices. - Alexander M. Domashenko, Feb 21 2024
Sequence closed under multiplication. Odd values of A031396 and their powers. These are the only numbers m that satisfy the Pell equation (k*x)^2 - D*(m*y)^2 = -1. - Klaus Purath, May 12 2025

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.

Crossrefs

Subsequence of A000404; A002144 is a subsequence. Essentially same as A008846.
Cf. A004614.

Programs

  • Haskell
    a004613 n = a004613_list !! (n-1)
    a004613_list = filter (all (== 1) . map a079260 . a027748_row) [1..]
    -- Reinhard Zumkeller, Jan 07 2013
  • Magma
    [n: n in [1..500] | forall{d: d in PrimeDivisors(n) | d mod 4 eq 1}]; // Vincenzo Librandi, Aug 21 2012
    
  • Maple
    isA004613 := proc(n)
        local p;
        for p in numtheory[factorset](n) do
            if modp(p,4) <> 1 then
                return false;
            end if;
        end do:
        true;
    end proc:
    for n from 1 to 200 do
        if isA004613(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Nov 17 2014
    # second Maple program:
    q:= n-> andmap(i-> irem(i[1], 4)=1, ifactors(n)[2]):
    select(q, [$1..500])[];  # Alois P. Heinz, Jan 13 2024
  • Mathematica
    ok[1] = True; ok[n_] := And @@ (Mod[#, 4] == 1 &) /@ FactorInteger[n][[All, 1]]; Select[Range[421], ok] (* Jean-François Alcover, May 05 2011 *)
    Select[Range[500],Union[Mod[#,4]&/@(FactorInteger[#][[All,1]])]=={1}&] (* Harvey P. Dale, Mar 08 2017 *)
  • PARI
    for(n=1,1000,if(sumdiv(n,d,isprime(d)*if((d-1)%4,1,0))==0,print1(n,",")))
    
  • PARI
    is(n)=n%4==1 && factorback(factor(n)[,1]%4)==1 \\ Charles R Greathouse IV, Sep 19 2016
    

Formula

Numbers of the form x^2 + y^2 where x is even, y is odd and gcd(x, y) = 1.

A003654 Squarefree integers m such that the fundamental unit of Q(sqrt(m)) has norm -1. Also, squarefree integers m such that the Pell equation x^2 - m*y^2 = -1 is soluble.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mira Bernstein. Entry revised by N. J. A. Sloane, Jun 11 2012

Keywords

Comments

The squarefree elements of A003814 and A172000. - Max Alekseyev, Jun 01 2009
Together with {1} and A031398 forms a disjoint partition of A020893. That is, A020893 = {1} U A003654 U A031398. - Max Alekseyev, Mar 09 2010
Squarefree integers m such that Q(sqrt(m)) contains the infinite continued fraction [k, k, k, k, k, ...] for some positive integer k. For example, Q(sqrt(5)) contains [1, 1, 1, 1, 1, ...] which equals (1 + sqrt(5))/2. - Greg Dresden, Jul 23 2010

References

  • D. A. Buell, Binary Quadratic Forms. Springer-Verlag, NY, 1989, pp. 224-241.
  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 46.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 56.
  • W. Paulsen, Calkin-Wilf sequences for irrational numbers, Fib. Q., 61:1 (2023), 51-59.
  • 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

Programs

  • Maple
    isA003654 := proc(n)
        local cf,p ;
        if not numtheory[issqrfree](n) then
            return false;
        end if;
        for p in numtheory[factorset](n) do
            if modp(p,4) = 3 then
                return false;
            end if;
        end do:
        cf := numtheory[cfrac](sqrt(n),'periodic','quotients') ;
        type( nops(op(2,cf)),'odd') ;
    end proc:
    A003654 := proc(n)
        option remember;
        local a;
        if n = 1 then
            2;
        else
            for a from procname(n-1)+1 do
                if isA003654(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A003654(n),n=1..40) ; # R. J. Mathar, Oct 19 2014
  • Mathematica
    Reap[For[n = 2, n < 1000, n++, If[SquareFreeQ[n], sol = Solve[x^2 - n y^2 == -1, {x, y}, Integers]; If[sol != {}, Sow[n]]]]][[2, 1]] (* Jean-François Alcover, Mar 24 2020 *)

Extensions

Edited by Max Alekseyev, Mar 17 2010

A154355 a(n) = 25*n^2 - 36*n + 13.

Original entry on oeis.org

13, 2, 41, 130, 269, 458, 697, 986, 1325, 1714, 2153, 2642, 3181, 3770, 4409, 5098, 5837, 6626, 7465, 8354, 9293, 10282, 11321, 12410, 13549, 14738, 15977, 17266, 18605, 19994, 21433, 22922, 24461, 26050, 27689, 29378
Offset: 0

Views

Author

Vincenzo Librandi, Jan 07 2009

Keywords

Comments

The identity (1250*n^2 - 1800*n + 649)^2 - (25*n^2 - 36*n + 13)*(250*n - 180)^2 = 1 can be written as A154358(n)^2 - a(n)*A154360(n)^2 = 1. See also the third comment in A154357.
Numbers of the form (3n-2)^2 + (4n-3)^2. - Bruno Berselli, Dec 12 2011
From Klaus Purath, May 06 2025: (Start)
25*a(n)-1 is a square, and a(n) is the sum of two squares (see FORMULA). There are no squares in this sequence. The odd prime factors of these terms are always of the form 4*k + 1.
All a(n) = D satisfy the Pell equation (k*x)^2 - D*(5*y)^2 = -1 for any integer n where a(1-n) = A154357(n). The values for k and the solutions x, y can be calculated using the following algorithm: k = sqrt(D*5^2 - 1), x(0) = 1, x(1) = 4*D*5^2 - 1, y(0) = 1, y(1) = 4*D*5^2 - 3. The two recurrences are of the form (4*D*5^2 - 2, -1).
It follows from the above that the terms of this sequence and of A154357 belong to A031396. (End)

Crossrefs

Essentially a duplicate of A007533.

Programs

  • Magma
    [25*n^2-36*n+13: n in [0..40]]; // Bruno Berselli, Sep 15 2016
  • Mathematica
    Table[25n^2-36n+13,{n,0,40}]  (* Harvey P. Dale, Apr 02 2011 *)
    LinearRecurrence[{3, -3, 1}, {13, 2, 41}, 50] (* Vincenzo Librandi, Feb 21 2012 *)
  • PARI
    for(n=0, 40, print1(25*n^2 - 36*n + 13", ")); \\ Vincenzo Librandi, Feb 21 2012
    

Formula

a(n) = A007533(n-1), n>0. - R. J. Mathar, Jan 14 2009
G.f.: (13 - 37*x + 74*x^2) / (1-x)^3. - R. J. Mathar, Jan 05 2011
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Vincenzo Librandi, Feb 21 2012
E.g.f.: (13 - 11*x + 25*x^2) * exp(x). - G. C. Greubel, Sep 14 2016
From Klaus Purath, May 06 2025: (Start)
a(n) = (3*n-2)^2 + (4*n-3)^2.
25*a(n) - 1 = (25*n - 18)^2. (End)

Extensions

Offset corrected from R. J. Mathar, Jan 05 2011
First comment rewritten by Bruno Berselli, Dec 12 2011

A031398 Squarefree n with no 4k+3 factors such that Pell equation x^2 - n y^2 = -1 is insoluble.

Original entry on oeis.org

34, 146, 178, 194, 205, 221, 305, 377, 386, 410, 466, 482, 505, 514, 545, 562, 674, 689, 706, 745, 793, 802, 866, 890, 898, 905, 1154, 1186, 1202, 1205, 1234, 1282, 1345, 1346, 1394, 1405, 1469, 1513, 1517, 1537, 1538, 1717, 1762, 1802, 1858
Offset: 1

Views

Author

Keywords

Comments

Or, numbers n which are the sum of two relatively-prime squares but for which x^2 - n*y^2 does not represent -1.
Together with {1} and A003654 forms a disjoint partition of A020893. That is, A020893 = {1} U A003654 U A031398. - Max Alekseyev, Mar 09 2010

References

  • Harvey Cohn, "Advanced Number Theory".

Crossrefs

Programs

  • Mathematica
    sel = Select[Range[2000], SquareFreeQ[#] && FreeQ[Mod[FactorInteger[#][[All, 1]], 4], 3]&]; r[n_] := Reduce[x^2-n*y^2 == -1, {x, y}, Integers]; Reap[For[n=1, n <= Length[sel], n++, an = sel[[n]]; If[r[an] === False, Print[an]; Sow[an]]]][[2, 1]] (* Jean-François Alcover, Feb 04 2014 *)

Extensions

Edited by N. J. A. Sloane, Apr 28 2008, at the suggestion of Artur Jasinski

A156640 a(n) = 169*n^2 + 140*n + 29.

Original entry on oeis.org

29, 338, 985, 1970, 3293, 4954, 6953, 9290, 11965, 14978, 18329, 22018, 26045, 30410, 35113, 40154, 45533, 51250, 57305, 63698, 70429, 77498, 84905, 92650, 100733, 109154, 117913, 127010, 136445, 146218, 156329, 166778
Offset: 0

Views

Author

Vincenzo Librandi, Feb 15 2009

Keywords

Comments

The identity (57122*n^2 +47320*n +9801)^2 - (169*n^2 +140*n +29)*(4394*n +1820)^2 = 1 can be written as A156735(n)^2 - a(n)*A156636(n)^2 = 1.
The continued fraction expansion of sqrt(a(n)) is [13n+5; {2, 1, 1, 2, 26n+10}]. - Magus K. Chu, Sep 15 2022
From Klaus Purath, Apr 06 2025: (Start)
a(n)*13^2-1 is a square, and a(n) is the sum of two squares (see FORMULA). There are no squares in this sequence. The odd prime factors of these terms are always of the form 4*k + 1.
All a(n) = D satisfy the Pell equation (k*x)^2 - D*(13*y)^2 = -1 for any integer n where a(1-n) = A156639(n). The values for k and the solutions x, y can be calculated using the following algorithm: k = sqrt(D*13^2 - 1), x(0) = 1, x(1) = 4*D*13^2 - 1, y(0) = 1, y(1) = 4*D*13^2 - 3. The two recurrences are of the form (4*D*13^2 - 2, -1).
It follows from the above that this sequence and A156639 belong to A031396. (End)

Crossrefs

Cf. A154609 (13n+5).
Subsequence of A031396.

Programs

  • Magma
    I:=[29, 338, 985]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..50]];
    
  • Maple
    A156640:= n-> 169*n^2 + 140*n + 29; seq(A156640(n), n=0..50); # G. C. Greubel, Feb 28 2021
  • Mathematica
    LinearRecurrence[{3,-3,1},{29,338,985},50]
    CoefficientList[Series[(29 +251x +58x^2)/(1-x)^3, {x, 0, 60}], x] (* Vincenzo Librandi, May 03 2014 *)
  • PARI
    a(n)=169*n^2+140*n+29 \\ Charles R Greathouse IV, Dec 23 2011
    
  • Sage
    [169*n^2 + 140*n + 29 for n in (0..50)] # G. C. Greubel, Feb 28 2021

Formula

a(n) = 3*a(n-1) -3*a(n-2) +a(n-3) for n>2.
G.f.: (29 + 251*x + 58*x^2)/(1-x)^3. - Vincenzo Librandi, May 03 2014
E.g.f.: (29 +309*x +169*x^2)*exp(x). - G. C. Greubel, Feb 28 2021
From Klaus Purath, Apr 06 2025: (Start)
a(n) = (5*n + 2)^2 + (12*n + 5)^2 for any integer n.
169*a(n) - 1 = (169*n + 70)^2 for any integer n. (End)

Extensions

Edited by Charles R Greathouse IV, Jul 25 2010
Showing 1-10 of 28 results. Next