A355979 Indices of primes in A001835.
2, 3, 4, 6, 7, 10, 12, 19, 22, 75, 114
Offset: 1
Links
- J. B. Cosgrave and K. Dilcher, Pairs of reciprocal quadratic congruences involving primes, Fib. Quart. 51 (2) (2013) 98, after Theorem 3.
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.
List([0..50], n -> n*(3*n-2)); # G. C. Greubel, Nov 15 2018
a000567 n = n * (3 * n - 2) -- Reinhard Zumkeller, Dec 20 2012
[n*(3*n-2) : n in [0..50]]; // Wesley Ivan Hurt, Oct 10 2021
A000567 := proc(n) n*(3*n-2) ; end proc: seq(A000567(n), n=1..50) ;
Table[n (3 n - 2), {n, 0, 50}] (* Harvey P. Dale, May 06 2012 *) Table[PolygonalNumber[RegularPolygon[8], n], {n, 0, 43}] (* Arkadiusz Wesolowski, Aug 27 2016 *) PolygonalNumber[8, Range[0, 20]] (* Eric W. Weisstein, Sep 07 2017 *) LinearRecurrence[{3, -3, 1}, {1, 8, 21}, {0, 20}] (* Eric W. Weisstein, Sep 07 2017 *)
a(n)=n*(3*n-2) \\ Charles R Greathouse IV, Jun 10 2011
vector(50, n, n--; n*(3*n-2)) \\ G. C. Greubel, Nov 15 2018
# Intended to compute the initial segment of the sequence, not isolated terms. def aList(): x, y = 1, 1 yield 0 while True: yield x x, y = x + y + 6, y + 6 A000567 = aList() print([next(A000567) for i in range(49)]) # Peter Luschny, Aug 04 2019
[n*(3*n-2) for n in range(50)] # Gennady Eremin, Mar 10 2022
[n*(3*n-2) for n in range(50)] # G. C. Greubel, Nov 15 2018
For example, when n = 3: **** .*** .*** can be packed with dominoes in 4 different ways: 3 in which the top row is tiled with two horizontal dominoes and 1 in which the top row has two vertical and one horizontal domino, as shown below, so a(2) = 4. ---- ---- ---- ||-- .||| .--| .|-- .||| .||| .--| .|-- .||| G.f. = x + 4*x^2 + 15*x^3 + 56*x^4 + 209*x^5 + 780*x^6 + 2911*x^7 + 10864*x^8 + ...
a:=[0,1];; for n in [3..30] do a[n]:=4*a[n-1]-a[n-2]; od; a; # Muniru A Asiru, Feb 16 2018
a001353 n = a001353_list !! n a001353_list = 0 : 1 : zipWith (-) (map (4 *) $ tail a001353_list) a001353_list -- Reinhard Zumkeller, Aug 14 2011
I:=[0,1]; [n le 2 select I[n] else 4*Self(n-1)-Self(n-2): n in [1..30]]; // G. C. Greubel, Jun 06 2019
A001353 := proc(n) option remember; if n <= 1 then n else 4*A001353(n-1)-A001353(n-2); fi; end; A001353:=z/(1-4*z+z**2); # Simon Plouffe in his 1992 dissertation. seq( simplify(ChebyshevU(n-1, 2)), n=0..20); # G. C. Greubel, Dec 23 2019
a[n_] := (MatrixPower[{{1, 2}, {1, 3}}, n].{{1}, {1}})[[2, 1]]; Table[ a[n], {n, 0, 30}] (* Robert G. Wilson v, Jan 13 2005 *) Table[GegenbauerC[n-1, 1, 2], {n, 0, 30}] (* Zerinvary Lajos, Jul 14 2009 *) Table[-((I Sin[n ArcCos[2]])/Sqrt[3]), {n, 0, 30}] // FunctionExpand (* Eric W. Weisstein, Jul 16 2011 *) Table[Sinh[n ArcCosh[2]]/Sqrt[3], {n, 0, 30}] // FunctionExpand (* Eric W. Weisstein, Jul 16 2011 *) Table[ChebyshevU[n-1, 2], {n, 0, 30}] (* Eric W. Weisstein, Jul 16 2011 *) a[0]:=0; a[1]:=1; a[n_]:= a[n]= 4a[n-1] - a[n-2]; Table[a[n], {n, 0, 30}] (* Alonso del Arte, Jul 19 2011 *) LinearRecurrence[{4, -1}, {0, 1}, 30] (* Sture Sjöstedt, Dec 06 2011 *) Round@Table[Fibonacci[2n, Sqrt[2]]/Sqrt[2], {n, 0, 30}] (* Vladimir Reshetnikov, Sep 15 2016 *)
M = [ 1, 1, 0; 1, 3, 1; 0, 1, 1]; for(i=0,30,print1(([1,0,0]*M^i)[2],",")) \\ Lambert Klasen (Lambert.Klasen(AT)gmx.net), Jan 25 2005
{a(n) = real( (2 + quadgen(12))^n / quadgen(12) )}; /* Michael Somos, Sep 19 2008 */
{a(n) = polchebyshev(n-1, 2, 2)}; /* Michael Somos, Sep 19 2008 */
concat(0, Vec(x/(1-4*x+x^2) + O(x^30))) \\ Altug Alkan, Oct 30 2015
a001353 = [0, 1] for n in range(30): a001353.append(4*a001353[-1] - a001353[-2]) print(a001353) # Gennady Eremin, Feb 05 2022
[lucas_number1(n,4,1) for n in range(30)] # Zerinvary Lajos, Apr 22 2009
[chebyshev_U(n-1,2) for n in (0..20)] # G. C. Greubel, Dec 23 2019
2^6 - 1 = 63 does not divide a(2^4) = 708158977, therefore 63 is composite. 2^5 - 1 = 31 divides a(2^3) = 18817, therefore 31 is prime. G.f. = 1 + 2*x + 7*x^2 + 26*x^3 + 97*x^4 + 362*x^5 + 1351*x^6 + 5042*x^7 + ...
a001075 n = a001075_list !! n a001075_list = 1 : 2 : zipWith (-) (map (4 *) $ tail a001075_list) a001075_list -- Reinhard Zumkeller, Aug 11 2011
I:=[1, 2]; [n le 2 select I[n] else 4*Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Dec 19 2017
A001075 := proc(n) orthopoly[T](n,2) ; end proc: seq(A001075(n),n=0..30) ; # R. J. Mathar, Apr 14 2018
Table[ Ceiling[(1/2)*(2 + Sqrt[3])^n], {n, 0, 24}] CoefficientList[Series[(1-2*x) / (1-4*x+x^2), {x, 0, 24}], x] (* Jean-François Alcover, Dec 21 2011, after Simon Plouffe *) LinearRecurrence[{4,-1},{1,2},30] (* Harvey P. Dale, Aug 22 2015 *) Round@Table[LucasL[2n, Sqrt[2]]/2, {n, 0, 20}] (* Vladimir Reshetnikov, Sep 15 2016 *) ChebyshevT[Range[0, 20], 2] (* Eric W. Weisstein, May 26 2017 *) a[ n_] := LucasL[2*n, x]/2 /. x->Sqrt[2]; (* Michael Somos, Sep 05 2022 *)
{a(n) = subst(poltchebi(abs(n)), x, 2)};
{a(n) = real((2 + quadgen(12))^abs(n))};
{a(n) = polsym(1 - 4*x + x^2, abs(n))[1 + abs(n)]/2};
a(n)=polchebyshev(n,1,2) \\ Charles R Greathouse IV, Nov 07 2016
my(x='x+O('x^30)); Vec((1-2*x)/(1-4*x+x^2)) \\ G. C. Greubel, Dec 19 2017
[lucas_number2(n,4,1)/2 for n in range(0, 25)] # Zerinvary Lajos, May 14 2009
def a(n): Q = QuadraticField(3, 't') u = Q.units()[0] return (u^n).lift().coeffs()[0] # Ralf Stephan, Jun 19 2014
G.f. = 1 + 5*x + 19*x^2 + 71*x^3 + 265*x^4 + 989*x^5 + 3691*x^6 + ...
a001834 n = a001834_list !! (n-1) a001834_list = 1 : 5 : zipWith (-) (map (* 4) $ tail a001834_list) a001834_list -- Reinhard Zumkeller, Jan 23 2012
I:=[1,5]; [n le 2 select I[n] else 4*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Mar 22 2015
f:=n->((1+sqrt(3))^(2*n+1)+(1-sqrt(3))^(2*n+1))/2^(n+1); # N. J. A. Sloane, Nov 10 2009
a[0] = 1; a[1] = 5; a[n_] := a[n] = 4a[n - 1] - a[n - 2]; Table[ a[n], {n, 0, 25}] (* Robert G. Wilson v, Apr 24 2004 *) Table[Expand[((1+Sqrt[3])^(2*n+1)+(1+Sqrt[3])^(2*n+1))/2^(n+1)],{n, 0, 20}] (* Anton Vrba, Feb 14 2007 *) LinearRecurrence[{4, -1}, {1, 5}, 50] (* Sture Sjöstedt, Nov 27 2011 *) a[c_, n_] := Module[{}, p := Length[ContinuedFraction[ Sqrt[ c]][[2]]]; d := Numerator[Convergents[Sqrt[c], n p]]; t := Table[d[[1 + i]], {i, 0, Length[d] - 1, p}]; Return[t]; ] (* Complement of A002531 *) a[3, 20] (* Gerry Martens, Jun 07 2015 *) Round@Table[LucasL[2n+1, Sqrt[2]]/Sqrt[2], {n, 0, 20}] (* Vladimir Reshetnikov, Sep 15 2016 *)
{a(n) = real( (2 + quadgen(12))^n * (1 + quadgen(12)) )}; /* Michael Somos, Sep 19 2008 */
{a(n) = subst( polchebyshev(n-1, 2) + polchebyshev(n, 2), x, 2)}; /* Michael Somos, Sep 19 2008 */
[(lucas_number2(n,4,1)-lucas_number2(n-1,4,1))/2 for n in range(1, 27)] # Zerinvary Lajos, Nov 10 2009
G.f. = 2*x + 12*x^2 + 70*x^3 + 408*x^4 + 2378*x^5 + 13860*x^6 + ...
a:=[0,2];; for n in [3..20] do a[n]:=6*a[n-1]-a[n-2]; od; a; # G. C. Greubel, Dec 23 2019
a001542 n = a001542_list !! n a001542_list = 0 : 2 : zipWith (-) (map (6 *) $ tail a001542_list) a001542_list -- Reinhard Zumkeller, Aug 14 2011
I:=[0,2]; [n le 2 select I[n] else 6*Self(n-1) -Self(n-2): n in [1..20]]; // G. C. Greubel, Dec 23 2019
A001542:=2*z/(1-6*z+z**2); # conjectured by Simon Plouffe in his 1992 dissertation seq(combinat:-fibonacci(2*n, 2), n = 0..20); # Peter Luschny, Jun 28 2018
LinearRecurrence[{6, -1}, {0, 2}, 30] (* Harvey P. Dale, Jun 11 2011 *) Fibonacci[2*Range[0,20], 2] (* G. C. Greubel, Dec 23 2019 *) Table[2 ChebyshevU[-1 + n, 3], {n, 0, 20}] (* Herbert Kociemba, Jun 05 2022 *)
a[0]:0$ a[1]:2$ a[n]:=6*a[n-1]-a[n-2]$ A001542(n):=a[n]$ makelist(A001542(x),x,0,30); /* Martin Ettl, Nov 03 2012 */
{a(n) = imag( (3 + 2*quadgen(8))^n )}; /* Michael Somos, Jan 20 2017 */
vector(21, n, 2*polchebyshev(n-1, 2, 33) ) \\ G. C. Greubel, Dec 23 2019
l=[0, 2] for n in range(2, 51): l+=[6*l[n - 1] - l[n - 2], ] print(l) # Indranil Ghosh, Jun 06 2017
[2*chebyshev_U(n-1,3) for n in (0..20)] # G. C. Greubel, Dec 23 2019
Convergents to sqrt(3) are: 1, 2, 5/3, 7/4, 19/11, 26/15, 71/41, 97/56, 265/153, 362/209, 989/571, 1351/780, 3691/2131, ... = A002531/A002530 for n >= 1. 1 + 1/(1 + 1/(2 + 1/(1 + 1/2))) = 19/11 so a(5) = 11. G.f. = x + x^2 + 3*x^3 + 4*x^4 + 11*x^5 + 15*x^6 + 41*x^7 + ... - _Michael Somos_, Mar 18 2022
I:=[0,1,1,3]; [n le 4 select I[n] else 4*Self(n-2) - Self(n-4): n in [1..50]]; // G. C. Greubel, Feb 25 2019
a := proc(n) option remember; if n=0 then 0 elif n=1 then 1 elif n=2 then 1 elif n=3 then 3 else 4*a(n-2)-a(n-4) fi end; [ seq(a(i),i=0..50) ]; A002530:=-(-1-z+z**2)/(1-4*z**2+z**4); # conjectured (correctly) by Simon Plouffe in his 1992 dissertation
Join[{0},Table[Denominator[FromContinuedFraction[ContinuedFraction[Sqrt[3],n]]], {n,1,50}]] (* Stefan Steinerberger, Apr 01 2006 *) Join[{0},Denominator[Convergents[Sqrt[3],50]]] (* or *) LinearRecurrence[ {0,4,0,-1},{0,1,1,3},50] (* Harvey P. Dale, Jan 29 2013 *) a[ n_] := If[n<0, -(-1)^n, 1] SeriesCoefficient[ x*(1+x-x^2)/(1-4*x^2+x^4), {x, 0, Abs@n}]; (* Michael Somos, Apr 18 2019 *) a[ n_] := ChebyshevU[n-1, Sqrt[-1/2]]*Sqrt[2]^(Mod[n, 2]-1)/I^(n-1) //Simplify; (* Michael Somos, Nov 29 2022 *)
{a(n) = if( n<0, -(-1)^n * a(-n), contfracpnqn(vector(n, i, 1 + (i>1) * (i%2)))[2, 1])}; /* Michael Somos, Jun 05 2003 */
{ for (n=0, 50, a=contfracpnqn(vector(n, i, 1+(i>1)*(i%2)))[2, 1]; write("b002530.txt", n, " ", a); ); } \\ Harry J. Smith, Jun 01 2009
my(w=quadgen(12)); A002530(n)=real((2+w)^(n\/2)*if(bittest(n,0),1-w/3,w/3)); apply(A002530, [0..30]) \\ M. F. Hasler, Nov 04 2019
from functools import cache @cache def a(n): return [0, 1, 1, 3][n] if n < 4 else 4*a(n-2) - a(n-4) print([a(n) for n in range(36)]) # Michael S. Branicky, Nov 13 2022
(x*(1+x-x^2)/(1-4*x^2+x^4)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Feb 25 2019
Triangle begins: 1; 1, -1; 1, -1, -1; 1, -1, -2, 1; 1, -1, -3, 2, 1; 1, -1, -4, 3, 3, -1; 1, -1, -5, 4, 6, -3, -1; 1, -1, -6, 5, 10, -6, -4, 1; 1, -1, -7, 6, 15, -10, -10, 4, 1; 1, -1, -8, 7, 21, -15, -20, 10, 5, -1; 1, -1, -9, 8, 28, -21, -35, 20, 15, -5, -1; 1, -1, -10, 9, 36, -28, -56, 35, 35, -15, -6, 1; ...
a108299 n k = a108299_tabl !! n !! k a108299_row n = a108299_tabl !! n a108299_tabl = [1] : iterate (\row -> zipWith (+) (zipWith (*) ([0] ++ row) a033999_list) (zipWith (*) (row ++ [0]) a059841_list)) [1,-1] -- Reinhard Zumkeller, May 06 2012
A108299 := proc(n,k): binomial(n-floor((k+1)/2), floor(k/2))*(-1)^floor((k+1)/2) end: seq(seq(A108299 (n,k), k=0..n), n=0..11); # Johannes W. Meijer, Aug 08 2011
t[n_, k_?EvenQ] := I^k*Binomial[n-k/2, k/2]; t[n_, k_?OddQ] := -I^(k-1)*Binomial[n+(1-k)/2-1, (k-1)/2]; Table[t[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 16 2013 *)
{T(n,k)=polcoeff(polcoeff((1-x*y)/(1-x+x^2*y^2+x^2*O(x^n)),n,x)+y*O(y^k),k,y)} (Hanna)
0, 1, 0, 1, 0, 1, ... 1, 2, 3, 5, 8, 13, ... 0, 3, 0, 11, 0, 41, ... 1, 5, 11, 36, 95, 281, ... 0, 8, 0, 95, 0, 1183, ... 1, 13, 41, 281, 1183, 6728, ...
(Maple code for the even-numbered rows from N. J. A. Sloane, Mar 15 2015. This is not totally satisfactory since it uses floating point. However, it is useful for getting the initial values quickly.) Digits:=100; p:=evalf(Pi); z:=proc(h,d) global p; evalf(cos( h*p/(2*d+1) )); end; T:=proc(m,n) global z; round(mul( mul( 4*z(h,m)^2+4*z(k,n)^2, k=1..n), h=1..m)); end; [seq(T(1,n),n=0..10)]; # A001519 [seq(T(2,n),n=0..10)]; # A188899 [seq(T(3,n),n=0..10)]; # A256044 [seq(T(n,n),n=0..10)]; # A004003
T[?OddQ, ?OddQ] = 0; T[m_, n_] := Product[2*(2+Cos[2j*Pi/(m+1)]+Cos[2k*Pi/(n+1)]), {k, 1, n/2}, {j, 1, m/2}]; Flatten[Table[Round[T[m-n+1, n]], {m, 1, 12}, {n, 1, m}]] (* Jean-François Alcover, Nov 25 2011, updated May 28 2022 *)
{T(n, k) = sqrtint(abs(polresultant(polchebyshev(n, 2, x/2), polchebyshev(k, 2, I*x/2))))} \\ Seiichi Manyama, Apr 13 2020
a003500 n = a003500_list !! n a003500_list = 2 : 4 : zipWith (-) (map (* 4) $ tail a003500_list) a003500_list -- Reinhard Zumkeller, Dec 17 2011
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
A003500 := proc(n) option remember; if n <= 1 then 2*n+2 else 4*procname(n-1)-procname(n-2); fi; end proc;
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 *)
x='x+O('x^99); Vec(-2*(-1+2*x)/(1-4*x+x^2)) \\ Altug Alkan, Apr 04 2016
[lucas_number2(n,4,1) for n in range(0, 24)] # Zerinvary Lajos, May 14 2009
Comments