%I #30 Aug 30 2024 06:25:10
%S 4,7,9,11,12,15,16,19,20,23,25,27,28,31,33,35,36,39,41,43,44,47,48,51,
%T 52,55,57,59,60,63,64,67,68,71,73,75,76,79,80,83,84,87,89,91,92,95,97,
%U 99,100,103,105,107,108,111,112,115,116,119,121,123,124,127,129,131,132,135,137
%N Slowest increasing sequence beginning with 4 such that n and a(n) are either both evil or both odious.
%C (i) Theorem: For every initial value a(1) > 4, a minimum index n exists such that the a(n) obtained from that initial value coincides with this sequence here. Thus there exist essentially two slowest increasing sequences with this type of evil/odious congruence: A159615 and this one here.
%C (ii) In connection with this theorem, one can generalize to slowest increasing sequences a_m(n), a_m(1)=m, which let n and a(n) be at the same time in or not in some increasing sequence c(n). (This sequence here is c = A000069, m=4.)
%C We define a rank r of c as the minimum value a_r(1) such that for sufficiently large n (n depending on m) all sequences a_m(n), m>r, coincide with a_r(n).
%C In particular, c(n)=A004760(n+1) has rank r=2, and A000069 has rank r=3.
%C The problems are: 1) to find a sequence of rank r >= 4; 2) to find the rank of primes or to prove that it does not exist (in case of which it could be defined as infinity).
%C There is a conjecture arising in Sequence Machine that a(n) = A026491(2+n)-1. This appears to be true: Here we start from on odious or evil number and apply a minimum number of van-Eck-Transforms (of A171898) to reach a value larger than a(n-1). The Dekking formula in A026491 says that A026491 is essentially a partial sum of the backward van-Eck-Transforms, and in a (vague) manner this seems to match.
%C - _R. J. Mathar_, Jun 24 2021
%H Amiram Eldar, <a href="/A159619/b159619.txt">Table of n, a(n) for n = 1..10000</a>
%H Hsien-Kuei Hwang, S. Janson and T.-H. Tsai, <a href="http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf">Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications</a>, Preprint 2016.
%H Hsien-Kuei Hwang, S. Janson and T.-H. Tsai, <a href="https://doi.org/10.1145/3127585">Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications</a>, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585.
%H Jon Maiga, <a href="http://sequencedb.net/s/A159619">Computer-generated formulas for A159619</a>, Sequence Machine.
%H Vladimir Shevelev, <a href="https://arxiv.org/abs/0904.2101">Several results on sequences which are similar to the positive integers</a>, arXiv:0904.2101 [math.NT], 2009.
%F a(n) = 2n+3 if n*A007814(n+1) is even, and a(n) = 2n+2 otherwise.
%p read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n), 'odd') ) ; end:
%p A159619 := proc(n) option remember; if n = 1 then 4; else for a from procname(n-1)+1 do if isA000069(a) = isA000069(n) then RETURN(a) ; fi; od: fi; end:
%p seq(A159619(n), n=1..120) ; # _R. J. Mathar_, Mar 25 2010
%t a[n_] := 2 * n + If[EvenQ[n] || EvenQ[IntegerExponent[n+1, 2]], 3, 2]; Array[a, 100] (* _Amiram Eldar_, Aug 30 2024 *)
%o (PARI) a(n) = 2 * n + if(!(n % 2) || !(valuation(n+1, 2) % 2), 3, 2); \\ _Amiram Eldar_, Aug 30 2024
%Y Cf. A000069, A001969, A159615, A007814, A004760, A159559, A159560.
%K nonn,base,easy
%O 1,1
%A _Vladimir Shevelev_, Apr 17 2009, Apr 27 2009, May 04 2009
%E Edited and extended by _R. J. Mathar_, Mar 25 2010