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.
%I A181988 #49 Apr 21 2025 13:23:01 %S A181988 1,2,2,3,3,4,4,4,5,6,6,6,7,8,8,5,9,10,10,9,11,12,12,8,13,14,14,12,15, %T A181988 16,16,6,17,18,18,15,19,20,20,12,21,22,22,18,23,24,24,10,25,26,26,21, %U A181988 27,28,28,16,29,30,30,24,31,32,32,7,33,34,34,27,35,36 %N A181988 If n is odd, a(n) = (n+1)/2; if n is even, a(n) = a(n/2) + A003602(n). %C A181988 The original definition was "Interleaved multiples of the positive integers". %C A181988 This sequence is A_1 where A_k = Interleave(k*counting,A_(k+1)). %C A181988 Show your friends the first 15 terms and see if they can guess term number 16. (If you want to be fair, you might want to show them A003602 first.) - _David Spies_, Sep 17 2012 %H A181988 Antti Karttunen, <a href="/A181988/b181988.txt">Table of n, a(n) for n = 1..8191</a> %F A181988 a((2*n-1)*2^p) = n*(p+1), p >= 0. %F A181988 a(n) = A001511(n)*A003602(n). - _L. Edson Jeffery_, Nov 21 2015. (Follows directly from above formula.) - _Antti Karttunen_, Jan 19 2016 %p A181988 nmax:=70: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := n*(p+1) od: od: seq(a(n), n=1..nmax); # _Johannes W. Meijer_, Jan 21 2013 %o A181988 (Haskell) %o A181988 interleave (hdx : tlx) y = hdx : interleave y tlx %o A181988 oeis003602 = interleave [1..] oeis003602 %o A181988 oeis181988 = interleave [1..] (zipWith (+) oeis003602 oeis181988) %o A181988 (Python) %o A181988 from itertools import count %o A181988 def interleave(A): %o A181988 A1=next(A) %o A181988 A2=interleave(A) %o A181988 while True: %o A181988 yield next(A1) %o A181988 yield next(A2) %o A181988 def multiples(k): %o A181988 return (k*i for i in count(1)) %o A181988 interleave(multiples(k) for k in count(1)) %o A181988 (Python) %o A181988 def A181988(n): return (m:=(n&-n).bit_length())*((n>>m)+1) # _Chai Wah Wu_, Jul 12 2022 %o A181988 (Scheme) %o A181988 ;; With memoization-macro definec. %o A181988 (definec (A181988 n) (if (even? n) (+ (A003602 n) (A181988 (/ n 2))) (A003602 n))) %o A181988 ;; _Antti Karttunen_, Jan 19 2016 %Y A181988 Cf. A220466. %Y A181988 Cf. A001511, A003602. %K A181988 easy,nonn %O A181988 1,2 %A A181988 _David Spies_, Apr 04 2012 %E A181988 Definition replaced by a formula provided by _David Spies_, Sep 17 2012. _N. J. A. Sloane_, Nov 22 2015