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

A005474 Class numbers of the real quadratic fields Q(sqrt(A005473(n))).

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 3, 5, 3, 3, 7, 3, 5, 7, 3, 3, 5, 9, 7, 3, 5, 5, 15, 9, 19, 5, 13, 9, 9, 5, 19, 9, 5, 7, 15, 13, 9, 9, 15, 25, 13, 9, 27, 19, 15, 21, 7, 13, 11, 23, 9, 13, 13, 11, 33, 15, 25, 23, 15, 13, 29, 21, 17, 43, 35, 27, 33, 17, 17, 27, 45, 11, 63, 15, 31, 17, 15, 33, 15, 31, 31
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Sage
    def a(n):
        m, k = 1, 1
        while (m < n): k += 1; m += (k^2+4).is_prime()
        return QuadraticField(k^2+4).class_number()  # Robin Visser, Dec 07 2024

Extensions

More terms and name edited by Robin Visser, Dec 07 2024

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

A146326 Length of the period of the continued fraction of (1+sqrt(n))/2.

Original entry on oeis.org

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

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

First occurrence of n in this sequence see A146343.
Records see A146344.
Indices where records occurred see A146345.
a(n) =0 for n = k^2 (A000290).
a(n) =1 for n = 4 k^2 + 4 k + 5 (A078370). For primes see A005473.
a(n) =2 for n in A146327. For primes see A056899.
a(n) =3 for n in A146328. For primes see A146348.
a(n) =4 for n in A146329. For primes see A028871 - {2}.
a(n) =5 for n in A146330. For primes see A146350.
a(n) =6 for n in A146331. For primes see A146351.
a(n) =7 for n in A146332. For primes see A146352.
a(n) =8 for n in A146333. For primes see A146353.
a(n) =9 for n in A143577. For primes see A146354.
a(n)=10 for n in A146334. For primes see A146355.
a(n)=11 for n in A146335. For primes see A146356.
a(n)=12 for n in A146336. For primes see A146357.
a(n)=13 for n in A333640. For primes see A146358.
a(n)=14 for n in A146337. For primes see A146359.
a(n)=15 for n in A146338. For primes see A146360.
a(n)=16 for n in A146339. For primes see A146361.
a(n)=17 for n in A146340. For primes see A146362.

