A125835 Numbers whose base-8 or octal representation is 22222222.......2.
0, 2, 18, 146, 1170, 9362, 74898, 599186, 4793490, 38347922, 306783378, 2454267026, 19634136210, 157073089682, 1256584717458, 10052677739666, 80421421917330, 643371375338642, 5146971002709138, 41175768021673106, 329406144173384850, 2635249153387078802, 21081993227096630418
Offset: 1
Examples
Octal.............decimal 0.......................0 2.......................2 22.....................18 222...................146 2222.................1170 22222................9362 222222..............74898 2222222............599186 22222222..........4793490 222222222........38347922 2222222222......306783378 etc. ...............etc.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (9,-8).
Crossrefs
Cf. A023001.
Programs
-
GAP
List([1..30], n-> 2*(8^(n-1) -1)/7); # G. C. Greubel, Aug 03 2019
-
Magma
[2*(8^(n-1) -1)/7: n in [1..30]]; // G. C. Greubel, Aug 03 2019
-
Maple
seq(2*(8^n-1)/7, n=0..30);
-
Mathematica
nxt2[n_]:=Module[{idn=IntegerDigits[n,8]}, FromDigits[PadLeft[idn,Length[idn]+1,2],8]]; Join[{0},NestList[nxt2,2,30]] (* Harvey P. Dale, Mar 09 2011 *) Module[{nn=30,c},c=PadRight[{},nn,2];Table[FromDigits[Take[c,n],8],{n,0,nn}]] (* Harvey P. Dale, Sep 05 2015 *) 2*(8^(Range[30]-1) -1)/7 (* G. C. Greubel, Aug 03 2019 *)
-
PARI
a(n)=2*(1<<(3*n-3)\7) \\ Charles R Greathouse IV, Mar 09 2011
-
PARI
vector(30, n, 2*(8^(n-1) -1)/7) \\ G. C. Greubel, Aug 03 2019
-
Sage
[2*(8^(n-1) -1)/7 for n in (1..30)] # G. C. Greubel, Aug 03 2019
Formula
a(n) = 2*(8^(n-1) - 1)/7.
a(n) = 8*a(n-1) + 2, with a(1)=0. - Vincenzo Librandi, Sep 30 2010
From G. C. Greubel, Aug 03 2019: (Start)
a(n) = 2*A023001(n).
G.f.: 2*x^2/((1-x)*(1-8*x)).
E.g.f.: 2*(exp(8*x) - exp(x))/7. (End)
Extensions
Offset corrected by N. J. A. Sloane, Oct 02 2010
Terms a(21) onward added by G. C. Greubel, Aug 03 2019