A028443 Erroneous version of A001108.
1, 8, 49, 288, 841, 9800
Offset: 0
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.
G.f.: x + 3*x^2 + 6*x^3 + 10*x^4 + 15*x^5 + 21*x^6 + 28*x^7 + 36*x^8 + 45*x^9 + ... When n=3, a(3) = 4*3/2 = 6. Example(a(4)=10): ABCD where A, B, C and D are different links in a chain or different amino acids in a peptide possible fragments: A, B, C, D, AB, ABC, ABCD, BC, BCD, CD = 10. a(2): hollyhock leaves on the Tokugawa Mon, a(4): points in Pythagorean tetractys, a(5): object balls in eight-ball billiards. - _Bradley Klee_, Aug 24 2015 From _Gus Wiseman_, Oct 28 2020: (Start) The a(1) = 1 through a(5) = 15 ordered triples of positive integers summing to n + 2 [Beeler, McGrath above] are the following. These compositions are ranked by A014311. (111) (112) (113) (114) (115) (121) (122) (123) (124) (211) (131) (132) (133) (212) (141) (142) (221) (213) (151) (311) (222) (214) (231) (223) (312) (232) (321) (241) (411) (313) (322) (331) (412) (421) (511) The unordered version is A001399(n-3) = A069905(n), with Heinz numbers A014612. The strict case is A001399(n-6)*6, ranked by A337453. The unordered strict case is A001399(n-6), with Heinz numbers A007304. (End)
a000217 n = a000217_list !! n a000217_list = scanl1 (+) [0..] -- Reinhard Zumkeller, Sep 23 2011
a000217=: *-:@>: NB. Stephen Makdisi, May 02 2018
[n*(n+1)/2: n in [0..60]]; // Bruno Berselli, Jul 11 2014
[n: n in [0..1500] | IsSquare(8*n+1)]; // Juri-Stepan Gerasimov, Apr 09 2016
A000217 := proc(n) n*(n+1)/2; end; istriangular:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return true else return false; end if; end proc; # N. J. A. Sloane, May 25 2008 ZL := [S, {S=Prod(B, B, B), B=Set(Z, 1 <= card)}, unlabeled]: seq(combstruct[count](ZL, size=n), n=2..55); # Zerinvary Lajos, Mar 24 2007 isA000217 := proc(n) issqr(1+8*n) ; end proc: # R. J. Mathar, Nov 29 2015 [This is the recipe Leonhard Euler proposes in chapter VII of his "Vollständige Anleitung zur Algebra", 1765. Peter Luschny, Sep 02 2022]
Array[ #*(# - 1)/2 &, 54] (* Zerinvary Lajos, Jul 10 2009 *) FoldList[#1 + #2 &, 0, Range@ 50] (* Robert G. Wilson v, Feb 02 2011 *) Accumulate[Range[0,70]] (* Harvey P. Dale, Sep 09 2012 *) CoefficientList[Series[x / (1 - x)^3, {x, 0, 50}], x] (* Vincenzo Librandi, Jul 30 2014 *) (* For Mathematica 10.4+ *) Table[PolygonalNumber[n], {n, 0, 53}] (* Arkadiusz Wesolowski, Aug 27 2016 *) LinearRecurrence[{3, -3, 1}, {0, 1, 3}, 54] (* Robert G. Wilson v, Dec 04 2016 *) (* The following Mathematica program, courtesy of Steven J. Miller, is useful for testing if a sequence is Benford. To test a different sequence only one line needs to be changed. This strongly suggests that the triangular numbers are not Benford, since the second and third columns of the output disagree. - N. J. A. Sloane, Feb 12 2017 *) fd[x_] := Floor[10^Mod[Log[10, x], 1]] benfordtest[num_] := Module[{}, For[d = 1, d <= 9, d++, digit[d] = 0]; For[n = 1, n <= num, n++, { d = fd[n(n+1)/2]; If[d != 0, digit[d] = digit[d] + 1]; }]; For[d = 1, d <= 9, d++, digit[d] = 1.0 digit[d]/num]; For[d = 1, d <= 9, d++, Print[d, " ", 100.0 digit[d], " ", 100.0 Log[10, (d + 1)/d]]]; ]; benfordtest[20000] Table[Length[Join@@Permutations/@IntegerPartitions[n,{3}]],{n,0,15}] (* Gus Wiseman, Oct 28 2020 *)
A000217(n) = n * (n + 1) / 2;
is_A000217(n)=n*2==(1+n=sqrtint(2*n))*n \\ M. F. Hasler, May 24 2012
is(n)=ispolygonal(n,3) \\ Charles R Greathouse IV, Feb 28 2014
list(lim)=my(v=List(),n,t); while((t=n*n++/2)<=lim,listput(v,t)); Vec(v) \\ Charles R Greathouse IV, Jun 18 2021
for n in range(0,60): print(n*(n+1)//2, end=', ') # Stefano Spezia, Dec 06 2018
# Intended to compute the initial segment of the sequence, not # isolated terms. If in the iteration the line "x, y = x + y + 1, y + 1" # is replaced by "x, y = x + y + k, y + k" then the figurate numbers are obtained, # for k = 0 (natural A001477), k = 1 (triangular), k = 2 (squares), k = 3 (pentagonal), k = 4 (hexagonal), k = 5 (heptagonal), k = 6 (octagonal), etc. def aList(): x, y = 1, 1 yield 0 while True: yield x x, y = x + y + 1, y + 1 A000217 = aList() print([next(A000217) for i in range(54)]) # Peter Luschny, Aug 03 2019
[n*(n+1)/2 for n in (0..60)] # Bruno Berselli, Jul 11 2014
(1 to 53).scanLeft(0)( + ) // Horstmann (2012), p. 171
(define (A000217 n) (/ (* n (+ n 1)) 2)) ;; Antti Karttunen, Jul 08 2017
G.f. = x + 2*x^2 + 5*x^3 + 12*x^4 + 29*x^5 + 70*x^6 + 169*x^7 + 408*x^8 + 985*x^9 + ... From _Enrique Navarrete_, Dec 15 2023: (Start) From the comment on compositions with Fibonacci number of parts, F(n), there are F(1)=1 type of 1, F(2)=1 type of 2, F(3)=2 types of 3, F(4)=3 types of 4, F(5)=5 types of 5 and F(6)=8 types of 6. The following table gives the number of compositions of n=6 with Fibonacci number of parts: Composition, number of such compositions, number of compositions of this type: 6, 1, 8; 5+1, 2, 10; 4+2, 2, 6; 3+3, 1, 4; 4+1+1, 3, 9; 3+2+1, 6, 12; 2+2+2, 1, 1; 3+1+1+1, 4, 8; 2+2+1+1, 6, 6; 2+1+1+1+1, 5, 5; 1+1+1+1+1+1, 1, 1; for a total of a(6)=70 compositions of n=6. (End).
a := [0,1];; for n in [3..10^3] do a[n] := 2 * a[n-1] + a[n-2]; od; A000129 := a; # Muniru A Asiru, Oct 16 2017
a000129 n = a000129_list !! n a000129_list = 0 : 1 : zipWith (+) a000129_list (map (2 *) $ tail a000129_list) -- Reinhard Zumkeller, Jan 05 2012, Feb 05 2011
[0] cat [n le 2 select n else 2*Self(n-1) + Self(n-2): n in [1..35]]; // Vincenzo Librandi, Aug 08 2015
A000129 := proc(n) option remember; if n <=1 then n; else 2*procname(n-1)+procname(n-2); fi; end; a:= n-> (<<2|1>, <1|0>>^n)[1, 2]: seq(a(n), n=0..40); # Alois P. Heinz, Aug 01 2008 A000129 := n -> `if`(n<2, n, 2^(n-1)*hypergeom([1-n/2, (1-n)/2], [1-n], -1)): seq(simplify(A000129(n)), n=0..31); # Peter Luschny, Dec 17 2015
CoefficientList[Series[x/(1 - 2*x - x^2), {x, 0, 60}], x] (* Stefan Steinerberger, Apr 08 2006 *) Expand[Table[((1 + Sqrt[2])^n - (1 - Sqrt[2])^n)/(2Sqrt[2]), {n, 0, 30}]] (* Artur Jasinski, Dec 10 2006 *) LinearRecurrence[{2, 1}, {0, 1}, 60] (* Harvey P. Dale, Jan 04 2012 *) a[ n_] := With[ {s = Sqrt@2}, ((1 + s)^n - (1 - s)^n) / (2 s)] // Simplify; (* Michael Somos, Jun 01 2013 *) Table[Fibonacci[n, 2], {n, 0, 20}] (* Vladimir Reshetnikov, May 08 2016 *) Fibonacci[Range[0, 20], 2] (* Eric W. Weisstein, Sep 30 2017 *) a[ n_] := ChebyshevU[n - 1, I] / I^(n - 1); (* Michael Somos, Oct 30 2021 *)
a[0]:0$ a[1]:1$ a[n]:=2*a[n-1]+a[n-2]$ A000129(n):=a[n]$ makelist(A000129(n),n,0,30); /* Martin Ettl, Nov 03 2012 */
makelist((%i)^(n-1)*ultraspherical(n-1,1,-%i),n,0,24),expand; /* Emanuele Munarini, Mar 07 2018 */
for (n=0, 4000, a=contfracpnqn(vector(n, i, 1+(i>1)))[2, 1]; if (a > 10^(10^3 - 6), break); write("b000129.txt", n, " ", a)); \\ Harry J. Smith, Jun 12 2009
{a(n) = imag( (1 + quadgen( 8))^n )}; /* Michael Somos, Jun 01 2013 */
{a(n) = if( n<0, -(-1)^n, 1) * contfracpnqn( vector( abs(n), i, 1 + (i>1))) [2, 1]}; /* Michael Somos, Jun 01 2013 */
a(n)=([2, 1; 1, 0]^n)[2,1] \\ Charles R Greathouse IV, Mar 04 2014
{a(n) = polchebyshev(n-1, 2, I) / I^(n-1)}; /* Michael Somos, Oct 30 2021 */
from itertools import islice def A000129_gen(): # generator of terms a, b = 0, 1 yield from [a,b] while True: a, b = b, a+2*b yield b A000129_list = list(islice(A000129_gen(),20)) # Chai Wah Wu, Jan 11 2022
[lucas_number1(n, 2, -1) for n in range(30)] # Zerinvary Lajos, Apr 22 2009
Convergents are 1, 3/2, 7/5, 17/12, 41/29, 99/70, 239/169, 577/408, 1393/985, 3363/2378, 8119/5741, 19601/13860, 47321/33461, 114243/80782, ... = A001333/A000129. The 15 3 X 2 crossword grids, with white squares represented by an o: ooo ooo ooo ooo ooo ooo ooo oo. o.o .oo o.. .o. ..o oo. .oo ooo oo. o.o .oo o.. .o. ..o ooo ooo ooo ooo ooo ooo .oo oo. G.f. = 1 + x + 3*x^2 + 7*x^3 + 17*x^4 + 41*x^5 + 99*x^6 + 239*x^7 + 577*x^8 + ...
a001333 n = a001333_list !! n a001333_list = 1 : 1 : zipWith (+) a001333_list (map (* 2) $ tail a001333_list) -- Reinhard Zumkeller, Jul 08 2012
[n le 2 select 1 else 2*Self(n-1)+Self(n-2): n in [1..35]]; // Vincenzo Librandi, Nov 10 2018
A001333 := proc(n) option remember; if n=0 then 1 elif n=1 then 1 else 2*procname(n-1)+procname(n-2) fi end; Digits := 50; A001333 := n-> round((1/2)*(1+sqrt(2))^n); with(numtheory): cf := cfrac (sqrt(2),1000): [seq(nthnumer(cf,i), i=0..50)]; a:= n-> (M-> M[2, 1]+M[2, 2])(<<2|1>, <1|0>>^n): seq(a(n), n=0..33); # Alois P. Heinz, Aug 01 2008 A001333List := proc(m) local A, P, n; A := [1,1]; P := [1,1]; for n from 1 to m - 2 do P := ListTools:-PartialSums([op(A), P[-2]]); A := [op(A), P[-1]] od; A end: A001333List(32); # Peter Luschny, Mar 26 2022
Insert[Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[2], n]]], {n, 1, 40}], 1, 1] (* Stefan Steinerberger, Apr 08 2006 *) Table[((1 - Sqrt[2])^n + (1 + Sqrt[2])^n)/2, {n, 0, 29}] // Simplify (* Robert G. Wilson v, May 02 2006 *) a[0] = 1; a[1] = 1; a[n_] := a[n] = 2a[n - 1] + a[n - 2]; Table[a@n, {n, 0, 29}] (* Robert G. Wilson v, May 02 2006 *) Table[ MatrixPower[{{1, 2}, {1, 1}}, n][[1, 1]], {n, 0, 30}] (* Robert G. Wilson v, May 02 2006 *) a=c=0;t={b=1}; Do[c=a+b+c; AppendTo[t,c]; a=b;b=c,{n,40}]; t (* Vladimir Joseph Stephan Orlovsky, Mar 23 2009 *) LinearRecurrence[{2, 1}, {1, 1}, 40] (* Vladimir Joseph Stephan Orlovsky, Mar 23 2009 *) Join[{1}, Numerator[Convergents[Sqrt[2], 30]]] (* Harvey P. Dale, Aug 22 2011 *) Table[(-I)^n ChebyshevT[n, I], {n, 10}] (* Eric W. Weisstein, Apr 04 2017 *) CoefficientList[Series[(-1 + x)/(-1 + 2 x + x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 21 2017 *) Table[Sqrt[(ChebyshevT[n, 3] + (-1)^n)/2], {n, 0, 20}] (* Eric W. Weisstein, Apr 17 2018 *)
{a(n) = if( n<0, (-1)^n, 1) * contfracpnqn( vector( abs(n), i, 1 + (i>1))) [1, 1]}; /* Michael Somos, Sep 02 2012 */
{a(n) = polchebyshev(n, 1, I) / I^n}; /* Michael Somos, Sep 02 2012 */
a(n) = real((1 + quadgen(8))^n); \\ Michel Marcus, Mar 16 2021
{ for (n=0, 4000, a=contfracpnqn(vector(n, i, 1+(i>1)))[1, 1]; if (a > 10^(10^3 - 6), break); write("b001333.txt", n, " ", a); ); } \\ Harry J. Smith, Jun 12 2009
from functools import cache @cache def a(n): return 1 if n < 2 else 2*a(n-1) + a(n-2) print([a(n) for n in range(32)]) # Michael S. Branicky, Nov 13 2022
from sage.combinat.sloane_functions import recur_gen2 it = recur_gen2(1,1,2,1) [next(it) for i in range(30)] ## Zerinvary Lajos, Jun 24 2008
[lucas_number2(n,2,-1)/2 for n in range(0, 30)] # Zerinvary Lajos, Apr 30 2009
From _Muniru A Asiru_, Mar 19 2018: (Start) For k=1, 2*1^2 - 1 = 2 - 1 = 1 = 1^2. For k=5, 2*5^2 - 1 = 50 - 1 = 49 = 7^2. For k=29, 2*29^2 - 1 = 1682 - 1 = 1681 = 41^2. ... (End) G.f. = x + 5*x^2 + 29*x^3 + 169*x^4 + 985*x^5 + 5741*x^6 + ... - _Michael Somos_, Jun 26 2022
a:=[1,5];; for n in [3..25] do a[n]:=6*a[n-1]-a[n-2]; od; a; # Muniru A Asiru, Mar 19 2018
a001653 n = a001653_list !! n a001653_list = 1 : 5 : zipWith (-) (map (* 6) $ tail a001653_list) a001653_list -- Reinhard Zumkeller, May 07 2013
I:=[1,5]; [n le 2 select I[n] else 6*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Feb 22 2014
a[0]:=1: a[1]:=5: for n from 2 to 26 do a[n]:=6*a[n-1]-a[n-2] od: seq(a[n], n=0..20); # Zerinvary Lajos, Jul 26 2006 A001653:=-(-1+5*z)/(z**2-6*z+1); # Conjectured (correctly) by Simon Plouffe in his 1992 dissertation; gives sequence except for one of the leading 1's
LinearRecurrence[{6,-1}, {1,5}, 40] (* Harvey P. Dale, Jul 12 2011 *) a[ n_] := -(-1)^n ChebyshevU[2 n - 2, I]; (* Michael Somos, Jul 22 2018 *) Numerator[{1} ~Join~ Table[FromContinuedFraction[Flatten[Table[{1, 4}, n]]], {n, 1, 40}]]; (* Greg Dresden, Sep 10 2019 *)
{a(n) = subst(poltchebi(n-1) + poltchebi(n), x, 3)/4}; /* Michael Somos, Nov 02 2002 */
a(n)=([5,2;2,1]^(n-1))[1,1] \\ Lambert Klasen (lambert.klasen(AT)gmx.de), corrected by Eric Chen, Jun 14 2018
{a(n) = -(-1)^n * polchebyshev(2*n-2, 2, I)}; /* Michael Somos, Jun 26 2022 */
G.f. = x + 6*x^2 + 35*x^3 + 204*x^4 + 1189*x^5 + 6930*x^6 + 40391*x^7 + ... 6 is in the sequence since 6^2 = 36 is a triangular number: 36 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8. - _Michael B. Porter_, Jul 02 2016
a:=[0,1];; for n in [3..25] do a[n]:=6*a[n-1]-a[n-2]; od; a; # Muniru A Asiru, Dec 18 2018
a001109 n = a001109_list !! n :: Integer a001109_list = 0 : 1 : zipWith (-) (map (* 6) $ tail a001109_list) a001109_list -- Reinhard Zumkeller, Dec 17 2011
[n le 2 select n-1 else 6*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jul 25 2015
a[0]:=1: a[1]:=6: for n from 2 to 26 do a[n]:=6*a[n-1]-a[n-2] od: seq(a[n],n=0..26); # Emeric Deutsch with (combinat):seq(fibonacci(2*n,2)/2, n=0..20); # Zerinvary Lajos, Apr 20 2008
Transpose[NestList[Flatten[{Rest[#],ListCorrelate[{-1,6},#]}]&, {0,1}, 30]][[1]] (* Harvey P. Dale, Mar 23 2011 *) CoefficientList[Series[x/(1-6x+x^2),{x,0,30}],x] (* Harvey P. Dale, Mar 23 2011 *) LinearRecurrence[{6, -1}, {0, 1}, 50] (* Vladimir Joseph Stephan Orlovsky, Feb 12 2012 *) a[ n_]:= ChebyshevU[n-1, 3]; (* Michael Somos, Sep 02 2012 *) Table[Fibonacci[2n, 2]/2, {n, 0, 20}] (* Vladimir Reshetnikov, Sep 16 2016 *) TrigExpand@Table[Sinh[2 n ArcCsch[1]]/(2 Sqrt[2]), {n, 0, 10}] (* Federico Provvedi, Feb 01 2021 *)
{a(n) = imag((3 + quadgen(32))^n)}; /* Michael Somos, Apr 07 2003 */
{a(n) = subst( poltchebi( abs(n+1)) - 3 * poltchebi( abs(n)), x, 3) / 8}; /* Michael Somos, Apr 07 2003 */
{a(n) = polchebyshev( n-1, 2, 3)}; /* Michael Somos, Sep 02 2012 */
is(n)=ispolygonal(n^2,3) \\ Charles R Greathouse IV, Nov 03 2016
[lucas_number1(n,6,1) for n in range(27)] # Zerinvary Lajos, Jun 25 2008
[chebyshev_U(n-1,3) for n in (0..20)] # G. C. Greubel, Dec 23 2019
The first few triples are (0,1,1), (3,4,5), (20,21,29), (119,120,169), ...
a:=[0,3];; for n in [3..25] do a[n]:=6*a[n-1]-a[n-2]+2; od; a; # Muniru A Asiru, Dec 08 2018
a001652 n = a001652_list !! n a001652_list = 0 : 3 : map (+ 2) (zipWith (-) (map (* 6) (tail a001652_list)) a001652_list) -- Reinhard Zumkeller, Jan 10 2012
Z:=PolynomialRing(Integers()); N :=NumberField(x^2-2); S:=[ (-2+(r2+1)*(3+2*r2)^n-(r2-1)*(3-2*r2)^n)/4: n in [1..20] ]; [ Integers()!S[j]: j in [1..#S] ]; // Klaus Brockhaus, Feb 17 2009
m:=30; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(x*(3-x)/((1-6*x+x^2)*(1-x)))); // G. C. Greubel, Jul 15 2018
A001652 := proc(n) option remember; if n <= 1 then op(n+1,[0,3]) ; else 6*procname(n-1)-procname(n-2)+2 ; end if; end proc: # R. J. Mathar, Feb 05 2016
LinearRecurrence[{7,-7,1}, {0,3,20}, 30] (* Harvey P. Dale, Aug 19 2011 *) With[{c=3+2*Sqrt[2]},NestList[Floor[c*#]+3&,3,30]] (* Harvey P. Dale, Oct 22 2012 *) CoefficientList[Series[x (3 - x)/((1 - 6 x + x^2) (1 - x)), {x, 0, 30}], x] (* Vincenzo Librandi, Oct 21 2014 *) Table[(LucasL[2*n + 1, 2] - 2)/4, {n, 0, 30}] (* G. C. Greubel, Jul 15 2018 *)
{a(n) = subst( poltchebi(n+1) - poltchebi(n) - 2, x, 3) / 4}; /* Michael Somos, Aug 11 2006 */
concat(0, Vec(x*(3-x)/((1-6*x+x^2)*(1-x)) + O(x^50))) \\ Altug Alkan, Nov 08 2015
{a=1+sqrt(2); b=1-sqrt(2); Q(n) = a^n + b^n}; for(n=0, 30, print1(round((Q(2*n+1) - 2)/4), ", ")) \\ G. C. Greubel, Jul 15 2018
(x*(3-x)/((1-6*x+x^2)*(1-x))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Mar 08 2019
G.f. = 1 + 7*x + 41*x^2 + 239*x^3 + 1393*x^4 + 8119*x^5 + 17321*x^6 + ... - _Michael Somos_, Jun 26 2022
a002315 n = a002315_list !! n a002315_list = 1 : 7 : zipWith (-) (map (* 6) (tail a002315_list)) a002315_list -- Reinhard Zumkeller, Jan 10 2012
I:=[1,7]; [n le 2 select I[n] else 6*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Mar 22 2015
A002315 := proc(n) option remember; if n = 0 then 1 ; elif n = 1 then 7; else 6*procname(n-1)-procname(n-2) ; end if; end proc: # Zerinvary Lajos, Jul 26 2006, modified R. J. Mathar, Apr 30 2017 a:=n->abs(Im(simplify(ChebyshevT(2*n+1,I)))):seq(a(n),n=0..20); # Leonid Bedratyuk, Dec 17 2017 # third Maple program: a:= n-> (<<0|1>, <-1|6>>^n. <<1, 7>>)[1, 1]: seq(a(n), n=0..22); # Alois P. Heinz, Aug 25 2024
a[0] = 1; a[1] = 7; a[n_] := a[n] = 6a[n - 1] - a[n - 2]; Table[ a[n], {n, 0, 20}] (* Robert G. Wilson v, Jun 09 2004 *) Transpose[NestList[Flatten[{Rest[#],ListCorrelate[{-1,6},#]}]&, {1,7},20]][[1]] (* Harvey P. Dale, Mar 23 2011 *) Table[ If[n>0, a=b; b=c; c=6b-a, b=-1; c=1], {n, 0, 20}] (* Jean-François Alcover, Oct 19 2012 *) LinearRecurrence[{6, -1}, {1, 7}, 20] (* Bruno Berselli, Apr 03 2018 *) a[ n_] := -I*(-1)^n*ChebyshevT[2*n + 1, I]; (* Michael Somos, Jun 26 2022 *)
{a(n) = subst(poltchebi(abs(n+1)) - poltchebi(abs(n)), x, 3)/2};
{a(n) = if(n<0, -a(-1-n), polsym(x^2-2*x-1, 2*n+1)[2*n+2]/2)};
{a(n) = my(w=3+quadgen(32)); imag((1+w)*w^n)};
for (i=1,10000,if(Mod(sigma(i^2+1,2),2)==1,print1(i,",")))
{a(n) = -I*(-1)^n*polchebyshev(2*n+1, 1, I)}; /* Michael Somos, Jun 26 2022 */
99^2 + 99^2 = 140^2 + 2. - _Carmine Suriano_, Jan 05 2015 G.f. = 1 + 3*x + 17*x^2 + 99*x^3 + 577*x^4 + 3363*x^5 + 19601*x^6 + 114243*x^7 + ...
a001541 n = a001541_list !! (n-1) a001541_list = 1 : 3 : zipWith (-) (map (* 6) $ tail a001541_list) a001541_list -- Reinhard Zumkeller, Oct 06 2011 (Scheme, with memoization-macro definec) (definec (A001541 n) (cond ((zero? n) 1) ((= 1 n) 3) (else (- (* 6 (A001541 (- n 1))) (A001541 (- n 2)))))) ;; Antti Karttunen, Oct 04 2016
[n: n in [1..10000000] |IsSquare(8*(n^2-1))]; // Vincenzo Librandi, Nov 18 2010
a[0]:=1: a[1]:=3: for n from 2 to 26 do a[n]:=6*a[n-1]-a[n-2] od: seq(a[n], n=0..20); # Zerinvary Lajos, Jul 26 2006 A001541:=-(-1+3*z)/(1-6*z+z**2); # Simon Plouffe in his 1992 dissertation
Table[Simplify[(1/2) (3 + 2 Sqrt[2])^n + (1/2) (3 - 2 Sqrt[2])^n], {n, 0, 20}] (* Artur Jasinski, Feb 10 2010 *) a[ n_] := If[n == 0, 1, With[{m = Abs @ n}, m Sum[4^i Binomial[m + i, 2 i]/(m + i), {i, 0, m}]]]; (* Michael Somos, Jul 11 2011 *) a[ n_] := ChebyshevT[ n, 3]; (* Michael Somos, Jul 11 2011 *) LinearRecurrence[{6, -1}, {1, 3}, 50] (* Vladimir Joseph Stephan Orlovsky, Feb 12 2012 *)
{a(n) = real((3 + quadgen(32))^n)}; /* Michael Somos, Apr 07 2003 */
{a(n) = subst( poltchebi( abs(n)), x, 3)}; /* Michael Somos, Apr 07 2003 */
{a(n) = if( n<0, a(-n), polsym(1 - 6*x + x^2, n) [n+1] / 2)}; /* Michael Somos, Apr 07 2003 */
{a(n) = polchebyshev( n, 1, 3)}; /* Michael Somos, Jul 11 2011 */
a(n)=([1,2,2;2,1,2;2,2,3]^n)[3,3] \\ Vim Wenders, Mar 28 2007
a(2) = ((17 + 12*sqrt(2))^2 + (17 - 12*sqrt(2))^2 - 2)/32 = (289 + 24*sqrt(2) + 288 + 289 - 24*sqrt(2) + 288 - 2)/32 = (578 + 576 - 2)/32 = 1152/32 = 36 and 6^2 = 36 = 8*9/2 => a(2) is both the 6th square and the 8th triangular number.
a001110 n = a001110_list !! n a001110_list = 0 : 1 : (map (+ 2) $ zipWith (-) (map (* 34) (tail a001110_list)) a001110_list) -- Reinhard Zumkeller, Oct 12 2011
[n le 2 select n-1 else Floor((6*Sqrt(Self(n-1)) - Sqrt(Self(n-2)))^2): n in [1..20]]; // Vincenzo Librandi, Jul 22 2015
a:=17+12*sqrt(2); b:=17-12*sqrt(2); A001110:=n -> expand((a^n + b^n - 2)/32); seq(A001110(n), n=0..20); # Jaap Spies, Dec 12 2004 A001110:=-(1+z)/((z-1)*(z**2-34*z+1)); # Simon Plouffe in his 1992 dissertation
f[n_]:=n*(n+1)/2; lst={}; Do[If[IntegerQ[Sqrt[f[n]]],AppendTo[lst,f[n]]],{n,0,10!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 12 2010 *) Table[(1/8) Round[N[Sinh[2 n ArcSinh[1]]^2, 100]], {n, 0, 20}] (* Artur Jasinski, Feb 10 2010 *) Transpose[NestList[Flatten[{Rest[#],34Last[#]-First[#]+2}]&, {0,1},20]][[1]] (* Harvey P. Dale, Mar 25 2011 *) LinearRecurrence[{35, -35, 1}, {0, 1, 36}, 20] (* T. D. Noe, Mar 25 2011 *) LinearRecurrence[{6,-1},{0,1},20]^2 (* Harvey P. Dale, Oct 22 2012 *) (* Square = Triangular = Triangular = A001110 *) ChebyshevU[#-1,3]^2==Binomial[ChebyshevT[#/2,3]^2,2]==Binomial[(1+ChebyshevT[#,3])/2,2]=={1,36,1225,41616,1413721}[[#]]&@Range[5] True (* Bill Gosper, Jul 20 2015 *) L=0;r={};Do[AppendTo[r,L];L=1+17*L+6*Sqrt[L+8*L^2],{i,1,19}];r (* Kebbaj Mohamed Reda, Aug 02 2023 *)
a=vector(100);a[1]=1;a[2]=36;for(n=3,#a,a[n]=34*a[n-1]-a[n-2]+2);a \\ Charles R Greathouse IV, Jul 25 2011
;; With memoizing definec-macro from Antti Karttunen's IntSeq-library. (definec (A001110 n) (if (< n 2) n (+ 2 (- (* 34 (A001110 (- n 1))) (A001110 (- n 2)))))) ;; Antti Karttunen, Dec 06 2013
;; For testing whether n is in this sequence: (define (inA001110? n) (and (zero? (A068527 n)) (inA001109? (floor->exact (sqrt n))))) (define (inA001109? n) (= (* 8 n n) (floor->exact (* (sqrt 8) n (ceiling->exact (* (sqrt 8) n)))))) ;; Antti Karttunen, Dec 06 2013
Comments