Displaying 121-130 of 209 results found.
page
1
...
10
11
12
13
14
15
16
17
18
19
20
21
Number of binary words of length n such that the difference between the number of 1's and the number of 0's is in the interval [-2,3] for every prefix and in the interval [-3,2] for every suffix.
+10
3
1, 2, 4, 6, 12, 18, 35, 54, 103, 162, 307, 486, 926, 1458, 2823, 4374, 8688, 13122, 26962, 39366, 84285, 118098, 265147, 354294, 838625, 1062882, 2664636, 3188646, 8499263, 9565938, 27197074, 28697814, 87261592, 86093442, 280596321, 258280326, 903916589
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,11,0,-46,0,90,0,-81,0,28,0,-3)
FORMULA
G.f.: -(2*x^11-18*x^9+9*x^8+48*x^7+3*x^6-44*x^5-14*x^4+16*x^3+7*x^2-2*x-1) / ((3*x^2-1) *(x^2+x-1) *(x^2-x-1) *(x^3-2*x^2-x+1) *(x^3+2*x^2-x-1)).
EXAMPLE
a(3) = 6: 001, 010, 011, 100, 101, 110.
a(4) = 12: 0010, 0011, 0100, 0101, 0110, 1000, 1001, 1010, 1011, 1100, 1101, 1110.
a(5) = 18: 00101, 00110, 01001, 01010, 01011, 01100, 01101, 01110, 10001, 10010, 10011, 10100, 10101, 10110, 11000, 11001, 11010, 11100.
a(6) = 35: 001010, 001011, 001100, 001101, 001110, 010010, 010011, 010100, 010101, 010110, 011000, 011001, 011010, 011100, 100010, 100011, 100100, 100101, 100110, 101000, 101001, 101010, 101011, 101100, 101101, 101110, 110001, 110010, 110011, 110100, 110101, 110110, 111000, 111001, 111010.
MATHEMATICA
LinearRecurrence[{0, 11, 0, -46, 0, 90, 0, -81, 0, 28, 0, -3}, {1, 2, 4, 6, 12, 18, 35, 54, 103, 162, 307, 486}, 40] (* Harvey P. Dale, Sep 17 2019 *)
A variant of Look and Say sequence ( A005150) based on exponents in prime factorization of n (see Comments section for precise definition).
+10
3
1, 6, 105, 12, 315, 18, 945, 24, 525, 6006, 2835, 420, 8505, 42042, 735, 48, 25515, 1050, 76545, 12012, 440895, 294294, 229635, 840, 1575, 2060058, 2625, 84084, 688905, 54, 2066715, 96, 5731635, 14420406, 2205, 36, 6200145, 100942842, 74511255, 24024, 18600435
COMMENTS
To compute a(n):
- a(1) = 1,
- for n > 1:
- consider the prime factorization of n:
n = Product_{i = 1..k} prime(i)^e_i
(where e_k > 0 and prime(i) denotes the i-th prime number),
- apply the Look and Say procedure to the list (e_k, ..., e_1),
- the result, say (f_m, ..., f_1), gives the prime exponents for a(n):
a(n) = Product_{i = 1..m} prime(i)^f_i.
There are only two fixed points: a(1) = 1 and a(36) = 36.
All terms are distinct and belong to A244990 (but some terms of A244990, like 210 = 7*5*3*2, do not appear here).
FORMULA
a(n) = n mod 2.
a(prime(n)) = 7*5*3^(n-1) for any n > 1.
EXAMPLE
For n = 99:
- 99 = 11^1 * 7^0 * 5^0 * 3^2 * 2^0,
- the list of exponents is: 1 0 0 2 0,
- applying the Look and Say procedure, we obtain: 1 1 2 0 1 2 1 0,
- so a(99) = 19^1 * 17^1 * 13^2 * 11^0 * 7^1 * 5^2 * 3^1 * 2^0 = 28658175.
PROG
(PARI) See Links section.
Pisot sequences E(4,7), P(4,7).
+10
2
4, 7, 12, 21, 37, 65, 114, 200, 351, 616, 1081, 1897, 3329, 5842, 10252, 17991, 31572, 55405, 97229, 170625, 299426, 525456, 922111, 1618192, 2839729, 4983377, 8745217, 15346786, 26931732, 47261895, 82938844, 145547525, 255418101, 448227521, 786584466
COMMENTS
See A008776 for definitions of Pisot sequences.
FORMULA
a(n) = 2a(n-1) - a(n-2) + a(n-3) for n>=3. (Proved using the PtoRv program of Ekhad-Sloane-Zeilberger.) - N. J. A. Sloane, Sep 09 2016
PROG
(PARI) pisotE(nmax, a1, a2) = {
a=vector(nmax); a[1]=a1; a[2]=a2;
for(n=3, nmax, a[n] = floor(a[n-1]^2/a[n-2]+1/2));
a
}
Pisot sequence E(14,23), a(n) = floor( a(n-1)^2/a(n-2)+1/2 ).
+10
2
14, 23, 38, 63, 104, 172, 284, 469, 775, 1281, 2117, 3499, 5783, 9558, 15797, 26109, 43152, 71320, 117875, 194819, 321989, 532170, 879548, 1453680, 2402581, 3970885, 6562912, 10846905, 17927308, 29629500, 48970390, 80936199, 133767942, 221086022, 365401668
FORMULA
It is known (Boyd, 1977) that this sequence does not satisfy a linear recurrence. - N. J. A. Sloane, Aug 07 2016
MATHEMATICA
RecurrenceTable[{a[1] == 14, a[2] == 23, a[n] == Floor[a[n-1]^2/a[n-2]+1/2]}, a, {n, 40}] (* Vincenzo Librandi, Aug 09 2016 *)
PROG
(PARI) pisotE(nmax, a1, a2) = {
a=vector(nmax); a[1]=a1; a[2]=a2;
for(n=3, nmax, a[n] = floor(a[n-1]^2/a[n-2]+1/2));
a
}
(Python)
a, b = 14, 23
for i in range(1000):
c, d = divmod(b**2, a)
a, b = b, c + (0 if 2*d < a else 1)
Shallit sequence S(3,13), a(n)=[ a(n-1)^2/a(n-2)+1 ].
+10
2
3, 13, 57, 250, 1097, 4814, 21126, 92711, 406861, 1785505, 7835669, 34386747, 150905861, 662248712, 2906271193, 12754139184, 55971399613, 245629871954, 1077943993063, 4730545364606, 20759946333583, 91104796287932, 399812397069577, 1754572309731352
COMMENTS
Matches the sequence A275634 with g.f. ( 3-2*x-2*x^2 ) / ( 1-5*x+2*x^2+3*x^3 ) for n<=9, but is then different. - R. J. Mathar, Feb 11 2016
MAPLE
option remember;
if n <= 1 then
op(n+1, [3, 13]) ;
else
a := procname(n-1)^2/procname(n-2) ;
floor(1+a) ;
end if;
MATHEMATICA
RecurrenceTable[{a[0]==3, a[1]==13, a[n]==Floor[a[n-1]^2/a[n-2]+1]}, a[n], {n, 25}] (* Harvey P. Dale, Oct 24 2011 *)
PROG
(PARI) A010921(n, a=[3, 13])={for(n=2, if(type(n)=="t_VEC", n[1], n), a=concat(a, a[n]^2\a[n-1]+1)); if(type(n)=="t_VEC", a, a[n+1])} \\ Use A010921([n]) to get the vector [a(0), ..., a(n)] \\ M. F. Hasler, Feb 11 2016
(PARI) pisotS(nmax, a1, a2) = {
a=vector(nmax); a[1]=a1; a[2]=a2;
for(n=3, nmax, a[n] = floor(a[n-1]^2/a[n-2]+1));
a
}
First differences of Shallit sequence S(3,7) ( A020730).
+10
2
3, 4, 10, 25, 62, 154, 383, 952, 2366, 5881, 14618, 36335, 90315, 224489, 557995, 1386965, 3447471, 8569111, 21299574, 52942697, 131595551, 327096843, 813039224, 2020908468, 5023215259, 12485816125, 31035023639, 77141348442, 191744259926, 476603818278
MATHEMATICA
Prepend[Differences@ #, First@ #] &@ RecurrenceTable[{a[n] == Floor[a[n - 1]^2/a[n - 2] + 1], a[0] == 3, a[1] == 7}, a, {n, 0, 29}] (* Michael De Vlieger, Aug 10 2016 *)
Define the generalized Pisot sequence T(a(0),a(1)) by: a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). This is T(2,6).
+10
2
2, 6, 17, 48, 135, 379, 1064, 2987, 8385, 23538, 66074, 185477, 520654, 1461532, 4102678, 11516659, 32328502, 90749586, 254743859, 715093440, 2007344278, 5634831512, 15817578736, 44401646533, 124640202381, 349878467638, 982146528794, 2756991050447
COMMENTS
Not to be confused with the Pisot T(2,6) sequence, which is A008776. - R. J. Mathar, Feb 13 2016
MAPLE
option remember;
if n <= 1 then
op(n+1, [2, 6]) ;
else
a := procname(n-1)^2/procname(n-2) ;
if type(a, 'integer') then
a-1 ;
else
floor(a) ;
fi;
end if;
MATHEMATICA
RecurrenceTable[{a[1] == 2, a[2] == 6, a[n] == Ceiling[a[n - 1]^2/a[n - 2]] - 1}, a, {n, 30}] (* Bruno Berselli, Feb 17 2016 *)
PROG
(PARI) T(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=ceil(a[n-1]^2/a[n-2])-1); a
(Magma) Tiv:=[2, 6]; [n le 2 select Tiv[n] else Ceiling(Self(n-1)^2/Self(n-2))-1: n in [1..40]]; // Bruno Berselli, Feb 17 2016
Define the generalized Pisot sequence T(a(0),a(1)) by: a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). This is T(3,6).
+10
2
3, 6, 11, 20, 36, 64, 113, 199, 350, 615, 1080, 1896, 3328, 5841, 10251, 17990, 31571, 55404, 97228, 170624, 299425, 525455, 922110, 1618191, 2839728, 4983376, 8745216, 15346785, 26931731, 47261894, 82938843, 145547524, 255418100, 448227520, 786584465
FORMULA
a(n) = 3*a(n-1)-3*a(n-2)+2*a(n-3)-a(n-4).
G.f.: -(x^3-2*x^2+3*x-3) / ((x-1)*(x^3-x^2+2*x-1)). (End)
a(n) = ceiling( a(n-1)^2/a(n-2)-1 ), by definition. - Bruno Berselli, Feb 16 2016
MATHEMATICA
RecurrenceTable[{a[1] == 3, a[2] == 6, a[n] == Ceiling[a[n-1]^2/a[n-2] - 1]}, a, {n, 40}] (* Vincenzo Librandi, Feb 17 2016 *)
PROG
(Magma) Tiv:=[3, 6]; [n le 2 select Tiv[n] else Ceiling(Self(n-1)^2/Self(n-2)-1): n in [1..40]]; // Bruno Berselli, Feb 17 2016
(PARI) T(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=ceil(a[n-1]^2/a[n-2])-1); a
Pisot sequence T(3,10), a(n) = floor(a(n-1)^2/a(n-2)).
+10
2
3, 10, 33, 108, 353, 1153, 3766, 12300, 40172, 131202, 428506, 1399501, 4570771, 14928140, 48755311, 159234864, 520061125, 1698519827, 5547366384, 18117700664, 59172417076, 193257136076, 631177877968, 2061427183105, 6732621943159, 21988745758766
FORMULA
a(n) = 3*a(n-1) + a(n-2) - a(n-4) - a(n-5) - a(n-6) (holds at least up to n = 1000 but is not known to hold in general).
MAPLE
PisotT := proc(a0, a1, n)
option remember;
if n = 0 then
a0 ;
elif n = 1 then
a1;
else
floor( procname(a0, a1, n-1)^2/procname(a0, a1, n-2)) ;
end if;
end proc:
PisotT(3, 10, n) ;
MATHEMATICA
RecurrenceTable[{a[0] == 3, a[1] == 10, a[n] == Floor[a[n - 1]^2/a[n - 2] ]}, a, {n, 0, 30}] (* Bruno Berselli, Feb 05 2016 *)
PROG
(Magma) Txy:=[3, 10]; [n le 2 select Txy[n] else Floor(Self(n-1)^2/Self(n-2)): n in [1..30]]; // Bruno Berselli, Feb 05 2016
(PARI) pisotT(nmax, a1, a2) = {
a=vector(nmax); a[1]=a1; a[2]=a2;
for(n=3, nmax, a[n] = floor(a[n-1]^2/a[n-2]));
a
}
CROSSREFS
See A008776 for definitions of Pisot sequences.
Pisot sequence T(4,9), a(n) = floor(a(n-1)^2/a(n-2)).
+10
2
4, 9, 20, 44, 96, 209, 455, 990, 2154, 4686, 10194, 22176, 48241, 104942, 228287, 496607, 1080300, 2350043, 5112193, 11120867, 24191904, 52626132, 114480851, 249037213, 541745915, 1178493097, 2563648273, 5576861234, 12131688091, 26390804748, 57409535261
COMMENTS
Satisfies the linear recurrence a(n) = 3*a(n-1) - 4*a(n-3) + a(n-6) just for n <= 10 (see A019493).
MATHEMATICA
RecurrenceTable[{a[0] == 4, a[1] == 9, a[n] == Floor[a[n - 1]^2/a[n - 2]]}, a, {n, 0, 40}] (* Bruno Berselli, Feb 04 2016 *)
nxt[{a_, b_}]:={b, Floor[b^2/a]}; NestList[nxt, {4, 9}, 40][[All, 1]] (* Harvey P. Dale, Aug 22 2017 *)
PROG
(Magma) Iv:=[4, 9]; [n le 2 select Iv[n] else Floor(Self(n-1)^2/Self(n-2)): n in [1..40]]; // Bruno Berselli, Feb 04 2016
(PARI) pisotT(nmax, a1, a2) = {
a=vector(nmax); a[1]=a1; a[2]=a2;
for(n=3, nmax, a[n] = floor(a[n-1]^2/a[n-2]));
a
}
CROSSREFS
See A008776 for definitions of Pisot sequences.
Search completed in 0.137 seconds
|