OFFSET
1,1
COMMENTS
Divide the sequence of natural numbers: s0=1,2,3,4,5,6,7,8,9,10,11,12,13,14,... into sections s(n) of length 2*s1-1, where s1=initial digits of s(n): s={1,2},{3,4,5,6},{7,8,9,10,11,12,13,14},... then a(n)=sum of terms of s(n): 3,18,84,...
Sum of the numbers between 2^n and 2^(n+1), both excluded. - Gionata Neri, Jun 16 2015
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Paul Barry, On the Gap-sum and Gap-product Sequences of Integer Sequences, arXiv:2104.05593 [math.CO], 2021.
Index entries for linear recurrences with constant coefficients, signature (6,-8).
FORMULA
a(n) = 3*A006516(n).
From Bruno Berselli, Sep 19 2011: (Start)
G.f.: 3*x/((1-2*x)*(1-4*x)).
a(n+2) = A061561(4n-2). (End)
E.g.f.: (3/2)*(exp(4*x) - exp(2*x)). - Stefano Spezia, Nov 10 2019
MATHEMATICA
Table[3*2^(n - 1)*(2^n - 1), {n, 30}]
LinearRecurrence[{6, -8}, {3, 18}, 30] (* Harvey P. Dale, Feb 11 2018 *)
PROG
(Magma) [3*2^(n-1)*(2^n-1): n in [1..24]]; // Bruno Berselli, Sep 19 2011
(PARI) a(n)=3*2^(n-1)*(2^n-1) \\ Charles R Greathouse IV, Jun 08 2015
(Python) b = list(range(0, 2**20-1)); a = [sum(b[2**i-1:2**(i+1)-1]) for i in range(1, 20)] ## Johan Claes, Nov 10 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Mar 30 2005
STATUS
approved