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 A160522 #17 Apr 28 2025 11:53:53 %S A160522 5,9,13,15,15,19,19,21,25,27,27,29,29,33,33,35,39,39,41,43,43,45,45, %T A160522 45,47,51,55,57,57,57,57,57,57,59,61,61,65,65,65,65,69,69,71,71,73,75, %U A160522 75,77,77,81,81,81,81,85,89,89,89,89,89,91,91,91,91,91,93,97,99,99,103,103 %N A160522 The n-th odd composite number minus the n-th even composite number. %H A160522 K. Stern, <a href="/A160522/b160522.txt">Table of n, a(n) for n = 1..1000</a> %F A160522 a(n) = A071904(n) - A005843(n+1). %t A160522 Last[t = GatherBy[Select[Range[4, 245], ! PrimeQ[#] &], OddQ]] - Take[First[t], Length[Last[t]]] (* _Jayanta Basu_, Aug 11 2013 *) %o A160522 (MATLAB) composite function [a] = A160522(k) j = 1; n = 1; even = 4; while j < k n = n + 1; if isprime(n) == 1 else if mod(n,2) == 0 else a(j,1) = n - even; even = even + 2; j = j + 1; end end end %o A160522 (PARI) m=70; v=vector(m); k=4; n=0; while(n<m, if(k%2>0&&!isprime(k), n++; v[n]=k-2*(n+1)); k++); v \\ _Klaus Brockhaus_, May 22 2009 %o A160522 (Python) %o A160522 from sympy import primepi %o A160522 def A160522(n): %o A160522 if n == 1: return 5 %o A160522 m, k = n, primepi(n) + n + (n>>1) %o A160522 while m != k: %o A160522 m, k = k, primepi(k) + n + (k>>1) %o A160522 return m-(n+1<<1) # _Chai Wah Wu_, Aug 01 2024 %Y A160522 Cf. A002808, A005843, A071904, A047846. %K A160522 easy,nonn %O A160522 1,1 %A A160522 _Kyle Stern_, May 16 2009 %E A160522 Extended and formula edited by _Klaus Brockhaus_, May 22 2009