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-3 of 3 results.

A006130 a(n) = a(n-1) + 3*a(n-2) for n > 1, a(0) = a(1) = 1.

Original entry on oeis.org

1, 1, 4, 7, 19, 40, 97, 217, 508, 1159, 2683, 6160, 14209, 32689, 75316, 173383, 399331, 919480, 2117473, 4875913, 11228332, 25856071, 59541067, 137109280, 315732481, 727060321, 1674257764, 3855438727, 8878212019, 20444528200, 47079164257, 108412748857
Offset: 0

Views

Author

Keywords

Comments

Counts walks of length n at the vertex of degree five in the graph with adjacency matrix A = [1,1,1,1;1,0,0,0;1,0,0,0;1,0,0,0]. - Paul Barry, Oct 02 2004
Form the graph with matrix A = [0,1,1,1;1,1,0,0;1,0,1,0;1,0,0,1]. The sequence 0,1,1,4,... counts walks of length n between the vertex without loop and another vertex. - Paul Barry, Oct 02 2004
Length-n words with letters {0,1,2,3} where no two consecutive letters are nonzero, see fxtbook link below. - Joerg Arndt, Apr 08 2011
Hankel transform is the sequence [1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 10 2007
Let M = [1, sqrt(3); sqrt(3), 0] be a 2 X 2 matrix. Then A006130(n)={[M^n]A006130-A052533%20=%20A006130%20(shifted%20to%20the%20right%20one%20place,%20with%20first%20term%20=%200).%20-%20_L.%20Edson%20Jeffery">(1,1)}. Note that A006130-A052533 = A006130 (shifted to the right one place, with first term = 0). - _L. Edson Jeffery, Nov 25 2011 [Any matrix M = [1, y; 3/y, 0], with y not 0, will do it. - Wolfdieter Lang, Feb 18 2018]
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=2, 4*a(n-2) equals the number of 4-colored compositions of n with all parts >=2, such that no adjacent parts have the same color. - Milan Janjic, Nov 26 2011
a(n) is the number of compositions (ordered partitions) of n into parts 1 and 2 where there are three sorts of part 2 (see the g.f.). - Joerg Arndt, Jan 16 2024
Number of pairs of rabbits when there are 3 pairs per litter and offspring reach parenthood after 2 gestation periods. - Robert FERREOL, Oct 28 2018
Numerators of stationary probabilities sequence for number of customers in steady state of M2/M/1 queue, whose g.f. is (1-z)/(3-3z-z(1-z^2)). - Igor Kleiner, Nov 03 2018
INVERT transform of (1, 0, 3, 0, 9, 0, 27, ...). - Gary W. Adamson, Jul 15 2019
Number of 3-compositions of n+2 with 1 not allowed as a part; see Hopkins & Ouvry reference. - Brian Hopkins, Aug 17 2020
Number of ways to tile a strip of length n with 3 colors of dominoes and 1 color of squares. - Greg Dresden, Sep 01 2021
Number of 3-permutations of n elements avoiding the patterns 231, 312, 321. See Bonichon and Sun. - Michel Marcus, Aug 20 2022
a(n-1), with a(-1) = 0, appears in the formula for the powers of the fundamental (integer) algebraic number c = (1 + sqrt(13))/2 = A209927: c^n = A052533(n) + a(n-1)*c. With the formulas given below, and also in A052533, in terms of S-Chebyshev polynomials this is valid also for the powers of 1/c = (-1 + sqrt(13))/6 = A356033. - Wolfdieter Lang, Nov 26 2023

Examples

			G.f. = 1 + x + 4*x^2 + 7*x^3 + 19*x^4 + 40*x^5 + 97*x^6 + 217*x^7 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Stephen Wolfram, 'The Mathematica Book,' Fourth Edition, Wolfram Media or Cambridge University Press, 1999, p. 96.

Crossrefs

Cf. A006131, A015440, A049310, A052533, A140167, A175291 (Pisano periods), A099232 (partial sums), A274977.

Programs

  • GAP
    a := [1, 1];; for n in [3..30] do a[n] := a[n-1] + 3*a[n-2]; od; a; # Muniru A Asiru, Feb 18 2018
  • Magma
    [n le 2 select 1 else Self(n-1) + 3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Oct 17 2012
    
  • Maple
    a := n -> add(binomial(n-k, k)*3^k, k=0..n): seq(a(n), n=0..29); # Zerinvary Lajos, Sep 30 2006
    f:= gfun:-rectoproc({a(n) = a(n-1) + 3*a(n-2), a(0) = 1, a(1) = 1},a(n),remember):
    map(f, [$0..100]); # Robert Israel, Aug 31 2015
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = a[n - 1] + 3a[n - 2]; Table[ a[n], {n, 0, 30}]
    LinearRecurrence[{1, 3}, {1, 1}, 30] (* Vincenzo Librandi, Oct 17 2012 *)
    RecurrenceTable[{a[n]== a[n-1] + 3*a[n-2], a[0]== 1, a[1]== 1}, a, {n,0,30}] (* G. C. Greubel, Aug 30 2015 *)
    a[0] := 1; a[n_] := Hypergeometric2F1[1/2-n/2, -n/2, -n, -12]; Table[a[n], {n, 0, 29}] (* Peter Luschny, Feb 18 2018 *)
    a[ n_] := With[{s = Sqrt[-1/3]}, ChebyshevU[n, s/2] / s^n] // Simplify; (* Michael Somos, Nov 04 2018 *)
  • PARI
    Vec(1/(1-x-3*x^2+O(x^66))) \\ Franklin T. Adams-Watters, May 26 2011
    
  • Python
    an = an1 = 1
    while an<10**5:
       print(an)
       an1 += an*3
       an = an1 - an*3   # Alex Ratushnyak, Apr 20 2012
    
  • Sage
    from sage.combinat.sloane_functions import recur_gen2
    it = recur_gen2(1,1,1,3)
    [next(it) for i in range(30)] # Zerinvary Lajos, Jun 25 2008
    
  • Sage
    [lucas_number1(n,1,-3) for n in range(1, 31)] # Zerinvary Lajos, Apr 22 2009
    

Formula

O.g.f.: 1/(1 - x - 3*x^2). - Simon Plouffe in his 1992 dissertation.
a(n) = (( (1 + sqrt(13))/2 )^(n+1) - ( (1 - sqrt(13))/2 )^(n+1))/sqrt(13).
a(n) = Sum_{k = 0..ceiling(n/2)} 3^k*C(n-k, k). - Benoit Cloitre, Philippe Deléham, Mar 07 2004
a(0) = 1; a(1) = 1; for n >= 1, a(n+1) = (a(n)^2 - (-3)^n) / a(n-1). - Philippe Deléham, Mar 07 2004
The i-th term of the sequence is the (1, 2) entry in the i-th power of the 2 X 2 matrix M = ((-1, 1), (1, 2)). - Simone Severini, Oct 15 2005
a(n) = lower right term in the 2 X 2 matrix [0,3; 1,1]^n. - Gary W. Adamson, Mar 02 2008
a(n) = Sum_{k = 0..n} A109466(n,k)*(-3)^(n-k). - Philippe Deléham, Oct 26 2008
a(n) = Product_{k = 1..floor((n - 1)/2)} (1 + 12*cos(k*Pi/n)^2). - Roger L. Bagula and Gary W. Adamson, Nov 21 2008
Limiting ratio = (1 + sqrt(13))/2 = 2.30277563.. = A098316 - 1. - Roger L. Bagula and Gary W. Adamson, Nov 21 2008
G.f.: G(0)/(2-x), where G(k)= 1 + 1/(1 - x*(13*k - 1)/(x*(13*k + 12) - 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 18 2013
G.f.: Q(0)/2, where Q(k) = 1 + 1/(1 - x*(4*k+1 + 3*x)/( x*(4*k+3 + 3*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 08 2013
a(n) = ( Sum_{1 <= k <= n+1, k odd} C(n+1,k)*13^((k-1)/2) )/2^n. - Vladimir Shevelev, Feb 05 2014
E.g.f.: (1/(a - b))*(a*exp(a*x) - b*exp(b*x)), where 2*a = 1 + sqrt(13) and 2*b = 1 - sqrt(13). - G. C. Greubel, Aug 30 2015
a(n) = ((i*sqrt(3))^n)*S(n, (-i/sqrt(3))), with the imaginary unit i and the Chebyshev S polynomials (coefficients in A049310). - Wolfdieter Lang, Feb 18 2018
a(n) = hypergeom([(1-n)/2, -n/2], [-n], -12) for n >= 1. - Peter Luschny, Feb 18 2018
a(n) = 3 * (-3)^n * a(-2-n) for all n in Z. - Michael Somos, Nov 04 2018
a(n) = ( sqrt(3) )^n * Fibonacci(n+1, 1/sqrt(3)). - G. C. Greubel, Dec 26 2019
a(n) = numerator of the continued fraction 1 + 3/(1 + 3/(1 + 3/ ... + 3/1)) with exactly n 1's, for n>0. - Greg Dresden and Alexander Mark, Aug 16 2020
With an initial 0 prepended, the sequence [0, 1, 1, 4, 7, 19, 40, ...] satisfies the congruences a(n*p^k) == e*a(n*p^(k-1)) (mod p^k) for positive integers k and n and all primes p, where e = +1 for the primes p listed in A296937, e = 0 if p = 13, otherwise e = -1. See Young, Theorem 1, Corollary 1 (i). - Peter Bala, Dec 28 2022
From Wolfdieter Lang, Nov 27 2023: (Start)
a(n) = sqrt(-3)^n*S(n, 1/sqrt(-3)) with the S-Chebyshev polynomials (see A049310), also valid for negative n, using S(-n, x) = -S(n-2, x), for n >= 2, and S(-1, x) = 0. See above the formula in terms of Fibonacci polynomials).
a(n) = A052533(n+2)/3, for n >= 0. (End)
From Peter Bala, Jun 27 2025: (Start)
G.f.: Sum_{n >= 0} x^n * Product_{k = 1..n} (k + 3*x)/(1 + k*x) = Sum_{n >= 0} x^n * Product_{k = 1..n} (1 + 3*k*x)/(1 + 3*k*x^2).
The following products telescope:
Product_{k >= 0} (1 + 3^k/a(2*k+1)) = 1 + sqrt(13).
Product_{k >= 1} (1 - 3^k/a(2*k+1)) = 1/14 * (1 + sqrt(13)).
Product_{k >= 0} (1 + (-3)^k/a(2*k+1)) = (1/13) * (13 + sqrt(13)).
Product_{k >= 1} (1 - (-3)^k/a(2*k+1)) = (1/14) * (13 + sqrt(13)). (End)

A038883 Odd primes p such that 13 is a square mod p.

Original entry on oeis.org

3, 13, 17, 23, 29, 43, 53, 61, 79, 101, 103, 107, 113, 127, 131, 139, 157, 173, 179, 181, 191, 199, 211, 233, 251, 257, 263, 269, 277, 283, 311, 313, 337, 347, 367, 373, 389, 419, 433, 439, 443, 467, 491, 503, 521, 523, 547, 563, 569, 571, 599, 601, 607, 641
Offset: 1

Views

Author

Keywords

Comments

Equivalently, by quadratic reciprocity (since 13 == 1 (mod 4)), primes p which are squares mod 13.
The squares mod 13 are 0, 1, 4, 9, 3, 12 and 10.
Also primes of the form x^2 + 3*x*y - y^2. Discriminant = 13. Class = 1. This was originally a separate entry, submitted by Laura Caballero Fernandez, Lourdes Calvo Moguer, Maria Josefa Cano Marquez, Oscar Jesus Falcon Ganfornina and Sergio Garrido Morales (oscfalgan(AT)yahoo.es), Jun 06 2008. R. J. Mathar proved that this coincides with the present sequence, Jul 22 2008
Primes p such that x^2 + x = 3 has a solution mod p (the solutions over the reals are (-1+-sqrt(13))/2). - Joerg Arndt, Jul 27 2011

Examples

			13 == 1 (mod 3) and 1 is a square, so 3 is on the list.
101 is prime and congruent to 7^2 = 49 == 10 (mod 13), so 101 is on the list.
		

References

  • Z. I. Borevich and I. R. Shafarevich, Number Theory.

Crossrefs

Cf. A038872 (d=5). A038873 (d=8). A068228, A141123 (d=12). A038883 (primes p such that d=13 is a square mod p). A038889 (d=17). A141111, A141112 (d=65).
Cf. A296937.
For a list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.

Programs

  • Mathematica
    Select[ Prime@ Range@ 118, JacobiSymbol[ #, 13] > -1 &] (* Robert G. Wilson v, May 16 2008 *)
    Select[Flatten[Table[13n + {1, 3, 4, 9, 10, 12}, {n, 50}]], PrimeQ[#] &] (* Alonso del Arte, Sep 16 2012 *)
  • PARI
    forprime(p=3,1e3,if(issquare(Mod(13,p)),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    select( {is_A038883(n)=bittest(5659,n%13)&&isprime(n)}, [0..666]) \\ M. F. Hasler, Feb 17 2022
    
  • Sage
    # uses[binaryQF]
    # The function binaryQF is defined in the link 'Binary Quadratic Forms'.
    Q = binaryQF([1, 3, -1])
    print(Q.represented_positives(641, 'prime')) # Peter Luschny, Sep 20 2018

Formula

A000040 \ A120330 U {13}: Complement of A120330 in the primes, and 13. - M. F. Hasler, Feb 17 2022

Extensions

Edited by N. J. A. Sloane, Apr 27 2008, Jul 28 2008

A296938 Rational primes that decompose in the field Q(sqrt(17)).

Original entry on oeis.org

2, 13, 19, 43, 47, 53, 59, 67, 83, 89, 101, 103, 127, 137, 149, 151, 157, 179, 191, 223, 229, 239, 251, 257, 263, 271, 281, 293, 307, 331, 349, 353, 359, 373, 383, 389, 409, 421, 433, 443, 457, 461, 463, 467, 491, 509, 523, 557, 563, 569, 577, 587, 593, 599
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2017

Keywords

Comments

From Jianing Song, Apr 21 2022: (Start)
Primes p such that kronecker(17, p) = kronecker(p, 17) = 1, where kronecker() is the kronecker symbol. That is to say, primes p that are quadratic residues modulo 17.
Primes p such that p^8 == 1 (mod 17).
Primes p == 1, 2, 4, 8, 9, 13, 15, 16 (mod 17). (End)

Crossrefs

Cf. A011584 (kronecker symbol modulo 17).
Rational primes that decompose in the quadratic field with discriminant D: A139513 (D=-20), A191019 (D=-19), A191018 (D=-15), A296920 (D=-11), A033200 (D=-8), A045386 (D=-7), A002144 (D=-4), A002476 (D=-3), A045468 (D=5), A001132 (D=8), A097933 (D=12), A296937 (D=13), this sequence (D=17).
Cf. A038890 (inert rational primes in the field Q(sqrt(17))).

Programs

Showing 1-3 of 3 results.