[go: up one dir, main page]

login
Search: a006288 -id:a006288
     Sort: relevance | references | number | modified | created      Format: long | short | data
Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x+1 are in S.
+10
15
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,2
COMMENTS
Positive numbers that can be written in balanced ternary without a 0 trit. - J. Hufford, Jun 30 2015
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
LINKS
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
FORMULA
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
G.f. g(x) satisfies g(x) = 3*(x+1)*g(x^2) + x/(1+x). - Robert Israel, May 05 2014
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
Sum_{i=2^(n-1)..2^n-1} cos(a(i)/3^(n-1)*Pi/2) = 0. - Gevorg Hmayakyan, Jan 15 2017
a(n) = -a(-1-n) for all n in Z. - Michael Somos, Dec 22 2018
For n > 0, A307744(2*a(2n)) = A307744(2*a(2n+1)) = A307744(2*a(n)) + 1. - Peter Munn, Jan 31 2022
a(n) mod 2 = A030300(n). - Alois P. Heinz, Jan 29 2023
EXAMPLE
0th generation: 1;
1st generation: 2 4;
2nd generation: 5 7 11 13.
MAPLE
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
MATHEMATICA
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 *)
PROG
(Haskell)
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
(PARI) {a(n) = if( n<-1 || n>0, 3*a(n\2) - (-1)^(n%2), 0)}; /* Michael Somos, Dec 22 2018 */
(PARI) a(n) = fromdigits(apply(b->if(b, 1, -1), binary(n)), 3); \\ Kevin Ryde, Feb 06 2022
CROSSREFS
Cf. A006288, A351243 (non-quotients).
See also the related sequences listed in A191106.
One half of each position > 0 where A307744 sets or equals a record.
Cf. A030300.
Column k=3 of A360099.
KEYWORD
nonn
AUTHOR
Clark Kimberling, Dec 07 2008
STATUS
approved
Loxton-van der Poorten sequence: base-4 representation contains only -1, 0, +1, converted to ordinary base-4 digits 0,1,2,3.
+10
3
0, 1, 3, 10, 11, 23, 30, 31, 33, 100, 101, 103, 110, 111, 223, 230, 231, 233, 300, 301, 303, 310, 311, 323, 330, 331, 333, 1000, 1001, 1003, 1010, 1011, 1023, 1030, 1031, 1033, 1100, 1101, 1103, 1110, 1111, 2223, 2230, 2231, 2233, 2300, 2301, 2303, 2310, 2311
OFFSET
0,3
COMMENTS
Loxton and van der Poorten's morphism (see A344893), or the way -1 digits cause borrows, shows that this sequence is base 4 digit strings with no digit pair 12, 13, 20, or 21, and least significant digit not 2.
The least significant digit can be any of 0,1,3, then each successive higher digit has three choices: 0,1,3 above a 0 or 1, or 0,2,3 above a 2 or 3. This allows a(n) to be calculated by mapping from the ternary digits of n to these choices, from least to most significant digit.
FORMULA
a(n) = A007090(A006288(n)).
PROG
(PARI) a(n) = my(v=digits(n, 3), prev=0); forstep(i=#v, 1, -1, prev=(v[i]+=(v[i]>(prev<2)))); fromdigits(v);
CROSSREFS
Cf. A006288 (decimal), A344893 (morphism), A007090 (base 4).
KEYWORD
nonn,easy,base
AUTHOR
Kevin Ryde, Jun 01 2021
STATUS
approved
Fixed point of the morphism 1->1321, 2->0021, 3->1300, 0->0000 starting from 1.
+10
3
1, 3, 2, 1, 1, 3, 0, 0, 0, 0, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 0, 0, 0, 0, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 0, 0, 0, 0, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 0
OFFSET
0,2
COMMENTS
Loxton and van der Poorten give this morphism as a way to identify those n which can be represented in base 4 using only digits -1,0,+1 (A006288): n is a term of A006288 iff a(n) = 1 or 3.
LINKS
John Loxton and Alf van der Poorten, Arithmetic Properties of Automata: Regular Sequences, Journal für die Reine und Angewandte Mathematik, volume 392, 1988, pages 57-69. Also second author's copy. Section 1 example beta_n = a(n).
FORMULA
a(n) = 0 if n in base 4 has a digit pair 12, 13, 20, or 21; otherwise a(n) = 1,3,2,1 according as n == 0,1,2,3 (mod 4).
MATHEMATICA
Nest[Flatten[ReplaceAll[#, {0->{0, 0, 0, 0}, 1->{1, 3, 2, 1}, 2->{0, 0, 2, 1}, 3->{1, 3, 0, 0}}]]&, {1}, 4] (* Paolo Xausa, Nov 09 2023 *)
PROG
(PARI) my(table=[9, 8, 9, 0, 0, 8, 6, 2, 4]); a(n) = my(s=2); if(n, forstep(i=bitor(logint(n, 2), 1), 0, -1, (s=table[s-bittest(n, i)])||break)); s>>1;
CROSSREFS
Cf. A006288, A344892, A007090 (base 4).
KEYWORD
nonn,easy
AUTHOR
Kevin Ryde, Jun 01 2021
STATUS
approved
G.f.: 1/(1-x) * sum(k>=0, (-1)^k*x^2^(k+1)/(1+x^2^k)).
+10
2
0, 1, 0, 0, -1, 1, 0, 1, 0, 2, 1, 0, -1, 1, 0, 0, -1, 1, 0, -1, -2, 0, -1, 1, 0, 2, 1, 0, -1, 1, 0, 1, 0, 2, 1, 0, -1, 1, 0, 2, 1, 3, 2, 1, 0, 2, 1, 0, -1, 1, 0, -1, -2, 0, -1, 1, 0, 2, 1, 0, -1, 1, 0, 0, -1, 1, 0, -1, -2, 0, -1, 1, 0, 2, 1, 0, -1, 1, 0, -1, -2, 0, -1, -2, -3, -1
OFFSET
1,10
COMMENTS
For all n, a(3*A006288(n)) = 0 as proved in Russian forum dxdy.ru - see link.
FORMULA
a(1)=0, a(2n) = -a(n)+1, a(2n+1) = -a(n).
a(n) = A030300(n) - A065359(n).
PROG
(PARI) for(n=1, 100, l=ceil(log(n)/log(2)); t=polcoeff(1/(1-x)*sum(k=0, l, (-1)^k*(x^2^(k+1))/(1+x^2^k)) + O(x^(n+1)), n); print1(t", "))
(PARI) a(n) = sum(i=0, logint(n, 2)-1, if(!bittest(n, i), (-1)^i)); \\ Kevin Ryde, May 24 2021
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Ralf Stephan, Jun 18 2003
STATUS
approved

Search completed in 0.006 seconds