login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A048328 Numbers that are repdigits in base 3. 10

%I #47 Feb 18 2022 08:16:41

%S 0,1,2,4,8,13,26,40,80,121,242,364,728,1093,2186,3280,6560,9841,19682,

%T 29524,59048,88573,177146,265720,531440,797161,1594322,2391484,

%U 4782968,7174453,14348906,21523360,43046720,64570081,129140162,193710244,387420488,581130733

%N Numbers that are repdigits in base 3.

%C Case for base 2 see A000225: 2^n - 1.

%C If the sequence b(n) represents the number of paths of length n, n >= 1, starting at node 1 and ending at nodes 1, 2, 3 and 4 on the path graph P_5 then a(n-1) = b(n) - 1. - _Johannes W. Meijer_, May 29 2010

%H Alois P. Heinz, <a href="/A048328/b048328.txt">Table of n, a(n) for n = 0..1000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Repdigit.html">Repdigit</a>.

%H <a href="/index/Ar#3-automatic">Index entries for 3-automatic sequences</a>.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,4,0,-3).

%F G.f.: (2*x^2+x)/(1-4*x^2+3*x^4). - _Alois P. Heinz_, Sep 23 2012

%F Sum_{n>=1} 1/a(n) = 3 * A214369 = 2.04646050781571420028... - _Amiram Eldar_, Jan 21 2022

%F a(n) = (3^(n/2)*(sqrt(3) + 2 - (-1)^n*(sqrt(3) - 2)) - 3 - (-1)^n)/4. - _Stefano Spezia_, Feb 18 2022

%p nmax := 35; a(0) := 0: for n from 1 to nmax do a(2*n) := a(2*n-2) + 2*3^(n-1); od: a(1) := 1: for n from 1 to nmax do a(2*n+1) := 1*a(2*n-1) + 3^n; od: seq(a(n), n=0..nmax);

%p # End program 1

%p with(GraphTheory): G := PathGraph(5): A:= AdjacencyMatrix(G): nmax := nmax; for n from 1 to nmax+1 do B(n) := A^n; b(n) := add(B(n)[1, k], k=1..4); a1(n-1) := b(n)-1; od: seq(a1(n), n=0..nmax);

%p # End program 2

%p # From _Johannes W. Meijer_, May 29 2010, revised Sep 23 2012

%p # third Maple program:

%p a:= n->(<<0|1>, <-3|4>>^iquo(n, 2, 'r').`if`(r=0, <<0, 2>>, <<1, 4>>))[1, 1]:

%p seq (a(n), n=0..60); # _Alois P. Heinz_, Sep 23 2012

%t Rest[FromDigits[#, 3]&/@Flatten[Table[{PadRight[{1}, n, 1], PadRight[{2}, n, 2]}, {n, 0, 20}], 1]] (* _Harvey P. Dale_, Feb 03 2011 *)

%o (PARI) a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -3,0,4,0]^n*[0;1;2;4])[1,1] \\ _Charles R Greathouse IV_, Oct 07 2015

%Y Bisections: A024023 and A003462.

%Y Cf. A000225, A010785, A028987, A028988, A033016, A038754, A068911, A124302, A214369.

%K nonn,base,easy

%O 0,3

%A _Patrick De Geest_, Feb 15 1999

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 11:31 EDT 2024. Contains 371792 sequences. (Running on oeis4.)