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 A196274 #27 Oct 24 2024 02:21:12 %S A196274 4,3,3,2,1,3,1,2,3,2,1,2,1,3,1,2,3,1,2,2,1,2,1,1,2,3,3,2,1,1,1,1,1,2, %T A196274 2,1,3,1,1,1,3,1,2,1,2,2,1,2,1,3,1,1,1,3,3,1,1,1,1,2,1,1,1,1,2,3,2,1, %U A196274 3,1,1,1,2,1,2,1,2,1,3,1,2,3,1,1,1,2 %N A196274 Half of the gaps A067970 between odd nonprimes A014076. %C A196274 a(n) < 4 for n > 1; a(A196276(n)) = 1; a(A196277(n)) > 1. - _Reinhard Zumkeller_, Sep 30 2011 %C A196274 Lengths of runs of equal terms in A025549. That sequence begins with: 1,1,1,1,3,3,3,45,45,45,..., that is 4 ones, 3 threes, 3 forty-fives, ... - _Michel Marcus_, Dec 02 2014 %H A196274 Reinhard Zumkeller, <a href="/A196274/b196274.txt">Table of n, a(n) for n = 1..10000</a> %F A196274 a(n) = (A014076(n+1)-A014076(n))/2 = A067970(n)/2. %e A196274 The smallest odd numbers which are not prime are 1, 9, 15, 21, 25, 27,... (sequence A014076). %e A196274 The gaps between these are: 8, 6, 6, 4, 2,... (sequence A067970), which are of course all even by construction, so it makes sense to divide all of them by 2, which yields this sequence: 4, 3, 3, 2, 1, ... %t A196274 With[{nn=401},Differences[Complement[Range[1,nn,2],Prime[Range[ PrimePi[ nn]]]]]/2] (* _Harvey P. Dale_, May 06 2012 *) %o A196274 (PARI) L=1;forstep(n=3,299,2,isprime(n)&next;print1((n-L)/2",");L=n) %o A196274 (Python) %o A196274 from sympy import primepi, isprime %o A196274 def A196274(n): %o A196274 if n == 1: return 4 %o A196274 m, k = n-1, primepi(n) + n - 1 + (n>>1) %o A196274 while m != k: %o A196274 m, k = k, primepi(k) + n - 1 + (k>>1) %o A196274 for d in range(1,4): %o A196274 if not isprime(m+(d<<1)): %o A196274 return d # _Chai Wah Wu_, Jul 31 2024 %Y A196274 Cf. A142723 for the decimal value of the associated continued fraction. %K A196274 nonn %O A196274 1,1 %A A196274 _M. F. Hasler_, Sep 30 2011 %E A196274 More terms from _Harvey P. Dale_, May 06 2012