Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
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!)
A300956 a(0) = 0, a(1) = 2, a(2) = 1, and for any n > 2 with ternary representation n = Sum_{i=0..k} t_i * 3^i, a(n) = Sum_{i=0..k} a(t_i) * 3^a(i). 3

%I #10 Mar 20 2018 04:09:48

%S 0,2,1,18,20,19,9,11,10,6,8,7,24,26,25,15,17,16,3,5,4,21,23,22,12,14,

%T 13,774840978,774840980,774840979,774840996,774840998,774840997,

%U 774840987,774840989,774840988,774840984,774840986,774840985,774841002,774841004

%N a(0) = 0, a(1) = 2, a(2) = 1, and for any n > 2 with ternary representation n = Sum_{i=0..k} t_i * 3^i, a(n) = Sum_{i=0..k} a(t_i) * 3^a(i).

%C This sequence is a self-inverse permutation of the natural numbers.

%C This sequence has connections with A300955.

%C This sequence has infinitely many fixed points (A300958); for any k >= 0, at least one of k or 3^k + 2 * 3^a(k) is a fixed point.

%H Rémy Sigrist, <a href="/A300956/b300956.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

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

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

%o (PARI) a(n) = my (t=Vecrev(digits(n,3))); sum(i=0, #t-1, if (t[i+1]==1, 2, t[i+1]==2, 1, 0) * 3 ^ a(i))

%Y Cf. A160384, A300955, A300958 (fixed points).

%K nonn,base

%O 0,2

%A _Rémy Sigrist_, Mar 17 2018

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