A081849 Consider recurrence b(0) = (2n+1)/2, b(n) = b(0)*ceiling(b(n-1)); sequence gives first integer reached.
3, 20, 14, 468, 33, 299, 60, 47328, 95, 1218, 138, 25475, 189, 3161, 248, 20830128, 315, 6512, 390, 181138, 473, 11655, 564, 9015167, 663, 18974, 770, 671745, 885, 28853, 1008, 38906570560, 1139, 41676, 1278, 1799888, 1425, 57827, 1580, 110341278, 1743, 77690
Offset: 1
Programs
-
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 *)
-
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
-
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
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
Comments