A143232 Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2.
2, 0, 2, 0, 2, 1, 2, 0, 2, 1, 3, 1, 3, 1, 2, 0, 2, 1, 3, 2, 3, 2, 4, 2, 4, 2, 3, 2, 3, 1, 2, 0, 2, 1, 3, 2, 4, 2, 4, 3, 5, 3, 5, 4, 5, 4, 5, 3, 5, 4, 5, 4, 5, 3, 5, 3, 4, 2, 4, 2, 3, 1, 2, 0, 2, 1, 3, 2, 4, 3, 4, 3, 5, 4, 6, 4, 6, 5, 7, 5, 7, 6, 7, 6, 7, 5, 7, 6, 8, 6, 8, 7, 8, 7, 8, 6, 8, 7, 8, 7, 8, 6, 8, 6, 7
Offset: 1
Examples
a(43) = 5 because A004001(43) = 25, so (A004001(43) - (43/2)) = 3.5 and the Egyptian fraction expansion of 3.5 is (1/1)+(1/1)+(1/1)+(1/2), so the denominators are 1,1,1,2 which sums to 5.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..10000
- H. Rich, Hofstadter-Conway $10,000 Sequence, Programming Archives, 2008.
- Eric Weisstein's World of Mathematics, Hofstadter-Conway $10,000 Sequence.
Crossrefs
Cf. A004001.
Programs
-
J
a004001 =: ((] +&:$: -) $:@:<:)@.(2&<) M. a143232 =: (+ 3 * 1&|)@:(a004001 - -:)"0
-
Magma
A004001:=[n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..125]]; f:= func< x | 4*x - 3*Floor(x) >; A143232:= func< n | f(A004001[n] - n/2) >; [A143232(n): n in [1..100]]; // G. C. Greubel, Sep 10 2024
-
Mathematica
HC[n_]:= HC[n]= If[n<3, 1, HC[HC[n-1]] +HC[n-HC[n-1]]]; (*HC=A004001*) f[x_]:= 4*x -3*Floor[x]; A143232[n_]:= f[HC[n] -n/2]; Table[A143232[n], {n,100}] (* G. C. Greubel, Sep 10 2024 *)
-
SageMath
@CachedFunction def b(n): # b = A004001 if n<3: return 1 else: return b(b(n-1)) + b(n-b(n-1)) def f(x): return x + 3 * (x - floor(x)) def A143232(n): return f(b(n) - n/2) [A143232(n) for n in range(1,101)] # G. C. Greubel, Sep 10 2024
Formula
a(n) = Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2 .
Comments