OFFSET
0,1
COMMENTS
The trajectory of 3 gives A002061 and 5 gives essentially the same trajectory as 3.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
S. H. Weintraub, An interesting recursion, Amer. Math. Monthly, 111 (No. 6, 2004), 528-530.
Index entries for linear recurrences with constant coefficients, signature (3, -3, 1).
FORMULA
Numbers given satisfy a(n) = n^2 + 5n + 7, for n>2. - Ralf Stephan, Dec 04 2004
From Robert Israel, Oct 23 2015: (Start)
This is because for x = m^2 + 5*m + 7, (m+2)^2 < x < (m+3)^2 so A094765(x) = x + 2*(x-(m+2)^2) = m^2 + 7*m + 13 = (m+1)^2 + 5*(m+1) + 7.
Similarly, for any positive integer k, the trajectory of k^2 + k + 1 is n^2 + (2k+1) n + k^2 + k + 1 for n >= 0.
G.f.: 4 + 2*x + 6*x^2 + (7-8*x+3*x^2)/(1-x)^3. (End)
MAPLE
f:= n -> 3*n - 2*floor(sqrt(n))^2:
g:= proc(n) option remember; f(procname(n-1)) end proc:
g(0):= 11:
seq(g(n), n=0..100); # Robert Israel, Oct 23 2015
MATHEMATICA
NestList[3*#-2*Floor[Sqrt[#]]^2&, 11, 50] (* Harvey P. Dale, Feb 26 2022 *)
PROG
(PARI) lista(nn) = {print1(n=11, ", "); for (k=2, nn, m = 3*n - 2*sqrtint(n)^2; print1(m, ", "); n = m; ); } \\ Michel Marcus, Oct 23 2015
(PARI) Vec(4+2*x+6*x^2+(7-8*x+3*x^2)/(1-x)^3 + O(x^100)) \\ Altug Alkan, Oct 23 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 10 2004
STATUS
approved