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

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

Original entry on oeis.org

1, 4, 14, 48, 164, 560, 1912, 6528, 22288, 76096, 259808, 887040, 3028544, 10340096, 35303296, 120532992, 411525376, 1405035520, 4797091328, 16378294272, 55918994432, 190919389184, 651839567872, 2225519493120, 7598398836736, 25942556360704, 88573427769344, 302408598355968
Offset: 0

Views

Author

Keywords

Comments

Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 4) is "size of raises in pot-limit poker, one blind, maximum raising."
It appears that this sequence is the BinomialMean transform of A002315 - see A075271. - John W. Layman, Oct 02 2002
Number of (s(0), s(1), ..., s(2n+3)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n+3, s(0) = 1, s(2n+3) = 4. - Herbert Kociemba, Jun 11 2004
a(n) = number of distinct matrix products in (A+B+C+D)^n where commutators [A,B]=[C,D]=0 but neither A nor B commutes with C or D. - Paul D. Hanna and Joshua Zucker, Feb 01 2006
The n-th term of the sequence is the entry (1,2) in the n-th power of the matrix M=[1,-1;-1,3]. - Simone Severini, Feb 15 2006
Hankel transform of this sequence is [1,-2,0,0,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
A204089 convolved with A000225, e.g., a(4) = 164 = (1*31 + 1*15 + 4*7 + 14*3 + 48*1) = (31 + 15 + 28 + 42 + 48). - Gary W. Adamson, Dec 23 2008
Equals INVERT transform of A000225: (1, 3, 7, 15, 31, ...). - Gary W. Adamson, May 03 2009
For n>=1, a(n-1) is the number of generalized compositions of n when there are 2^i-1 different types of the part i, (i=1,2,...). - Milan Janjic, Sep 24 2010
Binomial transform of A078057. - R. J. Mathar, Mar 28 2011
Pisano period lengths: 1, 1, 8, 1, 24, 8, 6, 1, 24, 24, 120, 8, 168, 6, 24, 1, 8, 24, 360, 24, ... . - R. J. Mathar, Aug 10 2012
a(n) is the diagonal of array A228405. - Richard R. Forberg, Sep 02 2013
From Wolfdieter Lang, Oct 01 2013: (Start)
a(n) appears together with A106731, both interspersed with zeros, in the representation of nonnegative powers of the algebraic number rho(8) = 2*cos(Pi/8) = A179260 of degree 4, which is the length ratio of the smallest diagonal and the side in the regular octagon.
The minimal polynomial for rho(8) is C(8,x) = x^4 - 4*x^2 + 2, hence rho(8)^n = A(n+1)*1 + A(n)*rho(8) + B(n+1)*rho(8)^2 + B(n)*rho(8)^3, n >= 0, with A(2*k) = 0, k >= 0, A(1) = 1, A(2*k+1) = A106731(k-1), k >= 1, and B(2*k) = 0, k >= 0, B(1) = 0, B(2*k+1) = a(k-1), k >= 1. See also the P. Steinbach reference given under A049310. (End)
The ratio a(n)/A006012(n) converges to 1+sqrt(2). - Karl V. Keller, Jr., May 16 2015
From Tom Copeland, Dec 04 2015: (Start)
An aerated version of this sequence is given by the o.g.f. = 1 / (1 - 4 x^2 + 2 x^4) = 1 / [x^4 a_4(1/x)] = 1 / determinant(I - x M) = exp[-log(1 -4 x + 2 x^4)], where M is the adjacency matrix for the simple Lie algebra B_4 given in A265185 with the characteristic polynomial a_4(x) = x^4 - 4 x^2 + 2 = 2 T_4(x/2) = A127672(4,x), where T denotes a Chebyshev polynomial of the first kind.
A133314 relates a(n) to the reciprocal of the e.g.f. 1 - 4 x + 4 x^2/2!. (End)
a(n) is the number of vertices of the Minkowski sum of n simplices with vertices e_(2*i+1), e_(2*i+2), e_(2*i+3), e_(2*i+4) for i=0,...,n-1, where e_i is a standard basis vector. - Alejandro H. Morales, Oct 03 2022

Examples

			a(3) = 48 = 3 * 4 + 4 + 1 + 1 = 3*a(2) + a(1) + a(0) + 1.
Example for the octagon rho(8) powers: rho(8)^4  = 2 + sqrt(2) = -2*1 + 4*rho(8)^2  = A(5)*1 + A(4)*rho(8) + B(5)*rho(8)^2 + B(4)*rho(8)^3, with a(5) = A106731(1) = -2, B(5) = a(1) = 4, A(4) = 0, B(4) = 0. - _Wolfdieter Lang_, Oct 01 2013
		

References

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

Crossrefs

Row sums of A059474. - David W. Wilson, Aug 14 2006
Equals 2 * A003480, n>0.
Row sums of A140071.

Programs

  • Haskell
    a007070 n = a007070_list !! n
    a007070_list = 1 : 4 : (map (* 2) $ zipWith (-)
       (tail $ map (* 2) a007070_list) a007070_list)
    -- Reinhard Zumkeller, Jan 16 2012
  • Magma
    Z:=PolynomialRing(Integers()); N:=NumberField(x^2-8); S:=[ ((4+r)^(1+n)-(4-r)^(1+n))/((2^(1+n))*r): n in [0..20] ]; [ Integers()!S[j]: j in [1..#S] ]; // Vincenzo Librandi, Mar 27 2011
    
  • Magma
    [n le 2 select 3*n-2 else 4*Self(n-1)-2*Self(n-2): n in [1..23]];  // Bruno Berselli, Mar 28 2011
    
  • Maple
    A007070 :=proc(n) option remember; if n=0 then 1 elif n=1 then 4 else 4*procname(n-1)-2*procname(n-2); fi; end:
    seq(A007070(n), n=0..30); # Wesley Ivan Hurt, Dec 06 2015
  • Mathematica
    LinearRecurrence[{4,-2}, {1,4}, 30] (* Harvey P. Dale, Sep 16 2014 *)
  • PARI
    a(n)=polcoeff(1/(1-4*x+2*x^2)+x*O(x^n),n)
    
  • PARI
    a(n)=if(n<1,1,ceil((2+sqrt(2))*a(n-1)))
    
  • Sage
    [lucas_number1(n,4,2) for n in range(1, 24)]# Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: 1/(1 - 4*x + 2*x^2).
Preceded by 0, this is the binomial transform of the Pell numbers A000129. Its e.g.f. is then exp(2*x)*sinh(sqrt(2)*x)/sqrt(2). - Paul Barry, May 09 2003
a(n) = ((2+sqrt(2))^(n+1) - (2-sqrt(2))^(n+1))/sqrt(8). - Al Hakanson (hawkuu(AT)gmail.com), Dec 27 2008, corrected Mar 28 2011
a(n) = (2 - sqrt(2))^n*(1/2 - sqrt(2)/2) + (2 + sqrt(2))^n*(1/2 + sqrt(2)/2). - Paul Barry, May 09 2003
a(n) = ceiling((2 + sqrt(2))*a(n-1)). - Benoit Cloitre, Aug 15 2003
a(n) = U(n, sqrt(2))*sqrt(2)^n. - Paul Barry, Nov 19 2003
a(n) = (1/4)*Sum_{r=1..7} sin(r*Pi/8)*sin(r*Pi/2)*(2*cos(r*Pi/8))^(2*n+3). - Herbert Kociemba, Jun 11 2004
a(n) = center term in M^n * [1 1 1], where M = the 3 X 3 matrix [1 1 1 / 1 2 1 / 1 1 1]. M^n * [1 1 1] = [A007052(n) a(n) A007052(n)]. E.g., a(3) = 48 since M^3 * [1 1 1] = [34 48 34], where 34 = A007052(3). - Gary W. Adamson, Dec 18 2004
This is the binomial mean transform of A002307. See Spivey and Steil (2006). - Michael Z. Spivey (mspivey(AT)ups.edu), Feb 26 2006
a(2n) = Sum_{r=0..n} 2^(2n-1-r)*(4*binomial(2n-1,2r) + 3*binomial(2n-1,2r+1)) a(2n-1) = Sum_{r=0..n} 2^(2n-2-r)*(4*binomial(2n-2,2r) + 3*binomial(2n-2,2r+1)). - Jeffrey Liese, Oct 12 2006
a(n) = 3*a(n - 1) + a(n - 2) + a(n - 3) + ... + a(0) + 1. - Gary W. Adamson, Feb 18 2011
G.f.: 1/(1 - 4*x + 2*x^2) = 1/( x*(1 + U(0)) ) - 1/x where U(k)= 1 - 2^k/(1 - x/(x - 2^k/U(k+1) )); (continued fraction 3rd kind, 3-step). - Sergei N. Gladkovskii, Dec 05 2012
G.f.: A(x) = G(0)/(1-2*x) where G(k) = 1 + 2*x/(1 - 2*x - x*(1-2*x)/(x + (1-2*x)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Jan 04 2013
G.f.: G(0)/(2*x) - 1/x, where G(k) = 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) - (1-x)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 26 2013
a(n-1) = Sum_{k=0..n} binomial(2*n, n+k)*(k|8) where (k|8) is the Kronecker symbol. - Greg Dresden, Oct 11 2022
E.g.f.: exp(2*x)*(cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x)). - Stefano Spezia, May 20 2024

A097159 Smallest prime p such that there are n consecutive quadratic residues mod p.

Original entry on oeis.org

2, 7, 11, 19, 43, 67, 83, 131, 283, 277, 467, 479, 1907, 1607, 2543, 1559, 5443, 5711, 6389, 14969, 25703, 10559, 20747, 52057, 136223, 90313, 162263, 18191, 167107, 31391, 376589, 607153, 671947
Offset: 1

Views

Author

Robert G. Wilson v, Jul 28 2004

Keywords

Comments

Additional terms less than 10^6: a(35)=298483, a(36)=422231, a(40)=701399 and a(42)=366791. - T. D. Noe, Apr 03 2007

Examples

			a(22)=10559, a(23)=20747 & a(28)=18191.
		

Crossrefs

Programs

  • Mathematica
    f[l_, a_] := Module[{A = Split[l], B}, B = Last[ Sort[ Cases[A, x : {a ..} :> { Length[x], Position[A, x][[1, 1]] }] ]]; {First[B], Length[ Flatten[ Take[A, Last[B] - 1]]] + 1}]; g[n_] := g[n] = f[ JacobiSymbol[ Range[ Prime[n] - 1], Prime[n]], 1][[1]]; g[1] = 1; a = Table[0, {30}]; Do[b = g[n]; If[ a[[b]] < 31 && a[[b]] == 0, a[[b]] = n; Print[b, " = ", Prime[n]]], {n, 2555}]

Extensions

More terms from T. D. Noe, Apr 03 2007

A002308 Consecutive quadratic nonresidues mod p.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) is the maximal number of positive reduced quadratic nonresidues which appear consecutively for the n-th prime.
When prime(n) == 3 (mod 4), then a(n) = A002307(n). - T. D. Noe, Apr 03 2007

References

  • 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

Cf. A002307.

Programs

  • Mathematica
    f[l_, a_] := Module[{A = Split[l], B}, B = Last[Sort[ Cases[A, x : {a ..} :> {Length[x], Position[A, x][[1, 1]]}]]]; {First[B], Length[Flatten[Take[A, Last[B] - 1]]] + 1}]; g[n_] := f[-JacobiSymbol[Range[Prime[n] - 1], Prime[n]], 1][[1]]; g[1] = 0; Table[g[n], {n, 1, 107}] (* Jean-François Alcover, Oct 17 2012, after the Mathematica code of Robert G. Wilson v in A002307 *)

Extensions

More terms from David W. Wilson

A048280 Length of longest run of consecutive quadratic residues mod prime(n).

Original entry on oeis.org

2, 2, 3, 3, 3, 3, 5, 4, 5, 4, 4, 4, 5, 5, 5, 3, 5, 5, 6, 7, 9, 6, 7, 5, 9, 7, 7, 6, 5, 5, 7, 8, 6, 5, 4, 7, 6, 6, 6, 6, 6, 6, 7, 9, 7, 6, 7, 7, 7, 5, 6, 7, 13, 7, 6, 7, 8, 7, 10, 6, 9, 9, 7, 11, 9, 5, 8, 9, 8, 6, 6, 8, 9, 6, 8, 8, 8, 5, 7, 13, 8, 7, 7, 9, 10, 8, 8, 9, 8, 8, 11, 13, 8, 8, 10, 8, 9, 8, 10, 7, 9, 9, 10, 10, 7, 9
Offset: 1

Views

Author

Keywords

Comments

0 and 1 are consecutive quadratic residues for any prime, so a(n) >= 2.
"Consecutive" allows wrap-around, so p-1 and 0 are consecutive. - Robert Israel, Jul 20 2014
A002307(n) is defined similarly, except that only positive reduced quadratic residues are counted. - Jonathan Sondow, Jul 20 2014
For longest runs of quadratic nonresidues, see A002308. - Jonathan Sondow, Jul 20 2014

Examples

			For n = 7, prime(7) = 17 has consecutive quadratic residues 15,16,0,1,2, and no longer sequence of consecutive quadratic residues, so a(7)=5.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) local P, res, nonres, nnr;
         P:= ithprime(n);
         res:= {seq(i^2,i=0..floor((P-1)/2)};
         nonres:= {$1..P-1} minus res;
         nnr:= nops(nonres);
         max(seq(nonres[i+1]-nonres[i]-1,i=1..nnr-1),nonres[1]-nonres[-1]+P-1)
    end proc;
    A(1):= 2:
    seq(A(n),n=1..100); # Robert Israel, Jul 20 2014

Formula

a(n) < 2*sqrt(prime(n)) for n >= 1 (see Pollack and Treviño for n > 1). - Jonathan Sondow, Jul 20 2014
a(n) >= A002307(n). - Jonathan Sondow, Jul 20 2014
a(n) < 7 prime(n)^(1/4)log(prime(n)) for all n > 1, or a(n) < 3.2 prime(n)^(1/4)log(prime(n)) for n >= 10^13. - Enrique Treviño, Apr 16 2020

Extensions

Offset corrected to 1 and definition clarified by Jonathan Sondow Jul 20 2014

A125607 Lesser of the smallest pair of consecutive positive reduced quadratic residues modulo p = prime(n) > 5.

Original entry on oeis.org

1, 3, 3, 1, 4, 1, 4, 1, 3, 1, 9, 1, 6, 3, 3, 9, 1, 1, 1, 3, 1, 1, 4, 1, 3, 3, 1, 1, 3, 1, 4, 4, 1, 3, 9, 1, 9, 3, 3, 1, 1, 6, 1, 4, 1, 3, 3, 1, 1, 1, 3, 1, 1, 4, 1, 3, 1, 6, 9, 6, 1, 1, 6, 4, 1, 3, 3, 1, 1, 1, 3, 4, 1, 4, 3, 1, 1, 3, 3, 1, 1, 1, 3, 1, 1, 4, 1, 3, 1, 1, 3, 4, 1, 4, 1, 6, 3, 9, 6, 3, 1, 4, 1, 3, 1
Offset: 4

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

For all n, a(n) exists and equals 1, 3, 4, 6 or 9. Proof: a(4)=1 by inspection. For n > 4 (p > 7), if 2 is a quadratic residue of p, then a(n)=1; otherwise if 5 is a quadratic residue of p, then a(n)=4 or 3; otherwise 2*5=10 is a quadratic residue of p and (9, 10) are consecutive residues. However, a(n)=8 or 7 is impossible as 8 cannot be a quadratic residue (since 2 is not), leaving 9 and 6 as the other possible values.
The constant 0.133141413191633911131141331131441391... = sum(a(n)/10^(n-3)) is conjectured to be irrational.

Examples

			The quadratic residues of 13=prime(6) are 1, 3, 4, 9, 10 and 12. The least consecutive pair of residues is (3, 4); hence a(6)=3.
		

Crossrefs

Programs

  • PARI
    vector(108, m, p=prime(m+3); if(p%8==1||p%8==7, 1, if(p%12==1||p%12==11, 3, if(p%10==1||p%10==9, 4, if((p%24==1||p%24==5||p%24==19||p%24==23) && (p%28==1||p%28==3||p%28==9||p%28==19||p%28==25||p%28==27), 6, 9)))))
Showing 1-5 of 5 results.