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!)
A147991 Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x+1 are in S. 15

%I #73 Jan 30 2023 18:46:54

%S 1,2,4,5,7,11,13,14,16,20,22,32,34,38,40,41,43,47,49,59,61,65,67,95,

%T 97,101,103,113,115,119,121,122,124,128,130,140,142,146,148,176,178,

%U 182,184,194,196,200,202,284,286,290,292,302,304,308,310,338,340,344,346

%N Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x+1 are in S.

%C Positive numbers that can be written in balanced ternary without a 0 trit. - _J. Hufford_, Jun 30 2015

%C Let S be the set of terms. Define c: Z -> P(R) so that c(m) is the translated Cantor ternary set spanning [m-0.5, m+0.5], and let C be the union of c(m) for all m in S U {0} U -S. C is the closure of the translated Cantor ternary set spanning [-0.5, 0.5] under multiplication by 3. - _Peter Munn_, Jan 31 2022

%H Robert Israel, <a href="/A147991/b147991.txt">Table of n, a(n) for n = 1..10000</a>

%H Gevorg Hmayakyan, <a href="http://math.stackexchange.com/questions/1918281/generalizing-a-trig-identity">Trig identity for a(n)</a>

%H J. H. Loxton and A. J. van der Poorten, <a href="https://doi.org/10.4064/aa-49-2-193-203">An Awful Problem About Integers in Base Four</a>, 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).

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

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

%F a(n) = 3*a(n/2) - 1 if n>=2 is even, 3*a((n-1)/2) + 1 if n is odd, a(0)=0. - _Robert Israel_, May 05 2014

%F G.f. g(x) satisfies g(x) = 3*(x+1)*g(x^2) + x/(1+x). - _Robert Israel_, May 05 2014

%F Product_{j=0..n-1} cos(3^j) = 2^(-n+1)*Sum_{i=2^(n-1)..2^n-1} cos(a(i)). - _Gevorg Hmayakyan_, Jan 15 2017

%F Sum_{i=2^(n-1)..2^n-1} cos(a(i)/3^(n-1)*Pi/2) = 0. - _Gevorg Hmayakyan_, Jan 15 2017

%F a(n) = -a(-1-n) for all n in Z. - _Michael Somos_, Dec 22 2018

%F For n > 0, A307744(2*a(2n)) = A307744(2*a(2n+1)) = A307744(2*a(n)) + 1. - _Peter Munn_, Jan 31 2022

%F a(n) mod 2 = A030300(n). - _Alois P. Heinz_, Jan 29 2023

%e 0th generation: 1;

%e 1st generation: 2 4;

%e 2nd generation: 5 7 11 13.

%p A147991:= proc(n) option remember; if n::even then 3*procname(n/2)-1 else 3*procname((n-1)/2)+1 fi end proc:

%p A147991(1):= 1:

%p [seq](A147991(i),i=1..1000); # _Robert Israel_, May 05 2014

%t nn=346; s={1}; While[s1=Select[Union[s, 3*s-1, 3*s+1], # <= nn &]; s != s1, s=s1]; s

%t a[ n_] := If[ n < -1 || n > 0, 3 a[Quotient[n, 2]] - (-1)^Mod[n, 2], 0]; (* _Michael Somos_, Dec 22 2018 *)

%o (Haskell)

%o import Data.Set (singleton, insert, deleteFindMin)

%o a147991 n = a147991_list !! (n-1)

%o a147991_list = f $ singleton 1 where

%o f s = m : (f $ insert (3*m - 1) $ insert (3*m + 1) s')

%o where (m, s') = deleteFindMin s

%o -- _Reinhard Zumkeller_, Feb 21 2012, Jan 23 2011

%o (PARI) {a(n) = if( n<-1 || n>0, 3*a(n\2) - (-1)^(n%2), 0)}; /* _Michael Somos_, Dec 22 2018 */

%o (PARI) a(n) = fromdigits(apply(b->if(b,1,-1),binary(n)), 3); \\ _Kevin Ryde_, Feb 06 2022

%Y Cf. A168542, A191108, A306556.

%Y Cf. A006288, A351243 (non-quotients).

%Y See also the related sequences listed in A191106.

%Y One half of each position > 0 where A307744 sets or equals a record.

%Y Cf. A030300.

%Y Column k=3 of A360099.

%K nonn

%O 1,2

%A _Clark Kimberling_, Dec 07 2008

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 12:14 EDT 2024. Contains 371792 sequences. (Running on oeis4.)