cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A143232 Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2.

This page as a plain text file.
%I A143232 #14 Feb 16 2025 08:33:08
%S A143232 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,
%T A143232 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,
%U A143232 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
%N A143232 Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2.
%C A143232 A004001 is the Hofstadter-Conway $10,000 Sequence and A004001(n) - n/2 is increasingly larger versions of the batrachion Blancmange function.
%H A143232 G. C. Greubel, <a href="/A143232/b143232.txt">Table of n, a(n) for n = 1..10000</a>
%H A143232 H. Rich, <a href="http://www.jsoftware.com/pipermail/programming/2008-August/011551.html">Hofstadter-Conway $10,000 Sequence</a>, Programming Archives, 2008.
%H A143232 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Hofstadter-Conway10000-DollarSequence.html">Hofstadter-Conway $10,000 Sequence</a>.
%F A143232 a(n) = Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2 .
%F A143232 For practical purposes, a full Egyptian fraction algorithm is not necessary. Since the elements of A004001(n) - n/2 are either whole or their fractional part is .5, the sequence can be effected by a(n) = sefd(A004001(n) - n/2) with sefd(x) = x + 3 * (x - floor(x)) .
%e A143232 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.
%t A143232 HC[n_]:= HC[n]= If[n<3, 1, HC[HC[n-1]] +HC[n-HC[n-1]]]; (*HC=A004001*)
%t A143232 f[x_]:= 4*x -3*Floor[x];
%t A143232 A143232[n_]:= f[HC[n] -n/2];
%t A143232 Table[A143232[n], {n,100}] (* _G. C. Greubel_, Sep 10 2024 *)
%o A143232 (J) a004001 =: ((] +&:$: -) $:@:<:)@.(2&<) M.
%o A143232 a143232 =: (+ 3 * 1&|)@:(a004001 - -:)"0
%o A143232 (Magma)
%o A143232 A004001:=[n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..125]];
%o A143232 f:= func< x | 4*x - 3*Floor(x) >;
%o A143232 A143232:= func< n | f(A004001[n] - n/2) >;
%o A143232 [A143232(n): n in [1..100]]; // _G. C. Greubel_, Sep 10 2024
%o A143232 (SageMath)
%o A143232 @CachedFunction
%o A143232 def b(n): # b = A004001
%o A143232     if n<3: return 1
%o A143232     else: return b(b(n-1)) + b(n-b(n-1))
%o A143232 def f(x): return x + 3 * (x - floor(x))
%o A143232 def A143232(n): return f(b(n) - n/2)
%o A143232 [A143232(n) for n in range(1,101)] # _G. C. Greubel_, Sep 10 2024
%Y A143232 Cf. A004001.
%K A143232 nonn,easy
%O A143232 1,1
%A A143232 Dan Bron (j (at) bron.us), Jul 31 2008