A055246 At step number k >= 1 the 2^(k-1) open intervals that are erased from [0,1] in the Cantor middle-third set construction are I(k,n) = (a(n)/3^k, (1+a(n))/3^k), n=1..2^(k-1).
1, 7, 19, 25, 55, 61, 73, 79, 163, 169, 181, 187, 217, 223, 235, 241, 487, 493, 505, 511, 541, 547, 559, 565, 649, 655, 667, 673, 703, 709, 721, 727, 1459, 1465, 1477, 1483, 1513, 1519, 1531, 1537, 1621, 1627, 1639, 1645, 1675, 1681, 1693, 1699
Offset: 1
Examples
k=1: (1/3, 2/3); k=2: (1/9, 2/9), (7/9, 8/9); k=3: (1/27, 2/27), (7/27, 8/27), (19/27, 20/27), (25/27, 26/27); ...
Links
- Ralf Stephan, Some divide-and-conquer sequences ...
- Ralf Stephan, Table of generating functions
- Index entries for 3-automatic sequences.
Programs
-
Mathematica
(* (Conjectured) Choose rows large enough to guarantee that all terms < max are generated. *) rows = 1000; max = 10^4; a[1] = {1}; i = 1; Do[a[n_] = {}; Do[If[1 < 3*a[n - 1][[k]] - 2 < max, AppendTo[a[n], 3*a[n - 1][[k]] - 2], Break]; If[3*a[n - 1][[k]] + 4 < max, AppendTo[a[n], 3*a[n - 1][[k]] + 4], Break], {k, Length[a[n - 1]]}]; If[a[n] == {}, Break, i++], {n, 2, 1000}]; a055246 = Take[Flatten[Table[a[n], {n, i}]], 48] (* L. Edson Jeffery, Nov 17 2015 *) Join[{1}, 1 + 6 Accumulate[Table[(3^IntegerExponent[n, 2] + 1)/2, {n, 60}]]] (* Vincenzo Librandi, Nov 26 2015 *)
-
PARI
g(n)=sum(i=0,n,i*binomial(n+i,i)^3*binomial(n,i)^2); for (i=1,2000,if(Mod(g(i),3)<>0,print1(i,",")))
-
PARI
a(n) = fromdigits(binary(n-1),3)*6 + 1; \\ Kevin Ryde, Apr 23 2021
-
Python
def A055246(n): return int(bin(n-1)[2:],3)*6|1 # Chai Wah Wu, Jun 26 2025
Formula
a(n) = 1+6*A005836(n), n >= 1.
a(n) = 1+3*A005823(n), n >= 1.
a(n+1) = A074938(n) + A074939(n); A074938: odd numbers in A005836, A074939: even numbers in A005836. - Philippe Deléham, Jul 10 2005
Conjecture: a(n) = 2*A191107(n) - 1 = 6*A003278(n) - 5 = (a((2*n-1)*2^(k-1))+2)/3^k, k>0. - L. Edson Jeffery, Nov 25 2015
Extensions
Edited by N. J. A. Sloane, Nov 20 2015: used first comment to give more precise definition, and edited a comment at the suggestion of L. Edson Jeffery.
Comments