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!)
A308364 a(0) = 0, a(3n) = a(n), a(3n+1) = a(n)*3 + 1, a(3n-1) = a(n)*3 - 1. 2

%I #25 Sep 08 2022 08:46:21

%S 0,1,2,1,4,5,2,7,2,1,4,11,4,13,14,5,16,5,2,7,20,7,22,5,2,7,2,1,4,11,4,

%T 13,32,11,34,11,4,13,38,13,40,41,14,43,14,5,16,47,16,49,14,5,16,5,2,7,

%U 20,7,22,59,20,61,20,7,22,65,22,67,14,5,16,5,2,7,20,7,22,5,2,7,2,1

%N a(0) = 0, a(3n) = a(n), a(3n+1) = a(n)*3 + 1, a(3n-1) = a(n)*3 - 1.

%C Defines a function on all the integers, but only nonnegative terms are in the data. A147991 gives the nonnegative fixed points of the function and the nonnegative part of its image.

%C Consider a Sierpinski arrowhead curve to be formed of vectors placed head to tail and numbered consecutively from 0 at its axis of symmetry. Vector a(n) equals vector n.

%C Removing all 0's from the balanced ternary expansion of n yields a(n). - _Charlie Neder_, Jun 03 2019

%H Antti Karttunen, <a href="/A308364/b308364.txt">Table of n, a(n) for n = 0..19683</a>

%H Peter Munn, <a href="/A309054/a309054_1.png">Sierpiński arrowhead with numbered vectors</a>.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Sierpi%C5%84ski_arrowhead_curve">Sierpiński arrowhead curve</a>

%F a(-n) = - a(n).

%F A307672(a(n)) = A307672(n).

%F a(A147991(n)) = A147991(n).

%F a(9n-1) = a(9n-3). a(9n+1) = a(9n+3).

%e As 6 is congruent to 0 modulo 3, a(6) = a(3*2) = a(2).

%e As 2 is congruent to -1 modulo 3, a(2) = a(3*1 - 1) = a(1)*3 - 1.

%e As 1 is congruent to 1 modulo 3, a(1) = a(0*1 + 1) = a(0)*3 + 1 = 0*3 + 1 = 1.

%e So a(2) = a(1)*3 - 1 = 1*3 - 1 = 2. So a(6) = a(2) = 2.

%o (PARI) a(n) = if (n == 0, 0, r = n%3; if (r==0, a(n/3), if (r==1, 3*a((n-1)/3)+1, 3*a((n+1)/3)-1))); \\ _Michel Marcus_, May 29 2019

%o (Magma) a:=[1]; for n in [2..80] do if n mod 3 eq 2 then a[n]:= 3*a[(n+1) div 3]-1; end if; if n mod 3 eq 1 then a[n]:=3*a[(n-1) div 3]+1; end if; if n mod 3 eq 0 then a[n]:=a[n div 3]; end if; end for; [0] cat a; // _Marius A. Burtea_, Nov 14 2019

%Y Cf. A147991, A307672.

%K nonn,hear

%O 0,3

%A _Peter Munn_, May 22 2019

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 September 13 22:05 EDT 2024. Contains 375910 sequences. (Running on oeis4.)