login
a(n) = numerator of the continued fraction which has the positive divisors of n as its terms.
3

%I #21 Jan 19 2023 02:10:56

%S 1,3,4,13,6,63,8,107,37,163,12,3259,14,311,319,1725,18,10449,20,13928,

%T 613,751,24,638475,151,1043,1003,37306,30,1513023,32,55307,1489,1771,

%U 1511,19381852,38,2207,2071,4538318,42,5649833,44,142046,131413,3223,48

%N a(n) = numerator of the continued fraction which has the positive divisors of n as its terms.

%C The divisors can be written either from largest to smallest or from smallest to largest and the numerator of the continued fraction would remain unchanged.

%H Robert Israel, <a href="/A127611/b127611.txt">Table of n, a(n) for n = 1..10000</a>

%F If p is prime, a(p^k) = p^k * a(p^(k-1)) + a(p^(k-2)), with a(p^0) = a(1) = 1 and a(p^1) = p+1. - _Robert Israel_, Jan 17 2023

%e The divisors of 6 are 1,2,3,6. So a(6) is the numerator of 1 +1/(2 +1/(3 +1/6)) = 63/44. a(6) is also the numerator of 6 +1/(3 +1/(2+1/1)) = 63/10.

%p f:= n -> numer(numtheory:-cfrac(sort(convert(numtheory:-divisors(n),list)))):

%p map(f, [$1..100]); # _Robert Israel_, Jan 17 2023

%t f[n_] := Numerator[FromContinuedFraction[Divisors[n]]];Table[f[n], {n, 47}] (* _Ray Chandler_, Jan 22 2007 *)

%o (PARI) a(n) = contfracpnqn(divisors(n))[1,1]; \\ _Kevin Ryde_, Jan 19 2023

%Y Cf. A127612 (denominators), A127613 (denominators).

%Y Cf. A061377, A280219.

%K frac,nonn,look

%O 1,2

%A _Leroy Quet_, Jan 19 2007

%E Extended by _Ray Chandler_, Jan 22 2007