A288492 Indices of terms of A288349 that are powers of 2.
1, 2, 3, 18, 95, 440, 1897, 7882, 32139, 129804, 521741, 2092046, 8378383, 33533968, 134176785, 536789010, 2147319827, 8589606932, 34359083029, 137437642774, 549753192471, 2199018012696, 8796082536473, 35184351117338, 140737446412315, 562949869535260
Offset: 1
Examples
a(4) = 18 means the 18th element of the sum of the concatenate subsequences [2^0, 2^1, ..., 2^k] = 1+1+2+1+2+4+1+2+4+8+1+2+4+8+16+1+2+4 = 64, and 64 is power of 2.
Links
- Zhining Yang, Table of n, a(n) for n = 1..200
- Index entries for linear recurrences with constant coefficients, signature (8,-21,22,-8).
Programs
-
Mathematica
Position[Accumulate@ Flatten@ Array[2^Range[0, #] &, 2000, 0], k_ /; IntegerQ@ Log2@ k][[All, 1]] (* per Name, or *) Table[2 - 5*2^(n - 2) + 2^(2 n - 3) + n + Boole[n == 2], {n, 26}] (* or *) LinearRecurrence[{8, -21, 22, -8}, {1, 2, 3, 18, 95, 440}, 26] (* or *) Rest@ CoefficientList[Series[x (1 - 6 x + 8 x^2 + 14 x^3 - 22 x^4 + 8 x^5)/((1 - x)^2*(1 - 2 x) (1 - 4 x)), {x, 0, 26}], x] (* Michael De Vlieger, Jun 19 2017 *)
-
PARI
for(k=0,100,p=(2^k-3)*(2^k-2)/2+k; print1(p, ", "))
-
PARI
ispower2(n) = (n==1) || (n==2) || (ispower(n,,&two) && (two==2)); lista(nn) = select(x->ispower2(x), vector(nn, n, t=floor(sqrt(2*n)+1/2); 2^t+2^(n-t*(t-1)/2)-t-2), 1); \\ Michel Marcus, Jun 20 2017
-
PARI
Vec(x*(1 - 6*x + 8*x^2 + 14*x^3 - 22*x^4 + 8*x^5) / ((1 - x)^2*(1 - 2*x)*(1 - 4*x)) + O(x^30)) \\ Colin Barker, Jun 23 2017
Formula
From Colin Barker, Jun 23 2017: (Start)
G.f.: x*(1 - 6*x + 8*x^2 + 14*x^3 - 22*x^4 + 8*x^5) / ((1 - x)^2*(1 - 2*x)*(1 - 4*x)).
a(n) = 2 - 5*2^(n-2) + 2^(2*n-3) + n for n>2.
a(n) = 8*a(n-1) - 21*a(n-2) + 22*a(n-3) - 8*a(n-4) for n>6.
(End)
Comments