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

A003500 a(n) = 4*a(n-1) - a(n-2) with a(0) = 2, a(1) = 4.

Original entry on oeis.org

2, 4, 14, 52, 194, 724, 2702, 10084, 37634, 140452, 524174, 1956244, 7300802, 27246964, 101687054, 379501252, 1416317954, 5285770564, 19726764302, 73621286644, 274758382274, 1025412242452, 3826890587534, 14282150107684, 53301709843202, 198924689265124
Offset: 0

Views

Author

Keywords

Comments

a(n) gives values of x satisfying x^2 - 3*y^2 = 4; corresponding y values are given by 2*A001353(n).
If M is any given term of the sequence, then the next one is 2*M + sqrt(3*M^2 - 12). - Lekraj Beedassy, Feb 18 2002
For n > 0, the three numbers a(n) - 1, a(n), and a(n) + 1 form a Fleenor-Heronian triangle, i.e., a Heronian triangle with consecutive sides, whose area A(n) may be obtained from the relation [4*A(n)]^2 = 3([a(2n)]^2 - 4); or A(n) = 3*A001353(2*n)/2 and whose semiperimeter is 3*a[n]/2. The sequence is symmetrical about a[0], i.e., a[-n] = a[n].
For n > 0, a(n) + 2 is the number of dimer tilings of a 2*n X 2 Klein bottle (cf. A103999).
Tsumura shows that, for prime p, a(p) is composite (contrary to a conjecture of Juricevic). - Charles R Greathouse IV, Apr 13 2010
Except for the first term, positive values of x (or y) satisfying x^2 - 4*x*y + y^2 + 12 = 0. - Colin Barker, Feb 04 2014
Except for the first term, positive values of x (or y) satisfying x^2 - 14*x*y + y^2 + 192 = 0. - Colin Barker, Feb 16 2014
A268281(n) - 1 is a member of this sequence iff A268281(n) is prime. - Frank M Jackson, Feb 27 2016
a(n) gives values of x satisfying 3*x^2 - 4*y^2 = 12; corresponding y values are given by A005320. - Sture Sjöstedt, Dec 19 2017
Middle side lengths of almost-equilateral Heronian triangles. - Wesley Ivan Hurt, May 20 2020
For all elements k of the sequence, 3*(k-2)*(k+2) is a square. - Davide Rotondo, Oct 25 2020

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 82.
  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p.91.
  • Michael P. Cohen, Generating Heronian Triangles With Consecutive Integer Sides. Journal of Recreational Mathematics, vol. 30 no. 2 1999-2000 p. 123.
  • L. E. Dickson, History of The Theory of Numbers, Vol. 2 pp. 197;198;200;201. Chelsea NY.
  • Charles R. Fleenor, Heronian Triangles with Consecutive Integer Sides, Journal of Recreational Mathematics, Volume 28, no. 2 (1996-7) 113-115.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley. Enumerative combinatorics. Vol. 2, volume 62 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1999.
  • V. D. To, "Finding All Fleenor-Heronian Triangles", Journal of Recreational Mathematics vol. 32 no.4 2003-4 pp. 298-301 Baywood NY.

Crossrefs

Cf. A011945 (areas), A334277 (perimeters).
Cf. this sequence (middle side lengths), A016064 (smallest side lengths), A335025 (largest side lengths).

Programs

  • Haskell
    a003500 n = a003500_list !! n
    a003500_list = 2 : 4 : zipWith (-)
       (map (* 4) $ tail a003500_list) a003500_list
    -- Reinhard Zumkeller, Dec 17 2011
    
  • Magma
    I:=[2,4]; [n le 2 select I[n] else 4*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 14 2018
  • Maple
    A003500 := proc(n) option remember; if n <= 1 then 2*n+2 else 4*procname(n-1)-procname(n-2); fi;
    end proc;
  • Mathematica
    a[0]=2; a[1]=4; a[n_]:= a[n]= 4a[n-1] -a[n-2]; Table[a[n], {n, 0, 23}]
    LinearRecurrence[{4,-1},{2,4},30] (* Harvey P. Dale, Aug 20 2011 *)
    Table[Round@LucasL[2n, Sqrt[2]], {n, 0, 20}] (* Vladimir Reshetnikov, Sep 15 2016 *)
  • PARI
    x='x+O('x^99); Vec(-2*(-1+2*x)/(1-4*x+x^2)) \\ Altug Alkan, Apr 04 2016
    
  • Sage
    [lucas_number2(n,4,1) for n in range(0, 24)] # Zerinvary Lajos, May 14 2009
    

Formula

