login
Search: a005473 -id:a005473
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) = 4*(n+1)*n + 5.
+10
53
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
OFFSET
0,1
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
REFERENCES
L. B. W. Jolley, "Summation of Series", Dover Publications, 1961, p. 176.
FORMULA
a(n) = (2n + 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
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 *)
PROG
(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
(Magma) [4*n^2+4*n+5 : n in [0..80]]; // Wesley Ivan Hurt, Aug 29 2022
CROSSREFS
Subsequence of A077426 (D values (not a square) for which Pell x^2 - D*y^2 = -4 is solvable in positive integers).
Cf. A005473.
Cf. A016754.
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Nov 29 2002
EXTENSIONS
More terms from Max Alekseyev, Mar 03 2010
STATUS
approved
Length of the period of the continued fraction of (1+sqrt(n))/2.
+10
40
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,2
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.
LINKS
FORMULA
a(n) = 0 iff n is a square (A000290). - Robert G. Wilson v, Apr 11 2017
EXAMPLE
a(2) = 2 because continued fraction of (1+sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has period (1,4) length 2.
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 *)
KEYWORD
nonn
AUTHOR
Artur Jasinski, Oct 30 2008
EXTENSIONS
a(39) and a(68) corrected by R. J. Mathar, Sep 06 2009
STATUS
approved
Primes of the form p^2 + 4, where p is prime.
+10
22
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,1
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
LINKS
Yang Ji, Several special cases of a square problem, arXiv:2105.05250 [math.GM], 2021.
FORMULA
a(n) = A062324(n)^2 + 4. - Zak Seidov, Nov 06 2013
EXAMPLE
29 belongs to the sequence because it equals 5^2 + 4.
MATHEMATICA
Select[Prime[ # ]^2+4&/@Range[140], PrimeQ]
PROG
(PARI) forprime(p=2, 1e4, if(isprime(t=p^2+4), print1(t", "))) \\ Charles R Greathouse IV, Jul 04 2011
CROSSREFS
The corresponding primes p are in A062324.
Subsequence of A005473 (and thus A185086).
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by Dean Hickerson, Dec 10 2002
STATUS
approved
Primes of the form k^2 + 5.
+10
9
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,1
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.
LINKS
Eric Weisstein's World of Mathematics, Near-Square Prime
FORMULA
a(n) = 36 * A056906(n) + 5.
EXAMPLE
a(2)=149 since 12^2 + 5 = 149, which is prime.
MATHEMATICA
Select[Table[n^2+5, {n, 0, 7000}], PrimeQ] (* Vincenzo Librandi, Nov 30 2011 *)
PROG
(Magma) [a: n in [0..700] | IsPrime(a) where a is n^2+5]; // Vincenzo Librandi, Nov 30 2011
(PARI) is(n) = ispseudoprime(n) && issquare(n-5) \\ Felix Fröhlich, May 25 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jul 07 2000
STATUS
approved
Primes of the form k^2+6.
+10
6
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
OFFSET
1,1
COMMENTS
a(n) mod 120 = 7 or 31 for all n.
LINKS
FORMULA
a(n) = 36*A056910(n)^2 + 12*A056910(n) + 7.
EXAMPLE
a(2)=127 since 11^2+6=127 which is prime.
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 *)
PROG
(Magma) [a: n in [0..700] | IsPrime(a) where a is n^2+6]; // Vincenzo Librandi, Nov 30 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jul 07 2000
STATUS
approved
Floor[p/24] where p is a prime which is 4 more than a square.
+10
5
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,4
FORMULA
a(n) =floor[A005473(n)/24]
EXAMPLE
a(2)=1 since 29 is a prime which is four more than a square and floor[29/24]=1
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 *)
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.
KEYWORD
nonn
AUTHOR
Henry Bottomley, Jul 06 2000
STATUS
approved
Numbers k such that k^2 + 4 is a semiprime.
+10
5
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,2
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, ...
LINKS
MATHEMATICA
Select[Range[0, 300], PrimeOmega[#^2 + 4] == 2 &]
PROG
(Magma) IsSemiprime:=func<i | &+[d[2]: d in Factorization(i)] eq 2>; [n: n in [0..300] | IsSemiprime(s) where s is n^2+4];
KEYWORD
nonn
AUTHOR
Vincenzo Librandi, May 14 2014
STATUS
approved
Primes of the form k^2 + 9.
+10
4
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,1
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
LINKS
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 *)
PROG
(Magma) [ a: n in [0..900] | IsPrime(a) where a is n^2+9] // Vincenzo Librandi, Nov 24 2010
(Haskell)
a138353 n = a138353_list
a138353_list = filter ((== 1) . a010051') $ map (+ 9) a000290_list
-- Reinhard Zumkeller, Mar 12 2012
(PARI) is(n)=isprime(n) && issquare(n-9) \\ Charles R Greathouse IV, Aug 21 2017
CROSSREFS
Subsequence of A185086.
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Vincenzo Librandi, Apr 28 2010
STATUS
approved
Numbers k such that 36*k^2 + 36*k + 13 is prime.
+10
3
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,2
COMMENTS
36*k^2 + 36*k + 13 = (6*k+3)^2 + 4, which is 4 more than a square.
LINKS
EXAMPLE
a(2)=4 since 36*4^2 + 36*4 + 13 = 733, which is prime (as well as being four more than a square).
MATHEMATICA
Select[Range[0, 700], PrimeQ[36#^2+36#+13]&] (* Vincenzo Librandi, Jul 14 2012 *)
PROG
(Magma) [n: n in [0..70]| IsPrime(36*n^2+36*n+13)]; // Vincenzo Librandi, Jul 14 2012
(PARI) is(n)=isprime(36*n^2+36*n+13) \\ Charles R Greathouse IV, Mar 01 2017
CROSSREFS
This sequence and formula, together with A056907 and its formula, generate all primes of the form k^2+4, i.e., A005473.
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jul 07 2000
STATUS
approved
a(n) is the smallest prime p such that p-n is a nonzero square.
+10
3
2, 3, 7, 5, 41, 7, 11, 17, 13, 11, 47, 13, 17, 23, 19, 17, 53, 19, 23, 29, 37, 23, 59, 73, 29, 107, 31, 29, 173, 31, 47, 41, 37, 43, 71, 37, 41, 47, 43, 41, 617, 43, 47, 53, 61, 47, 83, 73, 53, 59, 67, 53, 89, 79, 59, 137, 61, 59, 383, 61, 97, 71, 67, 73, 101, 67, 71, 149, 73
OFFSET
1,1
FORMULA
a(n) = min{p : p - n = x^2 for some x > 0, p is prime}.
Does a(n) exist for all n? - Jianing Song, Feb 04 2019
EXAMPLE
For n = 17, let P = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,...} be the set of primes, then P - 17 = {-15,...,-4,0,2,6,12,14,20,24,26,30,36,...}. The first positive square in P - 17 is 36 with p = 53, so a(17) = 53. The square arising here is usually 1.
MAPLE
SearchLimit := 100;
for n from 1 to 400 do
k := 0: c := true:
while(c and k < SearchLimit) do
k := k + 1:
c := not isprime(k^2+n):
end do:
if k = SearchLimit then error("Search limit reached!") fi;
a[n] := k^2 + n end do: seq(a[j], j=1..400);
# Edited and SearchLimit introduced by Peter Luschny, Feb 05 2019
MATHEMATICA
spsq[n_]:=Module[{p=NextPrime[n]}, While[!IntegerQ[Sqrt[p-n]], p= NextPrime[ p]]; p]; Array[spsq, 70] (* Harvey P. Dale, Nov 10 2017 *)
PROG
(PARI) for(n=1, 100, for(k=1, 100, if(isprime(k^2+n), print1(k^2+n, ", "); break()))) \\ Jianing Song, Feb 04 2019
(PARI) a(n) = forprime(p=n, , if ((p-n) && issquare(p-n), return (p))); \\ Michel Marcus, Feb 05 2019
CROSSREFS
These terms arise in A002496, A056899, A049423, A005473, A056905, A056909 as first or 2nd entries depending on offset.
Cf. A056896 (where p-n can be 0).
KEYWORD
nonn
AUTHOR
Labos Elemer, Feb 26 2001
STATUS
approved

Search completed in 0.090 seconds