A159619 Slowest increasing sequence beginning with 4 such that n and a(n) are either both evil or both odious.
4, 7, 9, 11, 12, 15, 16, 19, 20, 23, 25, 27, 28, 31, 33, 35, 36, 39, 41, 43, 44, 47, 48, 51, 52, 55, 57, 59, 60, 63, 64, 67, 68, 71, 73, 75, 76, 79, 80, 83, 84, 87, 89, 91, 92, 95, 97, 99, 100, 103, 105, 107, 108, 111, 112, 115, 116, 119, 121, 123, 124, 127, 129, 131, 132, 135, 137
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- Hsien-Kuei Hwang, S. Janson and T.-H. Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, Preprint 2016.
- Hsien-Kuei Hwang, S. Janson and T.-H. Tsai, Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585.
- Jon Maiga, Computer-generated formulas for A159619, Sequence Machine.
- Vladimir Shevelev, Several results on sequences which are similar to the positive integers, arXiv:0904.2101 [math.NT], 2009.
Programs
-
Maple
read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n), 'odd') ) ; end: 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: seq(A159619(n), n=1..120) ; # R. J. Mathar, Mar 25 2010
-
Mathematica
a[n_] := 2 * n + If[EvenQ[n] || EvenQ[IntegerExponent[n+1, 2]], 3, 2]; Array[a, 100] (* Amiram Eldar, Aug 30 2024 *)
-
PARI
a(n) = 2 * n + if(!(n % 2) || !(valuation(n+1, 2) % 2), 3, 2); \\ Amiram Eldar, Aug 30 2024
Formula
a(n) = 2n+3 if n*A007814(n+1) is even, and a(n) = 2n+2 otherwise.
Extensions
Edited and extended by R. J. Mathar, Mar 25 2010
Comments