A182321 Number of iterations of A025581(n) required to reach 0.
0, 1, 2, 1, 3, 2, 1, 2, 3, 2, 1, 4, 2, 3, 2, 1, 3, 4, 2, 3, 2, 1, 2, 3, 4, 2, 3, 2, 1, 3, 2, 3, 4, 2, 3, 2, 1, 4, 3, 2, 3, 4, 2, 3, 2, 1, 3, 4, 3, 2, 3, 4, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 2, 3, 2, 1
Offset: 0
Keywords
Examples
g(8) = 2, g(2) = 1, g(1) = 0. Therefore a(8) = 3.
Links
- Clark Kimberling, Table of n, a(n) for n = 0..1000
- Patrick Devlin, Integer Subsets with High Volume and Low Perimeter, arXiv:1202.1331v1 [math.CO]
Programs
-
Maple
# With this code, the n-th term of the sequence is given by a call to a(n) f:=n->round(sqrt(2*n)): g:=n->f(n)*(f(n)+1)/2-n: a:=proc(n) option remember: if n < 1 then return 0: fi: return 1 + a(g(n)): end proc:
-
Mathematica
(* This program computes the sequence as the number of terms in the minimal alternative triangular-number representation of n+1. *) b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}]; s[n_] := Table[b[n], {k, 1, n}]; h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; g = h[100]; r[0] = {0}; r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]; Join[{0}, Rest[Table[Length[r[n]], {n, 0, 100}]]] (* A182321 for n >= 1 *) (* Clark Kimberling, Apr 10 2015 *)
Formula
The Devlin link shows a(n) < log_2(log_2(n/2)) + 2.
Comments