Examples

			a(2) = 2 because continued fraction of (1+sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has period (1,4) length 2.
		

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: seq(A146326(n),n=1..100) ; # R. J. Mathar, Sep 06 2009
  • Mathematica
    Table[cf = ContinuedFraction[(1 + Sqrt[n])/2]; If[Head[cf[[-1]]] === List, Length[cf[[-1]]], 0], {n, 100}]
    f[n_] := Length@ ContinuedFraction[(1 + Sqrt[n])/2][[-1]]; Array[f, 100] (* Robert G. Wilson v, Apr 11 2017 *)

Formula

a(n) = 0 iff n is a square (A000290). - Robert G. Wilson v, Apr 11 2017

Extensions

a(39) and a(68) corrected by R. J. Mathar, Sep 06 2009

A045637 Primes of the form p^2 + 4, where p is prime.

Original entry on oeis.org

13, 29, 53, 173, 293, 1373, 2213, 4493, 5333, 9413, 10613, 18773, 26573, 27893, 37253, 54293, 76733, 85853, 94253, 97973, 100493, 120413, 139133, 214373, 237173, 253013, 299213, 332933, 351653, 368453, 375773, 458333, 552053, 619373
Offset: 1

Views

Author

Keywords

Comments

These are the only primes that are the sum of two primes squared. 11 = 3^2 + 2 is the only prime of the form p^2 + 2 because all primes greater than 3 can be written as p=6n-1 or p=6n+1, which allows p^2+2 to be factored. - T. D. Noe, May 18 2007
Infinite under the Bunyakovsky conjecture. - Charles R Greathouse IV, Jul 04 2011
All terms > 29 are congruent to 53 mod 120. - Zak Seidov, Nov 06 2013

Examples

			29 belongs to the sequence because it equals 5^2 + 4.
		

Crossrefs

The corresponding primes p are in A062324.
Subsequence of A005473 (and thus A185086).

Programs

  • Mathematica
    Select[Prime[ # ]^2+4&/@Range[140], PrimeQ]
  • PARI
    forprime(p=2,1e4,if(isprime(t=p^2+4),print1(t","))) \\ Charles R Greathouse IV, Jul 04 2011

Formula

a(n) = A062324(n)^2 + 4. - Zak Seidov, Nov 06 2013

Extensions

Edited by Dean Hickerson, Dec 10 2002

A056905 Primes of the form k^2 + 5.

Original entry on oeis.org

5, 41, 149, 1301, 2309, 5189, 6089, 9221, 13001, 15881, 26249, 28229, 39209, 41621, 60521, 66569, 86441, 112901, 116969, 138389, 171401, 186629, 207941, 213449, 242069, 254021, 266261, 285161, 304709, 331781, 345749, 352841, 389381, 443561
Offset: 1

Views

Author

Henry Bottomley, Jul 07 2000

Keywords

Comments

Except for a(0), a(n) mod 180 = 41 or 149 since k must be a multiple of 6 without being a multiple of 30 for k^2+5 to be prime.

Examples

			a(2)=149 since 12^2 + 5 = 149, which is prime.
		

Crossrefs

Programs

  • Magma
    [a: n in [0..700] | IsPrime(a) where a is n^2+5]; // Vincenzo Librandi, Nov 30 2011
    
  • Mathematica
    Select[Table[n^2+5,{n,0,7000}],PrimeQ] (* Vincenzo Librandi, Nov 30 2011 *)
  • PARI
    is(n) = ispseudoprime(n) && issquare(n-5) \\ Felix Fröhlich, May 25 2018

Formula

a(n) = 36 * A056906(n) + 5.

A056909 Primes of the form k^2+6.

Original entry on oeis.org

7, 31, 127, 367, 631, 967, 1231, 3727, 4231, 6247, 7927, 8287, 11887, 17167, 21031, 22807, 30631, 34231, 39607, 48847, 72367, 108247, 109567, 126031, 160807, 185767, 198031, 231367, 235231, 261127, 265231, 279847, 290527, 323767, 354031, 366031, 373327, 421207
Offset: 1

Views

Author

Henry Bottomley, Jul 07 2000

Keywords

Comments

a(n) mod 120 = 7 or 31 for all n.

Examples

			a(2)=127 since 11^2+6=127 which is prime.
		

Crossrefs

Programs

  • Magma
    [a: n in [0..700] | IsPrime(a) where a is n^2+6]; // Vincenzo Librandi, Nov 30 2011
    
  • Mathematica
    Intersection[Table[n^2+6,{n,0,10^2}],Prime[Range[9*10^3]]] (* or *) For[i=6,i<=6,a={};Do[If[PrimeQ[n^2+i],AppendTo[a,n^2+i]],{n,0,100}];Print["n^2+",i,",",a];i++ ] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    Select[Table[n^2+6,{n,0,7000}],PrimeQ] (* Vincenzo Librandi, Nov 30 2011 *)
  • PARI
    list(lim)=my(v=List(),t); forstep(k=1,sqrtint(lim\1-6),2, if(isprime(t=k^2+6), listput(v,t))); Vec(v) \\ Charles R Greathouse IV, Nov 06 2024

Formula

a(n) = 36*A056910(n)^2 + 12*A056910(n) + 7.
a(n) >> n^2 log n. - Charles R Greathouse IV, Nov 06 2024

A056904 Floor[p/24] where p is a prime which is 4 more than a square.

Original entry on oeis.org

0, 0, 1, 2, 7, 9, 12, 30, 45, 51, 57, 84, 92, 135, 176, 187, 222, 301, 315, 376, 392, 442, 551, 570, 651, 759, 782, 900, 1001, 1107, 1162, 1305, 1395, 1552, 1717, 1785, 1926, 1962, 2262, 2301, 2460, 2501, 2667, 2709, 2926, 2970, 3151, 3197, 3432, 3577, 3825
Offset: 0

Views

Author

Henry Bottomley, Jul 06 2000

Keywords

Examples

			a(2)=1 since 29 is a prime which is four more than a square and floor[29/24]=1
		

Crossrefs

a(n) is contained in A001840. A005473(n)=24*a(n)+m, where m=13 if a(n) is three times a triangular number (and n>0) i.e. in A045943 and m=5 if A056904(n) is not three times a triangular number (or n=0) i.e. in A001318.

Programs

  • Mathematica
    Join[{0},Floor[#/24]&/@Select[Prime[Range[10000]],#-Floor[Sqrt[#]]^2 == 4&]] (* Harvey P. Dale, Oct 25 2011 *)
    With[{nn=400},Floor[#/24]&/@Select[Range[nn]^2+4,PrimeQ]] (* Harvey P. Dale, Dec 02 2021 *)

Formula

a(n) =floor[A005473(n)/24]

A242332 Numbers k such that k^2 + 4 is a semiprime.

Original entry on oeis.org

0, 9, 19, 21, 23, 25, 31, 41, 43, 51, 53, 55, 63, 69, 71, 75, 77, 79, 83, 91, 93, 105, 107, 109, 113, 119, 123, 129, 131, 133, 143, 145, 149, 151, 153, 157, 165, 171, 173, 175, 181, 185, 187, 191, 195, 197, 201, 209, 221, 223, 225, 227, 241, 249, 251, 257, 259
Offset: 1

Views

Author

Vincenzo Librandi, May 14 2014

Keywords

Comments

The semiprimes of this form are: 4, 85, 365, 445, 533, 629, 965, 1685, 1853, 2605, 2813, 3029, 3973, 4765, 5045, 5629, 5933, 6245, ...

Crossrefs

Programs

  • Magma
    IsSemiprime:=func; [n: n in [0..300] | IsSemiprime(s) where s is n^2+4];
  • Mathematica
    Select[Range[0, 300], PrimeOmega[#^2 + 4] == 2 &]

A138353 Primes of the form k^2 + 9.

Original entry on oeis.org

13, 73, 109, 409, 1033, 1453, 1609, 2713, 3373, 3853, 4909, 6733, 7753, 9613, 10009, 12109, 12553, 13933, 19609, 20173, 25609, 28909, 35353, 36109, 40009, 40813, 44953, 47533, 48409, 58573, 88813, 94873, 102409, 110233, 122509, 128173, 135433
Offset: 1

Author

Keywords

Comments

It is easy to show that k mod 12 must be 2,4,8,10 and that since k^2 mod 12 = 4, then p mod 12 = 1. In base 12, the sequence is 11, 61, 91, 2X1, 721, X11, E21, 16X1, 1E51, 2291, 2X11, 3X91, 45X1, 5691, 5961, 7011, 7321, 8091, E421, E811, 129X1, where X is for 10, E is for 11. - Walter Kehowski, May 31 2008

Crossrefs

Subsequence of A185086.

Programs

  • Haskell
    a138353 n = a138353_list
    a138353_list = filter ((== 1) . a010051') $ map (+ 9) a000290_list
    -- Reinhard Zumkeller, Mar 12 2012
    
  • Magma
    [ a: n in [0..900] | IsPrime(a) where a is n^2+9] // Vincenzo Librandi, Nov 24 2010
    
  • Mathematica
    Intersection[Table[n^2+9,{n,0,10^2}],Prime[Range[9*10^3]]] ...or... For[i=9,i<=9,a={};Do[If[PrimeQ[n^2+i],AppendTo[a,n^2+i]],{n,0,100}];Print["n^2+",i,",",a];i++ ]
    Select[Range[400]^2+9,PrimeQ] (* Harvey P. Dale, Jan 31 2017 *)
  • PARI
    is(n)=isprime(n) && issquare(n-9) \\ Charles R Greathouse IV, Aug 21 2017

Extensions

More terms from Vincenzo Librandi, Apr 28 2010

A056908 Numbers k such that 36*k^2 + 36*k + 13 is prime.

Original entry on oeis.org

0, 2, 4, 5, 7, 9, 14, 19, 22, 24, 29, 30, 34, 40, 42, 44, 50, 59, 62, 70, 72, 74, 75, 79, 80, 82, 84, 95, 102, 110, 119, 125, 132, 135, 139, 149, 150, 157, 160, 165, 172, 180, 197, 199, 200, 209, 210, 212, 224, 225, 227, 229, 230, 232, 235, 240, 244, 249
Offset: 1

Author

Henry Bottomley, Jul 07 2000

Keywords

Comments

36*k^2 + 36*k + 13 = (6*k+3)^2 + 4, which is 4 more than a square.

Examples

			a(2)=4 since 36*4^2 + 36*4 + 13 = 733, which is prime (as well as being four more than a square).
		

Crossrefs

This sequence and formula, together with A056907 and its formula, generate all primes of the form k^2+4, i.e., A005473.

Programs

Showing 1-10 of 18 results. Next