OFFSET
1,2
COMMENTS
Making this nest for any number n: ...FromDigits(IntegerDigits(FromDigits(IntegerDigits(n,2),3),4),5)..., each step of the nest is an iteration of type: ...FromDigits(IntegerDigits(n,s),s+1)..., with the initial s with the value 2, that is, for example, in the first iteration, the number n is converted to base 2, so it is brought to base 10 as if it came from base 3. The next iteration repeats this operation, but converts the result of previous step to base 4 and takes it to base 10 from base 5, and so on until the number does not change when a new step is made.
FORMULA
a(n) = ...FromDigits(IntegerDigits(FromDigits(IntegerDigits(n,2),3),4),5)..., until the number no longer varies in the next iteration.
EXAMPLE
The number 1 is the first term because, since the first iteration, when n=1, the result is 1, and 1 on any basis is itself, so a(1)=1.
The number 3 is a term because when n=2, the first iteration represented by: FromDigits(IntegerDigits(2,2),3) gives 3 and the second iteration: FromDigits(IntegerDigits(3,4),5), it still gives 3, that is, in any subsequent iteration, the result for n=2 continues to give 3, so a(2)=3.
The number 5 is a term because when n=3, after the second and subsequent iterations the result is 5, then a(3)=5 and so on.
MATHEMATICA
(* Terms of NBSC (a(n)): *)
NBSC[n_]:=Module[{i}, FixedPoint[i=1; FromDigits[IntegerDigits[#, 1+i++], 1+i++]&, n, Infinity]]
(* Sequence generation (sequence NBSC): *)
NBSCtable[n_]:=Module[{i}, Table[FixedPoint[i=1; FromDigits[IntegerDigits[#, 1+i++], 1+i++]&, x, Infinity], {x, 1, n}]]
(* Number of iterations of each term: *)
NBSCiter[n_]:=Module[{s, i}, s=1; While[True, If[Nest[i=1; FromDigits[IntegerDigits[#, 1+i++], 1+i++]&, n, s]==FixedPoint[i=1; FromDigits[IntegerDigits[#, 1+i++], 1+i++]&, n, Infinity], Break[]]; s++]; s]
(* Graph each step of the first NBSC (nested graphic): *)
NBSCstepgraph[n_]:=Module[{i, j}, label[l_]:=Panel[l, FrameMargins->-2, Background->Lighter[Red, 0.5]]; NBSC[m_]:=FixedPoint[j=1; FromDigits[IntegerDigits[#, 1+j++], 1+j++]&, m, Infinity]; NestGraph[i=1; FromDigits[IntegerDigits[#, 1+i++], 1+i++]&, n, 300, VertexLabels->{"Name", NBSC[n]->Placed["Name", Above, label]}]]
PROG
(PARI) a(n) = {my(ok = 0, b = 2, m); while (!ok, m = fromdigits(digits(n, b), b+1); if (m == n, break); n = m; b += 2; ); n; } \\ Michel Marcus, Sep 13 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Claudio Lobo Chaib Filho, Sep 12 2019
STATUS
approved