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 A375929 #15 Sep 18 2024 06:44:24 %S A375929 3,4,7,8,11,12,14,15,16,17,20,21,22,23,25,26,29,30,32,33,34,35,37,38, %T A375929 39,40,43,44,45,46,48,49,52,53,54,55,57,58,60,61,62,63,65,66,67,68,69, %U A375929 70,72,73,76,77,80,81,83,84,85,86,87,88,89,90,91,92,93,94 %N A375929 Numbers k such that A002808(k+1) = A002808(k) + 1. In other words, the k-th composite number is 1 less than the next. %C A375929 Positions of 1's in A073783 (see also A054546, A065310). %F A375929 a(n) = A375926(n) - 1. %e A375929 The composite numbers are 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, ... which increase by 1 after positions 3, 4, 7, 8, ... %t A375929 Join@@Position[Differences[Select[Range[100],CompositeQ]],1] %o A375929 (Python) %o A375929 from sympy import primepi %o A375929 def A375929(n): %o A375929 def bisection(f,kmin=0,kmax=1): %o A375929 while f(kmax) > kmax: kmax <<= 1 %o A375929 while kmax-kmin > 1: %o A375929 kmid = kmax+kmin>>1 %o A375929 if f(kmid) <= kmid: %o A375929 kmax = kmid %o A375929 else: %o A375929 kmin = kmid %o A375929 return kmax %o A375929 def f(x): return n+bisection(lambda y:primepi(x+2+y))-2 %o A375929 return bisection(f,n,n) # _Chai Wah Wu_, Sep 15 2024 %o A375929 (Python) # faster for initial segment of sequence %o A375929 from sympy import isprime %o A375929 from itertools import count, islice %o A375929 def agen(): # generator of terms %o A375929 pic, prevc = 0, -1 %o A375929 for i in count(4): %o A375929 if not isprime(i): %o A375929 if i == prevc + 1: %o A375929 yield pic %o A375929 pic, prevc = pic+1, i %o A375929 print(list(islice(agen(), 10000))) # _Michael S. Branicky_, Sep 17 2024 %Y A375929 Positions in A002808 of each element of A068780. %Y A375929 The complement is A065890 shifted. %Y A375929 First differences are A373403 (except first). %Y A375929 The version for non-prime-powers is A375713, differences A373672. %Y A375929 The version for prime-powers is A375734, differences A373671. %Y A375929 The version for non-perfect-powers is A375740. %Y A375929 The version for nonprime numbers is A375926. %Y A375929 A000040 lists the prime numbers, differences A001223. %Y A375929 A000961 lists prime-powers (inclusive), differences A057820. %Y A375929 A002808 lists the composite numbers, differences A073783. %Y A375929 A018252 lists the nonprime numbers, differences A065310. %Y A375929 A046933 counts composite numbers between primes. %Y A375929 Cf. A014689, A054546, A176246, A246655, A251092. %K A375929 nonn %O A375929 1,1 %A A375929 _Gus Wiseman_, Sep 12 2024