a(n) = ( 2 + sqrt(3) )^n + ( 2 - sqrt(3) )^n.
a(n) = 2*A001075(n).
G.f.: 2*(1 - 2*x)/(1 - 4*x + x^2). Simon Plouffe in his 1992 dissertation.
a(n) = A001835(n) + A001835(n+1).
a(n) = trace of n-th power of the 2 X 2 matrix [1 2 / 1 3]. - Gary W. Adamson, Jun 30 2003 [corrected by Joerg Arndt, Jun 18 2020]
From the addition formula, a(n+m) = a(n)*a(m) - a(m-n), it is easy to derive multiplication formulas, such as: a(2*n) = (a(n))^2 - 2, a(3*n) = (a(n))^3 - 3*(a(n)), a(4*n) = (a(n))^4 - 4*(a(n))^2 + 2, a(5*n) = (a(n))^5 - 5*(a(n))^3 + 5*(a(n)), a(6*n) = (a(n))^6 - 6*(a(n))^4 + 9*(a(n))^2 - 2, etc. The absolute values of the coefficients in the expansions are given by the triangle A034807. - John Blythe Dobson, Nov 04 2007
a(n) = 2*A001353(n+1) - 4*A001353(n). - R. J. Mathar, Nov 16 2007
From Peter Bala, Jan 06 2013: (Start)
Let F(x) = Product_{n=0..infinity} (1 + x^(4*n + 1))/(1 + x^(4*n + 3)). Let alpha = 2 - sqrt(3). This sequence gives the simple continued fraction expansion of 1 + F(alpha) = 2.24561 99455 06551 88869 ... = 2 + 1/(4 + 1/(14 + 1/(52 + ...))). Cf. A174500.
Also F(-alpha) = 0.74544 81786 39692 68884 ... has the continued fraction representation 1 - 1/(4 - 1/(14 - 1/(52 - ...))) and the simple continued fraction expansion 1/(1 + 1/((4 - 2) + 1/(1 + 1/((14 - 2) + 1/(1 + 1/((52 - 2) + 1/(1 + ...))))))).
F(alpha)*F(-alpha) has the simple continued fraction expansion 1/(1 + 1/((4^2 - 4) + 1/(1 + 1/((14^2 - 4) + 1/(1 + 1/((52^2 - 4) + 1/(1 + ...))))))).
(End)
a(2^n) = A003010(n). - John Blythe Dobson, Mar 10 2014
a(n) = [x^n] ( (1 + 4*x + sqrt(1 + 8*x + 12*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
E.g.f.: 2*exp(2*x)*cosh(sqrt(3)*x). - Ilya Gutkovskiy, Apr 27 2016
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*n*(n - k - 1)!/(k!*(n - 2*k)!)*4^(n - 2*k) for n >= 1. - Peter Luschny, May 10 2016
From Peter Bala, Oct 15 2019: (Start)
a(n) = trace(M^n), where M is the 2 X 2 matrix [0, 1; -1, 4].
Consequently the Gauss congruences hold: a(n*p^k) = a(n*p^(k-1)) ( mod p^k ) for all prime p and positive integers n and k. See Zarelua and also Stanley (Ch. 5, Ex. 5.2(a) and its solution).
2*Sum_{n >= 1} 1/( a(n) - 6/a(n) ) = 1.
6*Sum_{n >= 1} (-1)^(n+1)/( a(n) + 2/a(n) ) = 1.
8*Sum_{n >= 1} 1/( a(n) + 24/(a(n) - 12/(a(n))) ) = 1.
8*Sum_{n >= 1} (-1)^(n+1)/( a(n) + 8/(a(n) + 4/(a(n))) ) = 1.
Series acceleration formulas for sums of reciprocals:
Sum_{n >= 1} 1/a(n) = 1/2 - 6*Sum_{n >= 1} 1/(a(n)*(a(n)^2 - 6)),
Sum_{n >= 1} 1/a(n) = 1/8 + 24*Sum_{n >= 1} 1/(a(n)*(a(n)^2 + 12)),
Sum_{n >= 1} (-1)^(n+1)/a(n) = 1/6 + 2*Sum_{n >= 1} (-1)^(n+1)/(a(n)*(a(n)^2 + 2)) and
Sum_{n >= 1} (-1)^(n+1)/a(n) = 1/8 + 8*Sum_{n >= 1} (-1)^(n+1)/(a(n)*(a(n)^2 + 12)).
Sum_{n >= 1} 1/a(n) = ( theta_3(2-sqrt(3))^2 - 1 )/4 = 0.34770 07561 66992 06261 .... See Borwein and Borwein, Proposition 3.5 (i), p.91.
Sum_{n >= 1} (-1)^(n+1)/a(n) = ( 1 - theta_3(sqrt(3)-2)^2 )/4. Cf. A003499 and A153415. (End)
a(n) = tan(Pi/12)^n + tan(5*Pi/12)^n. - Greg Dresden, Oct 01 2020
From Wolfdieter Lang, Sep 06 2021: (Start)
a(n) = S(n, 4) - S(n-2, 4) = 2*T(n, 2), for n >= 0, with S and T Chebyshev polynomials, with S(-1, x) = 0 and S(-2, x) = -1. S(n, 4) = A001353(n+1), for n >= -1, and T(n, 2) = A001075(n).
a(2*k) = A067902(k), a(2*k+1) = 4*A001570(k+1), for k >= 0. (End)
a(n) = sqrt(2 + 2*A011943(n+1)) = sqrt(2 + 2*A102344(n+1)), n>0. - Ralf Steiner, Sep 23 2021
Sum_{n>=1} arctan(3/a(n)^2) = Pi/6 - arctan(1/3) = A019673 - A105531 (Ohtskua, 2024). - Amiram Eldar, Aug 29 2024

Extensions

More terms from James Sellers, May 03 2000
Additional comments from Lekraj Beedassy, Feb 14 2002

A051783 Numbers k such that 3^k + 2 is prime.

Original entry on oeis.org

0, 1, 2, 3, 4, 8, 10, 14, 15, 24, 26, 36, 63, 98, 110, 123, 126, 139, 235, 243, 315, 363, 386, 391, 494, 1131, 1220, 1503, 1858, 4346, 6958, 7203, 10988, 22316, 33508, 43791, 45535, 61840, 95504, 101404, 106143, 107450, 136244, 178428, 361608, 504206, 1753088
Offset: 1

Views

Author

Jud McCranie, Dec 09 1999

Keywords

Comments

From Farideh Firoozbakht and M. F. Hasler, Dec 06 2009: (Start)
If Q is a perfect number such that gcd(Q, 3(3^a(n) + 2)) = 1, then x = 3^(a(n) - 1)*(3^a(n) + 2)*Q is a solution of the equation sigma(x) = 3(x - Q). This is a result of the following theorem:
Theorem: If Q is a (q-1)-perfect number for some prime q, then for all integers t, the equation sigma(x) = q*x - (2t+1)*Q has the solution x = q^(k-1)*p*Q whenever k is a positive integer such that p = q^k + 2t is prime, gcd(q^(k-1), p) = 1 and gcd(q^(k-1)*p,Q) = 1.
Note that by taking t = -1/2(m*q+1), this theorem gives us some solutions of the equation sigma(x) = q *(x + m*Q). See comment lines of the sequence A058959. (End)
No further terms < 200000. - Ray Chandler, Jul 31 2011
A090649 implies that 361608 is a member of this sequence. - Robert Price, Aug 18 2014
No further terms < 320000. - Luke W. Richards, Mar 04 2018
a(45) and a(46) are probable primes because a primality certificate has not yet been found. They have been verified PRP with mprime. - Luke W. Richards, May 04 2018
No further terms < 1300000. - Luke W. Richards, May 17 2018
No further terms < 1400000. - Luke W. Richards, Jul 28 2020
Conjecture: The number n = 3^k + 2 is prime if and only if 2^((n-1)/2) == -1 (mod n). - Maheswara Rao Valluri, Jun 01 2020. [Note that this is an if and only if assertion, so it does not follow from Fermat's Little Theorem. - N. J. A. Sloane, Sep 07 2020]

Examples

			3^8 + 2 = 6563 is prime, so 8 is in the sequence.
3^26 + 2 = 2541865828331, a prime number, so 26 is in the sequence.
		

Crossrefs

Programs

Extensions

{4346, 6958, 7203} from David J. Rusin, Sep 29 2000
10988 from Ray Chandler, Nov 21 2004
{22316, 33508} found by Henri Lifchitz, Sep-Oct 2002
{43791, 45535, 61840} found by Henri Lifchitz, Oct-Nov 2004
95504 found by Wojciech Florek Dec 15 2005. - Alexander Adamchuk, Mar 02 2008
Edited by N. J. A. Sloane, Dec 19 2009
{101404, 106143, 107450, 136244} from Mike Oakes, Nov 2009
178428 from Ray Chandler, Jul 29 2011
a(45)-a(46) from Luke W. Richards, May 04 2018
a(47) from Paul Bourdelais, Mar 29 2022

A005935 Pseudoprimes to base 3.

Original entry on oeis.org

91, 121, 286, 671, 703, 949, 1105, 1541, 1729, 1891, 2465, 2665, 2701, 2821, 3281, 3367, 3751, 4961, 5551, 6601, 7381, 8401, 8911, 10585, 11011, 12403, 14383, 15203, 15457, 15841, 16471, 16531, 18721, 19345, 23521, 24046, 24661, 24727, 28009, 29161
Offset: 1

Views

Author

Keywords

Comments

Theorem: If q>3 and both numbers q and (2q-1) are primes then n=q*(2q-1) is a pseudoprime to base 3 (i.e. n is in the sequence). So for n>2, A005382(n)*(2*A005382(n)-1) is in the sequence (see Comments lines for the sequence A122780). 91,703,1891,2701,12403,18721,38503,49141... are such terms. This sequence is a subsequence of A122780. - Farideh Firoozbakht, Sep 13 2006
Composite numbers n such that 3^(n-1) == 1 (mod n).
Theorem (R. Steuerwald, 1948): if n is a pseudoprime to base b and gcd(n,b-1)=1, then (b^n-1)/(b-1) is a pseudoprime to base b. In particular, if n is an odd pseudoprime to base 3, then (3^n-1)/2 is a pseudoprime to base 3. - Thomas Ordowski, Apr 06 2016
Steuerwald's theorem can be strengthened by weakening his assumption as follows: if n is a weak pseudoprime to base b and gcd(n,b-1)=1, then ... - Thomas Ordowski, Feb 23 2021

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 91, p. 33, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Number Theory, A12.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Pseudoprimes to other bases: A001567 (2), A005936 (5), A005937 (6), A005938 (7), A005939 (10).
Subsequence of A122780.
Cf. A005382.

Programs

  • Mathematica
    base = 3; t = {}; n = 1; While[Length[t] < 100, n++; If[! PrimeQ[n] && PowerMod[base, n-1, n] == 1, AppendTo[t, n]]]; t (* T. D. Noe, Feb 21 2012 *)
  • PARI
    is_A005935(n)={Mod(3,n)^(n-1)==1 & !ispseudoprime(n) & n>1}  \\ M. F. Hasler, Jul 19 2012

Extensions

More terms from David W. Wilson, Aug 15 1996

A014117 Numbers n such that m^(n+1) == m (mod n) holds for all m.

Original entry on oeis.org

1, 2, 6, 42, 1806
Offset: 1

Views

Author

Keywords

Comments

"Somebody incorrectly remembered Fermat's little theorem as saying that the congruence a^{n+1} = a (mod n) holds for all a if n is prime" (Zagier). The sequence gives the set of integers n for which this property is in fact true.
If i == j (mod n), then m^i == m^j (mod n) for all m. The latter congruence generally holds for any (m, n)=1 with i == j (mod k), k being the order of m modulo n, i.e., the least power k for which m^k == 1 (mod n). - Lekraj Beedassy, Jul 04 2002
Also, numbers n such that n divides denominator of the n-th Bernoulli number B(n) (cf. A106741). Also, numbers n such that 1^n + 2^n + 3^n + ... + n^n == 1 (mod n). Equivalently, numbers n such that B(n)*n == 1 (mod n). Equivalently, Sum_{prime p, (p-1) divides n} n/p == -1 (mod n). It is easy to see that for n > 1, n must be an even squarefree number. Moreover, the set P of prime divisors of all such n satisfies the property: if p is in P, then p-1 is the product of distinct elements of P. This set is P = {2, 3, 7, 43}, implying that the sequence is finite and complete. - Max Alekseyev, Aug 25 2013
In 2005, B. C. Kellner proved E. W. Weisstein's conjecture that denom(B_n) = n only if n = 1806. - Jonathan Sondow, Oct 14 2013
Squarefree numbers n such that b^n == 1 (mod n^2) for every b coprime to n. Squarefree terms of A341858. - Thomas Ordowski, Aug 05 2024
Conjecture: Numbers n such that gcd(d+1, n) > 1 for every proper divisor d of n. Verified up to 10^696. - David Radcliffe, May 29 2025

Crossrefs

Squarefree terms of A124240. - Robert Israel and Thomas Ordowski, Jun 23 2017

Programs

  • Mathematica
    r[n_] := Reduce[ Mod[m^(n+1) - m, n] == 0, m, Integers]; ok[n_] := Range[n]-1 === Simplify[ Mod[ Flatten[ m /. {ToRules[ r[n][[2]] ]}], n], Element[C[1], Integers]]; ok[1] = True; A014117 = {}; Do[ If[ok[n], Print[n]; AppendTo[ A014117, n] ], {n, 1, 2000}] (* Jean-François Alcover, Dec 21 2011 *)
    Select[Range@ 2000, Function[n, Times @@ Boole@ Map[Function[m, PowerMod[m, n + 1, n] == Mod[m, n]], Range@ n] > 0]] (* Michael De Vlieger, Dec 30 2016 *)
  • Python
    [n for n in range(1, 2000) if all(pow(m, n+1, n) == m for m in range(n))] # David Radcliffe, May 29 2025

Formula

For n <= 5, a(n) = a(n-1)^2 + a(n-1) with a(0) = 1. - Raphie Frank, Nov 12 2012
a(n+1) = A007018(n) = A054377(n) = A100016(n) for n = 1, 2, 3, 4. - Jonathan Sondow, Oct 01 2013

A073817 Tetranacci numbers with different initial conditions: a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4) starting with a(0)=4, a(1)=1, a(2)=3, a(3)=7.

Original entry on oeis.org

4, 1, 3, 7, 15, 26, 51, 99, 191, 367, 708, 1365, 2631, 5071, 9775, 18842, 36319, 70007, 134943, 260111, 501380, 966441, 1862875, 3590807, 6921503, 13341626, 25716811, 49570747, 95550687, 184179871, 355018116, 684319421, 1319068095, 2542585503
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Aug 12 2002

Keywords

Comments

These tetranacci numbers follow the same pattern as Lucas and generalized tribonacci(A001644) numbers: Binet's formula is a(n) = r1^n + r2^n + r3^n + r4^n, with r1, r2, r3, r4 roots of the characteristic polynomial.
For n >= 4, a(n) is the number of cyclic sequences consisting of n zeros and ones that do not contain four consecutive ones provided the positions of the zeros and ones are fixed on a circle. This is proved in Charalambides (1991) and Zhang and Hadjicostas (2015). For example, a(4)=15 because only the sequences 1110, 1101, 1011, 0111, 0011, 0101, 1001, 1010, 0110, 1100, 0001, 0010, 0100, 1000, 0000 avoid four consecutive ones on a circle. (For n=1,2,3 the statement is still true provided we allow the sequence to wrap around itself on a circle. For example, a(2)=3 because only the sequences 00, 01, 10 avoid four consecutive ones when wrapped around on a circle.) - Petros Hadjicostas, Dec 18 2016

Crossrefs

Cf. A000078, A001630, A001644, A000032, A106295 (Pisano periods). Two other versions: A001648, A074081.

Programs

  • GAP
    a:=[4,1,3,7];; for n in [5..40] do a[n]:=a[n-1]+a[n-2]+a[n-3] +a[n-4]; od; a; # G. C. Greubel, Feb 19 2019
  • Magma
    I:=[4,1,3,7]; [n le 4 select I[n] else Self(n-1) +Self(n-2) +Self(n-3) +Self(n-4): n in [1..40]]; // G. C. Greubel, Feb 19 2019
    
  • Mathematica
    a[0]=4; a[1]=1; a[2]=3; a[3]=7; a[4]=15; a[n_]:= 2*a[n-1] -a[n-5]; Array[a, 34, 0]
    CoefficientList[Series[(4-3x-2x^2-x^3)/(1-x-x^2-x^3-x^4), {x, 0, 40}], x]
    LinearRecurrence[{1,1,1,1},{4,1,3,7},40] (* Harvey P. Dale, Jun 01 2015 *)
  • PARI
    Vec((4-3*x-2*x^2-x^3)/(1-x-x^2-x^3-x^4) + O(x^40)) \\ Michel Marcus, Jan 29 2016
    
  • Sage
    ((4-3*x-2*x^2-x^3)/(1-x-x^2-x^3-x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Feb 19 2019
    

Formula

G.f.: (4 - 3*x - 2*x^2 - x^3)/(1 - x - x^2 - x^3 - x^4).
a(n) = 2*a(n-1) - a(n-5), with a(0)=4, a(1)=1, a(2)=3, a(3)=7, a(4)=15. - Vincenzo Librandi, Dec 20 2010
a(n) = A000078(n+2) + 2*A000078(n+1) + 3*A000078(n) + 4*A000078(n-1). - Advika Srivastava, Aug 22 2019
a(n) = 8*a(n-3) - a(n-5) - 2*a(n-6) - 4*a(n-7). - Advika Srivastava, Aug 25 2019
a(n) = Trace(M^n), where M is the 4 X 4 matrix [0, 0, 0, 1; 1, 0, 0, 1; 0, 1, 0, 1; 0, 0, 1, 1], the companion matrix to the monic polynomial x^4 - x^3 - x^2 - x - 1. It follows that the sequence satisfies the Gauss congruences: a(n*p^r) == a(n*p^(r-1)) (mod p^r) for positive integers n and r and all primes p. See Zarelua. - Peter Bala, Dec 31 2022
a(n) = Sum_{r root of x^4-x^3-x^2-x-1} r^n. - Fabian Pereyra, Feb 28 2025

Extensions

Typo in definition corrected by Vincenzo Librandi, Dec 20 2010

A056854 a(n) = Lucas(4*n).

Original entry on oeis.org

2, 7, 47, 322, 2207, 15127, 103682, 710647, 4870847, 33385282, 228826127, 1568397607, 10749957122, 73681302247, 505019158607, 3461452808002, 23725150497407, 162614600673847, 1114577054219522, 7639424778862807, 52361396397820127, 358890350005878082, 2459871053643326447
Offset: 0

Views

Author

Barry E. Williams, Aug 29 2000

Keywords

Comments

a(n) and b(n) := A004187(n) are the nonnegative proper and improper solutions of the Pell equation a(n)^2 - 5*(3*b(n))^2 = +4. See the cross-reference to A004187 below. - Wolfdieter Lang, Jun 26 2013
Lucas numbers of the form n^2-2. - Michel Lagneau, Aug 11 2014

Examples

			Pell equation: n = 0, 2^2 - 45*0^2 = +4 (improper);  n = 1, 7^2 - 5*(3*1)^2 = +4; n=2, 47^2 - 5*(3*7)^2 = +4. - _Wolfdieter Lang_, Jun 26 2013
		

References

  • R. P. Stanley. Enumerative combinatorics. Vol. 2, volume 62 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1999.

Crossrefs

Cf. quadrisection of A000032: this sequence (first), A056914 (second), A246453 (third, without 11), A288913 (fourth).
Cf. Lucas(k*n): A000032 (k = 1), A005248 (k = 2), A014448 (k = 3), A001946 (k = 5), A087215 (k = 6), A087281 (k = 7), A087265 (k = 8), A087287 (k = 9), A065705 (k = 10), A089772 (k = 11), A089775 (k = 12).

Programs

  • Magma
    [Lucas(4*n): n in [0..100]]; // Vincenzo Librandi, Apr 14 2011
  • Mathematica
    a[0] = 2; a[1] = 7; a[n_] := 7a[n - 1] - a[n - 2]; Table[ a[n], {n, 0, 19}] (* Robert G. Wilson v, Jan 30 2004 *)
    LinearRecurrence[{7,-1},{2,7},25] (* or *) LucasL[4*Range[0,25]] (* Harvey P. Dale, Aug 08 2011 *)
  • PARI
    a(n)=if(n<0,0,polsym(1-7*x+x^2,n)[n+1])
    
  • PARI
    a(n)=if(n<0,0,2*subst(poltchebi(n),x,7/2))
    
  • Sage
    [lucas_number2(n,7,1) for n in range(27)] #Zerinvary Lajos, Jun 25 2008
    

Formula

a(n) = 7*a(n-1) - a(n-2) with a(0)=2, a(1)=7.
a(n) = A000032(4*n), where A000032 = Lucas numbers.
a(n) = 7*S(n-1, 7) - 2*S(n-2, 7) = S(n, 7) - S(n-2, 7) = 2*T(n, 7/2), with S(n, x) := U(n, x/2), S(-1, x) := 0, S(-2, x) := -1. U(n, x), resp. T(n, x), are Chebyshev's polynomials of the second, resp. first, kind. S(n-1, 7) = A004187(n), n>=0. See A049310 and A053120.
a(n) = ((7+sqrt(45))/2)^n + ((7-sqrt(45))/2)^n.
G.f.: (2-7x)/(1-7x+x^2).
a(n) = A005248(2*n); bisection of A005248.
a(n) = Fibonacci(8*n)/Fibonacci(4*n), n>0. - Gary Detlefs, Dec 26 2010
a(n) = 2 + 5*Fibonacci(2*n)^2 = 2 + 5*A049684(n), n >= 0. This is in Koshy's book (reference under A065563) 15. on p. 88. Compare with the above Chebyshev T formula. - Wolfdieter Lang, Aug 27 2012
From Peter Bala, Jan 06 2013: (Start)
Let F(x) = Product_{n = 0..inf} (1 + x^(4*n+1))/(1 + x^(4*n+3)). Let alpha = 1/2*(7 - 3*sqrt(5)). This sequence gives the simple continued fraction expansion of 1 + F(alpha) = 2.14242 42709 40138 85949 ... = 2 + 1/(7 + 1/(47 + 1/(322 + ...))).
Also F(-alpha) = 0.85670 72882 04563 14901 ... has the continued fraction representation 1 - 1/(7 - 1/(47 - 1/(322 - ...))) and the simple continued fraction expansion 1/(1 + 1/((7-2) + 1/(1 + 1/((47-2) + 1/(1 + 1/((322-2) + 1/(1 + ...))))))). Cf. A005248.
F(alpha)*F(-alpha) has the simple continued fraction expansion 1/(1 + 1/((7^2-4) + 1/(1 + 1/((47^2-4) + 1/(1 + 1/((322^2-4) + 1/(1 + ...))))))).
Added Oct 13 2019: 1/2 + (1/2)*F(alpha)/F(-alpha) = 1.16675297774947414828... has the simple continued fraction expansion 1 + 1/((7 - 2) + 1/(1 + 1/((322 - 2) + 1/(1 + 1/(15127 - 2) + 1/(1 + ...))))). (End)
a(n) = Fibonacci(4*n+2) - Fibonacci(4*n-2), where Fibonacci(-2) = -1. - Bruno Berselli, May 25 2015
a(n) = sqrt(45*(A004187(n))^2+4).
From Peter Bala, Oct 13 2019: (Start)
a(n) = F(4*n+4)/F(4) - F(4*n-4)/F(4) = A004187(n+1) - A004187(n-1).
a(n) = trace(M^n), where M is the 2 X 2 matrix [0, 1; 1, 1]^4 = [2, 3; 3, 5].
Consequently the Gauss congruences hold: a(n*p^k) = a(n*p^(k-1)) (mod p^k) for all prime p and positive integers n and k. See Zarelua and also Stanley (Ch. 5, Ex. 5.2(a) and its solution).
5*Sum_{n >= 1} 1/(a(n) - 9/a(n)) = 1: (9 = Lucas(4)+2 and 5 = Lucas(4)-2)
9*Sum_{n >= 1} (-1)^(n+1)/(a(n) + 5/a(n)) = 1.
Sum_{n >= 1} 1/a(n) = (1/4)*( theta_3((7-3*sqrt(5))/2)^2 - 1 ), where theta_3(q) = 1 + 2*Sum_{n >= 1} q^n^2. Cf. A153415.
Sum_{n >= 1} (-1)^(n+1)/a(n) = (1/4)*( 1 - theta_3((3*sqrt(5)-7)/2)^2 ).
x*exp(Sum_{n >= 1} a(n)*x^/n) = x + 7*x^2 + 48*x^3 + 329*x^4 + ... is the o.g.f. for A004187. (End)
E.g.f.: 2*exp(7*x/2)*cosh(3*sqrt(5)*x/2). - Stefano Spezia, Oct 18 2019
a(2k+1)/7 is the numerator of the continued fraction [3*sqrt(5), 3*sqrt(5), ..., 3*sqrt(5)] with 2k copies of 3*sqrt(5), for k>0. - Greg Dresden and Tracy Z. Wu, Sep 10 2020
a(n) = Sum_{k>=1} Lucas(2*n*k)/(Lucas(2*n)^k). - Diego Rattaggi, Jan 20 2025

Extensions

More terms from James Sellers, Aug 31 2000
Chebyshev comments from Wolfdieter Lang, Oct 31 2002

A039678 Smallest number m > 1 such that m^(p-1)-1 is divisible by p^2, where p = n-th prime.

Original entry on oeis.org

5, 8, 7, 18, 3, 19, 38, 28, 28, 14, 115, 18, 51, 19, 53, 338, 53, 264, 143, 11, 306, 31, 99, 184, 53, 181, 43, 164, 96, 68, 38, 58, 19, 328, 313, 78, 226, 65, 253, 259, 532, 78, 176, 276, 143, 174, 165, 69, 330, 44, 33, 332, 94, 263, 48, 79, 171, 747, 731, 20, 147, 91, 40
Offset: 1

Views

Author

Keywords

Comments

Using Fermat's little theorem twice, it is easy to see that m=p^2-1 solves this problem for all odd primes p. In fact, there appear to be exactly p-1 values of m with 1 <= m <= p^2 for which m^(p-1) == 1 (mod p^2). See A096082 for the related open problem. - T. D. Noe, Aug 24 2008
That there are exactly p-1 values of 1 <= m <= p^2 for which m^(p-1) == 1 (mod p^2) follows immediately from Hensel's lifting lemma and Fermat's little theorem - every solution mod p corresponds to a unique solution mod p^2. - Phil Carmody, Jan 10 2011
For n > 2, prime(n) does not divide a(n)^2 - 1, so a(n) is the smallest m > 1 such that (m^(prime(n)-1) - 1)/(m^2 - 1) == 0 (mod prime(n)^2). - Thomas Ordowski, Nov 24 2018

Examples

			For n=3, p=5 is the third prime and 5^2 = 25 divides 7^4 - 1 = 2400.
		

References

  • P. Ribenboim, The New Book of Prime Number Records, Springer, 1996, 345-349.

Crossrefs

Cf. A185103.

Programs

  • Mathematica
    dpa[n_]:=Module[{p=Prime[n],a=2},While[PowerMod[a,p-1,p^2]!=1,a++];a]; Array[dpa,70] (* Harvey P. Dale, Sep 05 2012 *)
  • PARI
    a(n) = my(p=prime(n)); for(a=2, oo, if(Mod(a, p^2)^(p-1)==1, return(a))) \\ Felix Fröhlich, Nov 24 2018
    
  • Python
    from sympy import prime
    from sympy.ntheory.residue_ntheory import nthroot_mod
    def A039678(n): return 2**2+1 if n == 1 else int(nthroot_mod(1,(p:= prime(n))-1,p**2,True)[1]) # Chai Wah Wu, May 18 2022

Formula

a(n) = A185103(A000040(n)).

Extensions

More terms from David W. Wilson
Definition adjusted by Felix Fröhlich, Jun 24 2014
Edited by Felix Fröhlich, Nov 24 2018

A007663 Fermat quotients: (2^(p-1)-1)/p, where p=prime(n).

Original entry on oeis.org

1, 3, 9, 93, 315, 3855, 13797, 182361, 9256395, 34636833, 1857283155, 26817356775, 102280151421, 1497207322929, 84973577874915, 4885260612740877, 18900352534538475, 1101298153654301589, 16628050996019877513, 64689951820132126215, 3825714619033636628817
Offset: 2

Views

Author

N. J. A. Sloane, Sep 19 1994

Keywords

Comments

The only terms that are squares are a(2) = 1 and a(4) = 9. - Nick Hobson, May 20 2007
From Jonathan Sondow, Jul 19 2010: (Start)
a(n) == 0 (mod 3) if n > 2, since p = prime(n) > 3
and 0 = (-1)^(p-1)-1 == 2^(p-1)-1 (mod 3). (End)
p is in A001220 if and only if p | (2^(p-1)-1)/p, i.e., a(n) is divisible by prime(n). - Felix Fröhlich, Jun 20 2014
In general, every prime p that is 1 mod q-1 will create a numerator that is 0 mod q via Fermat's Little Theorem, meaning every p with this property (except q) will have a Fermat quotient divisible by q. - Roderick MacPhee, May 12 2017

References

  • Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See pp. 47, 308.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 105.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 70.

Crossrefs

Programs

Formula

From Alexander Adamchuk, Oct 01 2006: (Start)
a(n) = 3*A096060(n) for n > 2.
a(n) = 3*A001045(prime(n)-1)/prime(n) for n > 1. (End)
a(n) = Sum_{i=0..(p-3)/2} 2^i*(p-i-2)!/((i+1)!*(p-2*(i+1))!) where p = prime(n), for n >= 2. - Vladimir Pletser, Jan 26 2023

A061286 Smallest integer for which the number of divisors is the n-th prime.

Original entry on oeis.org

2, 4, 16, 64, 1024, 4096, 65536, 262144, 4194304, 268435456, 1073741824, 68719476736, 1099511627776, 4398046511104, 70368744177664, 4503599627370496, 288230376151711744, 1152921504606846976
Offset: 1

Views

Author

Labos Elemer, May 22 2001

Keywords

Comments

Seems to be the same as "Even numbers with prime number of divisors" - Jason Earls, Jul 04 2001
Except for the first term, smallest number == 1 (mod prime(n)) having n divisors (by Fermat's little theorem). - Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 20 2003

Crossrefs

Programs

  • Mathematica
    Table[2^(p-1),{p,Table[Prime[n],{n,1,18}]}] (* Geoffrey Critzer, May 26 2013 *)
  • PARI
    forstep(n=2,100000000,2,x=numdiv(n); if(isprime(x),print(n)))
    
  • PARI
    a(n)=2^(prime(n)-1) \\ Charles R Greathouse IV, Apr 08 2012
    
  • Python
    from sympy import isprime, divisor_count as tau
    [2] + [2**(2*n) for n in range(1, 33) if isprime(tau(2**(2*n)))] # Karl V. Keller, Jr., Jul 10 2020

Formula

a(n) = 2^(prime(n)-1) = 2^A006093(n).
a(n) = A005179(prime(n)). - R. J. Mathar, Aug 09 2019
Sum_{n>=1} 1/a(n) = A119523. - Amiram Eldar, Aug 11 2020

A290261 Write 1 - x/(1-x) as an inverse power product 1/(1 + a(1)*x) * 1/(1 + a(2)*x^2) * 1/(1 + a(3)*x^3) * 1/(1 + a(4)*x^4) * ...

Original entry on oeis.org

1, 2, 2, 6, 6, 10, 18, 54, 54, 114, 186, 334, 630, 1314, 2106, 5910, 7710, 15642, 27594, 57798, 97902, 207762, 364722, 712990, 1340622, 2778930, 4918482, 10437702, 18512790, 37500858, 69273666, 154021590, 258155910, 535004610, 981288906
Offset: 1

Views

Author

Gus Wiseman, Jul 24 2017

Keywords

Comments

The initial terms are given on page 1234 of Gingold, Knopfmacher, 1995.
From Petros Hadjicostas, Oct 04 2019: (Start)
In Section 3 of Gingold and Knopfmacher (1995), it is proved that, if f(z) = Product_{n >= 1} (1 + g(n))*z^n = 1/(Product_{n >= 1} (1 - h(n))*z^n), then g(2*n - 1) = h(2*n - 1) and Sum_{d|n} (1/d)*h(n/d)^d = -Sum_{d|n} (1/d)*(-g(n/d))^d. The same results were proved more than ten years later by Alkauskas (2008, 2009). [If we let a(n) = -g(n), then Alkauskas works with f(z) = Product_{n >= 1} (1 - a(n))*z^n; i.e., a(2*n - 1) = -h(2*n - 1) etc.]
The PPE of 1 - x/(1-x) is given in A220418, which is also studied in Gingold and Knopfmacher (1995) starting at p. 1223.
(End)

Crossrefs

Programs

  • Mathematica
    nn=20;Solve[Table[Expand[SeriesCoefficient[Product[1/(1+a[k]x^k),{k,n}],{x,0,n}]]==-1,{n,nn}],Table[a[n],{n,nn}]][[1,All,2]]
    (* Second program: *)
    A[m_, n_] := A[m, n] = Which[m == 1, 2^(n-1), m > n >= 1, 0, True, A[m - 1, n] - A[m - 1, m - 1]*A[m, n - m + 1] ];
    a[n_] := A[n, n];
    a /@ Range[1, 55] (* Petros Hadjicostas, Oct 04 2019, courtesy of Jean-François Alcover *)

Formula

a(n) = Sum_t (-1)^v(t) where the sum is over all enriched p-trees of weight n (see A289501 for definition) and v(t) is the number of nodes (branchings and leaves) in t.
From Petros Hadjicostas, Oct 04 2019: (Start)
a(n) satisfies Sum_{d|n} (1/d)*(-a(n/d))^d = -(2^n - 1)/n. Thus, a(n) = Sum_{d|n, d>1} (1/d)*(-a(n/d))^d + (2^n - 1)/n.
a(2*n - 1) = A220418(2*n - 1) for n >= 1 because A220418 gives the PPE of 1 - x/(1-x).
Define (A(m,n): n,m >= 1) by A(m=1,n) = 2^(n-1) for n >= 1, A(m,n) = 0 for m > n >= 1 (upper triangular), and A(m,n) = A(m-1,n) - A(m-1,m-1) * A(m,n-m+1) for n >= m >= 2. Then a(n) = A(n,n). [Theorem 3 in Gingold et al. (1988).]
(End)
Previous Showing 11-20 of 141 results. Next