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!)
A168221 a(n) = A006368(A006368(n)). 5

%I #50 Feb 07 2024 16:03:08

%S 0,1,2,3,9,6,7,4,18,5,11,12,27,15,16,8,36,10,20,21,45,24,25,13,54,14,

%T 29,30,63,33,34,17,72,19,38,39,81,42,43,22,90,23,47,48,99,51,52,26,

%U 108,28,56,57,117,60,61,31,126,32,65,66,135,69,70,35,144,37,74,75,153,78,79,40

%N a(n) = A006368(A006368(n)).

%C Inverse integer permutation to A168222;

%C a(A006369(n)) = A006368(n).

%H A.H.M. Smeets, <a href="/A168221/b168221.txt">Table of n, a(n) for n = 0..20000</a>

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

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

%H <a href="/index/Rec#order_24">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,-1).

%F From _Luce ETIENNE_, Aug 14 2019: (Start)

%F a(n) = 2*a(n-16) - a(n-32).

%F a(n) = (-18*(40*m^7 - 973*m^6 + 9352*m^5 - 45115*m^4 + 114520*m^3 - 145432*m^2 + 75168*m - 10080)*floor(n/8) - m*(332*m^6 - 7973*m^5 + 75236*m^4 - 352835*m^3 + 855008*m^2 - 999992*m + 422664) + m*(4*m^6 - 105*m^5 + 1120*m^4 - 6195*m^3 + 18676*m^2 - 28980*m + 18000)*(-1)^(n/8))/10080 where m = n mod 8.

%F (End)

%F From _A.H.M. Smeets_, Aug 14 2019: (Start)

%F a(4*n) = 9*n.

%F a(8*n+1) = a(8*n-1)+1, n > 0.

%F a(8*n+3) = a(8*n+2)+1.

%F a(8*n+5) = a(8*n+3)+3 = a(8*n+2)+4.

%F a(8*n+6) = a(8*n+5)+1 = a(8*n+3)+4 = a(8*n+2)+5.

%F a(16*n+1) = 9*n+1.

%F a(16*n+2) = 18*n+2.

%F a(16*n+3) = a(16*n+2)+1 = 18*n+3.

%F a(16*n+5) = a(16*n+3)+3 = 18*n+6.

%F a(16*n+6) = a(16*n+5)+1 = 18*n+7.

%F a(16*n+7) = (a(16*n+6)+1)/2 = 9*n+4.

%F a(16*n+9) = 9*n+5.

%F a(16*n+10) = 2*a(16*n+9)+1 = 18*n+11.

%F a(16*n+11) = a(16*n+10)+1 = 18*n+12.

%F a(16*n+13) = a(16*n+11)+3 = 18*n+15.

%F a(16*n+14) = a(16*n+13) = 18*n+16.

%F a(16*n+15) = a(16*n+14)/2 = 9*n+8.

%F From this, (9*n-7)/16 <= a(n) <= 9*n/4.

%F (End)

%F From _Colin Barker_, Aug 23 2019: (Start)

%F G.f.: x*(1 - x + x^2)*(1 + 3*x + 5*x^2 + 11*x^3 + 12*x^4 + 8*x^5 + 10*x^7 + 14*x^8 + 13*x^9 + 8*x^10 + 13*x^11 + 14*x^12 + 10*x^13 + 8*x^15 + 12*x^16 + 11*x^17 + 5*x^18 + 3*x^19 + x^20) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2*(1 + x^4)^2*(1 + x^8)).

%F a(n) = a(n-8) + a(n-16) - a(n-24) for n>23.

%F (End)

%t Table[Nest[If[OddQ[#],Floor[(3#+2)/4],3#/2]&,n,2],{n,0,100}] (* _Paolo Xausa_, Dec 15 2023 *)

%t LinearRecurrence[{0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,-1},{0,1,2,3,9,6,7,4,18,5,11,12,27,15,16,8,36,10,20,21,45,24,25,13},80] (* _Harvey P. Dale_, Feb 07 2024 *)

%o (Python)

%o def A006368(n):

%o if n%2 == 0:

%o return 3*(n//2)

%o elif n%4 == 1:

%o return 3*(n//4)+1

%o else:

%o return 3*(n+1)//4-1

%o n = 0

%o while n < 30:

%o print(n,A006368(A006368(n)))

%o n = n+1 # _A.H.M. Smeets_, Aug 14 2019

%Y Cf. A006368, A006369, A168222.

%K nonn,easy

%O 0,3

%A _Reinhard Zumkeller_, Nov 20 2009

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 March 28 15:38 EDT 2024. Contains 371254 sequences. (Running on oeis4.)