login
The slowest increasing sequence beginning with a(1)=2 such that a(n) and n are both odious or both not odious.
10

%I #15 Dec 10 2019 20:04:15

%S 2,4,5,7,9,10,11,13,15,17,19,20,21,22,23,25,27,29,31,33,35,37,39,40,

%T 41,42,43,44,45,46,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,

%U 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,99,101,103,105,107,109,111

%N The slowest increasing sequence beginning with a(1)=2 such that a(n) and n are both odious or both not odious.

%H Amiram Eldar, <a href="/A159615/b159615.txt">Table of n, a(n) for n = 1..10000</a>

%H Vladimir Shevelev, <a href="http://arXiv.org/abs/0904.2101">Several results on sequences which are similar to the positive integers</a>, arXiv:0904.2101 [math.NT], 2009.

%F For n>=1, a(n)=min{m>a(n-1): A010060(m)=A010060(n)}.

%F a(2n+1)=2a(n)+1.

%F a(2n)=3n+1+j,if n=2^k+j; a(2n)=(10n-4j)/3,if n=2^k+2^(k-1)+j, where 0<=j<=2^(k-1)-1.

%e If n=3, then k=1, j=0, therefore a(6)=(10*3-4*0)/3=10.

%p read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n),'odd') ) ; end:

%p A159615 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if isA000069(a) = isA000069(n) then RETURN(a) ; fi; od: fi; end:

%p seq(A159615(n),n=1..120) ; # _R. J. Mathar_, Aug 17 2009

%t odiousQ[n_] := OddQ[DigitCount[n, 2, 1]];

%t a[1] = 2; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[FreeQ[Array[a, n-1], k] && odiousQ[n] && odiousQ[k] || !odiousQ[n] && !odiousQ[k], Return[k] ] ];

%t Array[a, 80] (* _Jean-François Alcover_, Dec 10 2017 *)

%Y Cf. A000069, A159559, A159560, A004760.

%K nonn,easy

%O 1,1

%A _Vladimir Shevelev_, Apr 17 2009

%E Edited and extended by _R. J. Mathar_, Aug 17 2009