%I M0278 #80 Aug 15 2023 08:13:29
%S 0,0,1,2,2,3,4,4,5,6,6,7,7,8,9,9,10,11,11,12,12,13,14,14,15,16,16,17,
%T 17,18,19,19,20,20,21,22,22,23,24,24,25,25,26,27,27,28,29,29,30,30,31,
%U 32,32,33,33,34,35,35,36,37,37,38,38,39,40,40,41,42,42,43,43,44,45,45
%N The male of a pair of recurrences.
%C M(n) is not equal to F(n) if and only if n+1 is a Fibonacci number (A000045); a(n)=A005379(n)-A192687(n). [_Reinhard Zumkeller_, Jul 12 2011]
%D D. R. Hofstadter, "Goedel, Escher, Bach", p. 137.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Reinhard Zumkeller, <a href="/A005379/b005379.txt">Table of n, a(n) for n = 0..10000</a>
%H D. R. Hofstadter, <a href="/A006336/a006336_1.pdf">Eta-Lore</a> [Cached copy, with permission]
%H D. R. Hofstadter, <a href="/A006336/a006336_2.pdf">Pi-Mu Sequences</a> [Cached copy, with permission]
%H D. R. Hofstadter and N. J. A. Sloane, <a href="/A006336/a006336.pdf">Correspondence, 1977 and 1991</a>
%H Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
%H Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992
%H J. Shallit, <a href="https://arxiv.org/abs/2308.06544">Proving properties of some greedily-defined integer recurrences via automata theory</a>, arXiv:2308.06544 [cs.DM], August 12 2023.
%H Th. Stoll, <a href="http://www.fq.math.ca/Papers1/46_47-1/Stoll_11-08.pdf">On Hofstadter's married functions</a>, Fib. Q., 46/47 (2008/2009), 62-67. - from _N. J. A. Sloane_, May 30 2009
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HofstadterMale-FemaleSequences.html">Hofstadter Male-Female Sequences.</a>
%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>
%H <a href="/index/Go#GEB">Index entries for sequences from "Goedel, Escher, Bach"</a>
%F F(0) = 1; M(0) = 0; F(n) = n - M(F(n-1)); M(n) = n - F(M(n-1)).
%F The g.f. -z^2*(-1-z^3-z^6-z-z^4-z^7+z^8)/(z+1)/(z^2+1)/(z^4+1)/(z-1)^2, conjectured by _Simon Plouffe_ in his 1992 dissertation is incorrect: the coefficient of z^33 in the g.f. is 21, but a(33) = 20. (Discovered by Sahand Saba, Jan 14 2013.) - _Frank Ruskey_, Jan 16 2013
%p F:= proc(n) option remember; n - M(procname(n-1)) end proc:
%p M:= proc(n) option remember; n - F(procname(n-1)) end proc:
%p F(0):= 1: M(0):= 0:
%p seq(M(n),n=0..100); # _Robert Israel_, Jun 15 2015
%t f[0] = 1; m[0] = 0; f[n_] := f[n] = n - m[f[n-1]]; m[n_] := m[n] = n - f[m[n-1]]; Table[m[n], {n, 0, 73}]
%t (* _Jean-François Alcover_, Jul 27 2011 *)
%o (Haskell) Cf. A005378.
%o (PARI) f(n) = if(n<1, 1, n - m(f(n - 1)));
%o m(n) = if(n<1, 0, n - f(m(n - 1)));
%o for(n=0, 73, print1(m(n),", ")) \\ _Indranil Ghosh_, Apr 23 2017
%Y Cf. A005378.
%K nonn,nice,easy
%O 0,4
%A _N. J. A. Sloane_
%E More terms from _James A. Sellers_, Jul 12 2000
%E Comment corrected by _Jaroslav Krizek_, Dec 25 2011