A005823
Numbers whose ternary expansion contains no 1's.
Original entry on oeis.org
0, 2, 6, 8, 18, 20, 24, 26, 54, 56, 60, 62, 72, 74, 78, 80, 162, 164, 168, 170, 180, 182, 186, 188, 216, 218, 222, 224, 234, 236, 240, 242, 486, 488, 492, 494, 504, 506, 510, 512, 540, 542, 546, 548, 558, 560, 564, 566, 648, 650, 654, 656, 666, 668, 672, 674
Offset: 1
- K. J. Falconer, The Geometry of Fractal Sets, Cambridge, 1985; p. 14.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Winston de Greef, Table of n, a(n) for n = 1..16384 (first 1024 terms from T. D. Noe)
- J.-P. Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., Vol. 98, No. 2 (1992), pp. 163-197.
- J.-P. Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., Vol. 98, No. 2 (1992), pp. 163-197.
- Robert Baillie and Thomas Schmelzer, Summing Kempner's Curious (Slowly-Convergent) Series, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
- Sajed Haque, Chapter 3.4 of Discriminators of Integer Sequences, 2017, See p. 45.
- Sajed Haque and Jeffrey Shallit, Discriminators and k-Regular Sequences, arXiv:1605.00092 [cs.DM], 2016.
- Clark Kimberling, Affinely recursive sets and orderings of languages, Discrete Math., Vol. 274, No. 1-3 (2004), pp. 147-160.
- Kurt Mahler, The representation of squares to the base 3, Acta Arith., Vol. 53, Issue 1 (1989), pp. 99-106.
- M. Mendes France and A. J. van der Poorten, From geometry to Euler identities, Theoret. Comput. Sci., Vol. 65, No. 2 (1989), pp. 213-220.
- Eric Weisstein's World of Mathematics, Cantor Set.
- Index entries for 3-automatic sequences.
-
a:= proc(n) option remember;
`if`(n=1, 0, `if`(irem (n, 2, 'q')=0, 3*a(q)+2, 3*a(q+1)))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Apr 19 2012
-
Select[ Range[ 0, 729 ], (Count[ IntegerDigits[ #, 3 ], 1 ]==0)& ]
Select[Range[0,700],DigitCount[#,3,1]==0&] (* Harvey P. Dale, Mar 12 2016 *)
-
is(n)=while(n,if(n%3==1,return(0),n\=3));1 \\ Charles R Greathouse IV, Apr 20 2012
-
a(n)=n=binary(n-1);sum(i=1,#n,2*n[i]*3^(#n-i)) \\ Charles R Greathouse IV, Apr 20 2012
-
a(n)=2*fromdigits(binary(n-1),3) \\ Charles R Greathouse IV, Aug 24 2016
-
def A005823(n):
return 2*int(format(n-1,'b'),3) # Chai Wah Wu, Jan 04 2015
Offset corrected by
N. J. A. Sloane, Mar 02 2008. This may require some of the formulas to be adjusted.
A147991
Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x+1 are in S.
Original entry on oeis.org
1, 2, 4, 5, 7, 11, 13, 14, 16, 20, 22, 32, 34, 38, 40, 41, 43, 47, 49, 59, 61, 65, 67, 95, 97, 101, 103, 113, 115, 119, 121, 122, 124, 128, 130, 140, 142, 146, 148, 176, 178, 182, 184, 194, 196, 200, 202, 284, 286, 290, 292, 302, 304, 308, 310, 338, 340, 344, 346
Offset: 1
0th generation: 1;
1st generation: 2 4;
2nd generation: 5 7 11 13.
- Robert Israel, Table of n, a(n) for n = 1..10000
- Gevorg Hmayakyan, Trig identity for a(n)
- J. H. Loxton and A. J. van der Poorten, An Awful Problem About Integers in Base Four, Acta Arithmetica, volume 49, 1987, pages 193-203. In section 7, John Selfridge and Carole Lacampagne ask whether every k != 0 (mod 3) is the quotient of two terms of this sequence (cf. A351243 and A006288).
- Eric Weisstein's World of Mathematics, Cantor Set
- Eric Weisstein's World of Mathematics, Closure
See also the related sequences listed in
A191106.
One half of each position > 0 where
A307744 sets or equals a record.
-
import Data.Set (singleton, insert, deleteFindMin)
a147991 n = a147991_list !! (n-1)
a147991_list = f $ singleton 1 where
f s = m : (f $ insert (3*m - 1) $ insert (3*m + 1) s')
where (m, s') = deleteFindMin s
-- Reinhard Zumkeller, Feb 21 2012, Jan 23 2011
-
A147991:= proc(n) option remember; if n::even then 3*procname(n/2)-1 else 3*procname((n-1)/2)+1 fi end proc:
A147991(1):= 1:
[seq](A147991(i),i=1..1000); # Robert Israel, May 05 2014
-
nn=346; s={1}; While[s1=Select[Union[s, 3*s-1, 3*s+1], # <= nn &]; s != s1, s=s1]; s
a[ n_] := If[ n < -1 || n > 0, 3 a[Quotient[n, 2]] - (-1)^Mod[n, 2], 0]; (* Michael Somos, Dec 22 2018 *)
-
{a(n) = if( n<-1 || n>0, 3*a(n\2) - (-1)^(n%2), 0)}; /* Michael Somos, Dec 22 2018 */
-
a(n) = fromdigits(apply(b->if(b,1,-1),binary(n)), 3); \\ Kevin Ryde, Feb 06 2022
A191108
Increasing sequence generated by these rules: a(1)=1, and if x is in a then 3x-2 and 3x+2 are in a.
Original entry on oeis.org
1, 5, 13, 17, 37, 41, 49, 53, 109, 113, 121, 125, 145, 149, 157, 161, 325, 329, 337, 341, 361, 365, 373, 377, 433, 437, 445, 449, 469, 473, 481, 485, 973, 977, 985, 989, 1009, 1013, 1021, 1025, 1081, 1085, 1093, 1097, 1117, 1121, 1129, 1133, 1297, 1301, 1309, 1313, 1333, 1337, 1345, 1349, 1405, 1409, 1417, 1421, 1441, 1445
Offset: 1
-
h = 3; i = -2; j = 3; k = 2; f = 1; g = 7;
a = Union[Flatten[NestList[{h # + i, j # + k} &, f, g]]] (* A191108 *)
b = (a + 2)/3; c = (a - 2)/3; r = Range[1, 900];
d = Intersection[b, r] (* A191108 closure property *)
e = Intersection[c, r] (* A191108 closure property *)
-
a(n) = fromdigits(binary(n-1),3)<<2 + 1; \\ Kevin Ryde, Aug 05 2022
A153775
Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x are in S.
Original entry on oeis.org
1, 2, 3, 5, 6, 8, 9, 14, 15, 17, 18, 23, 24, 26, 27, 41, 42, 44, 45, 50, 51, 53, 54, 68, 69, 71, 72, 77, 78, 80, 81, 122, 123, 125, 126, 131, 132, 134, 135, 149, 150, 152, 153, 158, 159, 161, 162, 203, 204, 206, 207, 212, 213, 215, 216, 230, 231, 233, 234, 239, 240, 242
Offset: 1
See also the related sequences listed in
A191106.
-
nxt[n_] := Flatten[3 # + {-1, 0} & /@ n]; Union[Flatten[NestList[nxt,{1},5]]] (* G. C. Greubel, Aug 28 2016 *)
A307744
A fractal function, related to ruler functions and the Cantor set. a(1) = 0; for m >= 0, a(3m) = 1; for m >= 1, a(3m-1) = a(m-1) + sign(a(m-1)), a(3m+1) = a(m+1) + sign(a(m+1)).
Original entry on oeis.org
1, 0, 2, 1, 3, 0, 1, 2, 3, 1, 4, 2, 1, 0, 4, 1, 2, 0, 1, 3, 2, 1, 4, 3, 1, 2, 4, 1, 5, 2, 1, 3, 5, 1, 2, 3, 1, 0, 2, 1, 5, 0, 1, 2, 5, 1, 3, 2, 1, 0, 3, 1, 2, 0, 1, 4, 2, 1, 3, 4, 1, 2, 3, 1, 5, 2, 1, 4, 5, 1, 2, 4, 1, 3, 2, 1, 5, 3, 1, 2, 5, 1, 6, 2, 1
Offset: 0
As 4 is congruent to 1 modulo 3, a(4) = a(3*1 + 1) = a(1+1) + sign (a(1+1)) = a(2) + sign(a(2)).
As 2 is congruent to -1 modulo 3, a(2) = a(3*1 - 1) = a(1-1) + sign (a(1-1)) = a(0) + sign(a(0)).
As 0 is congruent to 0 modulo 3, a(0) = 1. So a(2) = a(0) + sign(a(0)) = 1 + 1 = 2. So a(4) = a(2) + sign(a(2)) = 2 + 1 = 3.
For any m, the sequence from 9m - 9 to 9m + 9 can be represented by the table below. x, y and z represent distinct integers unless m = 0, in which case x = z = 0. Distinct values are shown in their own column to highlight patterns.
n a(n)
9m-9 1
9m-8 y - starts pattern (9m-8, 9m-4, 9m+4, 9m+8)
9m-7 2
9m-6 1
9m-5 x
9m-4 y
9m-3 1
9m-2 2
9m-1 x - ends pattern (9m-17, 9m-13, 9m-5, 9m-1)
9m 1
9m+1 z - starts pattern (9m+1, 9m+5, 9m+13, 9m+17)
9m+2 2
9m+3 1
9m+4 y
9m+5 z
9m+6 1
9m+7 2
9m+8 y - ends pattern (9m-8, 9m-4, 9m+4, 9m+8)
9m+9 1
For all m, one of x, y, z represents 3 in this table. Note the identical patterns indicated for "x", "y", "z" quadruples, and how the "x" quadruple ends 2 before the "z" quadruple starts, with the "y" quadruple overlapping both. For k >= 1, there are equivalent 2^k-tuples that overlap similarly, notably (3m-2, 3m+2) for all m.
Larger 2^k-tuples look more fractal, more obviously related to the Cantor set. See the pin plot of a(0..162) aligned above an inverted plot of ruler function A051064 in the links. 0's are emphasized with a fainter line running off the top of the plot, partly because 0 is used here as a conventional value and occurs with some properties (such as zero asymptotic density) that could be considered appropriate to the largest rather than smallest value in the sequence.
The table below illustrates the symmetries of scale of this sequence and ruler function A051064. Note the column for this sequence is indexed by k+1, 3k+1, 9k+1, whereas that for A051064 is indexed by k, 3k, 9k.
a(n+1) A051064(n)
n=k, k=16..27 0,1,3,2,1,4,3,1,2,4,1,5 1,1,3,1,1,2,1,1,2,1,1,4
n=3k,k=16..27 0,2,4,3,2,5,4,2,3,5,2,6 2,2,4,2,2,3,2,2,3,2,2,5
n=9k,k=16..27 0,3,5,4,3,6,5,3,4,6,3,7 3,3,5,3,3,4,3,3,4,3,3,6
-
a(n) = if (n==1, 0, my(m=n%3); if (m==0, 1, my(kk = (if (m==1, a(n\3+1), a((n-2)\3)))); kk + sign(kk)));
for (n=0, 100, print1(a(n), ", ")) \\ Michel Marcus, Jul 06 2019
A173934
Irregular triangle in which row n consists of numbers m < k/2 such that m/k is in the Cantor set, where k= A173931(n) and gcd(m,k) = 1.
Original entry on oeis.org
1, 1, 3, 1, 3, 4, 1, 3, 9, 1, 3, 9, 13, 1, 3, 7, 9, 19, 21, 25, 27, 1, 3, 9, 10, 27, 30, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, 5, 11, 15, 33, 45, 47, 5, 15, 41, 45, 47, 59, 7, 16, 21, 22, 48, 61, 63, 66, 1, 3, 7, 9, 19, 21, 25, 27, 55, 57, 63, 73, 75, 79, 81, 1, 3, 9, 27
Offset: 1
Showing 1-6 of 6 results.
Comments