OFFSET
1,1
COMMENTS
k = A001511(n) is the number of steps to reach an integer b(k).
FORMULA
a(n) = s*(n*s^k - 1/2) / (s-1) where s = b(0) = (2*n+1)/2 and k = A001511(n). - Kevin Ryde, Jun 30 2024
MAPLE
Digits := 100: c := ceil; A081849 := proc(a) local i, t0, t; t0 := a; t := 0; for i from 1 to 100 do if whattype(t0) <> integer then t0 := a*c(t0); t := t+1; else RETURN(t0); fi; od; RETURN('FAIL'); end;
MATHEMATICA
a[n_]:=Module[{b=b0=(2n+1)/2}, While[!IntegerQ[b], b=b0*Ceiling[b]]; b]; Array[a, 42] (* Stefano Spezia, Jun 26 2024 *)
PROG
(Python)
from math import ceil
from fractions import Fraction
def a(n):
b0 = b = Fraction((2*n+1), 2)
while b.denominator != 1: b = b0*ceil(b)
return b.numerator
print([a(n) for n in range(1, 43)]) # Michael S. Branicky, Mar 20 2021
(PARI) a(n) = if(n==1, 3, my(t=2*n+1, k=1+valuation(n, 2)); n*t^(k+1) >>k \ (t-2)); \\ Kevin Ryde, Jun 30 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Apr 13 2003
STATUS
approved