OFFSET
1,1
LINKS
Michel Marcus, Table of n, a(n) for n = 1..858
FORMULA
a(n) seems to be asymptotic to c*n^2 with 1/2 < c < 1.
PROG
(PARI) f(n) = if (n%2, (3*n+1)/2, n/2); \\ A014682
g(n) = my(last = n); while (1, my(new = f(f(last))); if (new == last, return(new)); last = new; ); \\ A006513
isok(m) = !(m%2) && (sum(k=1, m, g(k)) == 3*m/2); \\ Michel Marcus, Feb 03 2022
(PARI) f(n) = if (n%2, (3*n+1)/2, n/2); \\ A014682
g(n) = my(last = n); while (1, my(new = f(f(last))); if (new == last, return(new)); last = new; ); \\ A006513
lista(nn) = {my(v = vector(nn, k, g(k)), w = vector(nn)); w[1] = v[1]; for (i=2, nn, w[i] = w[i-1] + v[i]; ); forstep (i=2, nn, 2, if (w[i] == 3*i/2, print1(i, ", ")); ); } \\ Michel Marcus, Feb 03 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Oct 30 2002
EXTENSIONS
More terms from Michel Marcus, Feb 03 2022
STATUS
approved