login
a(n) = g_n(5) where g is the function defined in A266202.
9

%I #12 Jan 11 2020 15:57:47

%S 5,9,15,17,19,21,23,24,25,26,27,28,29,30,31,31,31,31,31,31,31,31,31,

%T 31,31,31,31,31,31,31,31,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,

%U 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0

%N a(n) = g_n(5) where g is the function defined in A266202.

%C For more info see A266201-A266202.

%e g_1(5) = b_2(5)-1= b_2(2^2+1)-1 = 3^2+1-1 = 9;

%e g_2(5) = b_3(3^2)-1 = 4^2-1 = 15;

%e g_3(5) = b_4(3*4+3)-1 = 3*5+3-1 = 17;

%e g_4(5) = b_5(3*5 + 2)-1 = 3*6 + 2-1 = 19;

%e g_5(5) = b_6(3*6 + 1)-1 = 3*7+1-1 = 21;

%e g_6(5) = b_7(3*7)-1 = 3*8-1 = 23;

%e g_7(5) = b_8(2*8+7)-1 = 2*9+7-1 = 24;

%e g_8(5) = b_9(2*9+6)-1 = 2*10+6-1 = 25;

%e g_9(5) = b_10(2*10+5)-1 = 2*11+5-1 = 26;

%e g_10(5) = b_11(2*11+4)-1 = 2*12+4-1 = 27;

%e g_11(5) = b_12(2*12+3)-1 = 2*13+3-1 = 28;

%e g_12(5) = b_13(2*13+2)-1 = 2*14+2-1 = 29;

%e g_13(5) = b_14(2*14+1)-1 = 2*15+1-1 = 30;

%e g_14(5) = b_15(2*15)-1 = 2*16-1 = 31;

%e g_15(5) = b_16(16+15)-1 = 17+15-1 = 31;

%e ...

%e g_30(5) = b_31(31)-1 = 31;

%e g_31(5) = b_32(31)-1 = 30;

%e g_32(5) = b_33(30)-1 = 29;

%e ...

%e g_61(5) = 0. (End of sequence)

%t g[k_, n_] := If[k == 0, n, Total@ Flatten@ MapIndexed[#1 (k + 2)^(#2 - 1) &, Reverse@ IntegerDigits[#, k + 1]] &@ g[k - 1, n] - 1]; Table[g[n, 5], {n, 0, 61}] (* _Michael De Vlieger_, May 17 2016 *)

%o (PARI) a(n) = {if (n == 0, return (5)); wn = 5; for (k=2, n+1, pd = Pol(digits(wn, k)); wn = subst(pd, x, k+1) - 1; ); wn; }

%o vector(62, n, n--; a(n)) \\ _Michel Marcus_, Apr 03 2016

%Y Cf. A266204: G_n(5).

%Y Weak Goodstein sequences: A137411: g_n(11); A265034: g_n(266); A267647: g_n(4); A266202: g_n(n); A266203: a(n) = k such that g_k(n)=0;

%K fini,nonn,full

%O 0,1

%A _Natan Arie Consigli_, Mar 17 2016