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!)
A213912 a(1) = 1; for n>1, a(n) = floor(sqrt(a(n-1))) if that number is not already in the sequence, otherwise a(n) = 3*a(n-1). 3

%I #12 Jun 27 2020 03:05:24

%S 1,3,9,27,5,2,6,18,4,12,36,108,10,30,90,270,16,48,144,432,20,60,7,21,

%T 63,189,13,39,117,351,1053,32,96,288,864,29,87,261,783,2349,7047,83,

%U 249,15,45,135,11,33,99,297,17,51,153,459,1377,37,111,333,999,31

%N a(1) = 1; for n>1, a(n) = floor(sqrt(a(n-1))) if that number is not already in the sequence, otherwise a(n) = 3*a(n-1).

%C Permutation of natural numbers with inverse A213913.

%H Reinhard Zumkeller, <a href="/A213912/b213912.txt">Table of n, a(n) for n = 1..10000</a>

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

%o (Haskell)

%o a213912 n = a213912_list !! (n-1)

%o a213912_list = 1 : f [1] where

%o f xs@(x:_) = y : f (y : xs) where

%o y = if z `notElem` xs then z else 3 * x where z = a000196 x

%o (PARI) lista(nn) = {my(k, v=vector(nn)); v[1]=1; for(n=2, nn, if(vecsearch(vecsort(v), k=sqrtint(v[n-1])), v[n]=3*v[n-1], v[n]=k)); v; } \\ _Jinyuan Wang_, Jun 26 2020

%Y Cf. A114183.

%K nonn,look

%O 1,2

%A _Reinhard Zumkeller_, Mar 05 2013

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 24 09:38 EDT 2024. Contains 371935 sequences. (Running on oeis4.)