cp's OEIS Frontend

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.

A115392 First appearance of n-th prime as prime factor in list of semiprimes.

This page as a plain text file.
%I A115392 #23 Apr 03 2025 12:44:23
%S A115392 1,2,4,5,8,10,12,14,16,21,22,25,27,29,33,35,38,41,45,47,50,52,55,58,
%T A115392 62,64,67,70,73,76,82,84,87,88,93,96,100,104,107,111,113,115,120,121,
%U A115392 124,126,133,137,141,142,143,147,149,155,158,162,168,169,174,176,178,183
%N A115392 First appearance of n-th prime as prime factor in list of semiprimes.
%C A115392 The positions of even semiprimes in A001358. - _Juri-Stepan Gerasimov_, Apr 11 2010
%H A115392 Zak Seidov, <a href="/A115392/b115392.txt">Table of n, a(n) for n = 1..1000</a>
%F A115392 A001358(a(n)) = 2*A000040(n) - _Zak Seidov_, Jun 27 2017
%e A115392 a(5)=8 because 5th prime, 11, first appeared as a prime factor in 8th semiprime 22=2*11;
%e A115392 a(6)=10 because 6th prime, 13, first appeared as a prime factor in 10th semiprime 26=2*13.
%t A115392 sp = Select[Range[4,20000],2 == PrimeOmega[#]&]; Table[Position[Mod[sp, Prime[k]],0][[1,1]],{k,1000}] (* For first 1000 terms. - _Zak Seidov_, Jun 27 2017 *)
%o A115392 (PARI) first(n) = my(l = List([4,1]), u = 2*prime(n), res = vector(n), t=0); forprime(p = 2, t++; sqrt(2*prime(n)), forprime(q = p+1, u\p, listput(l, [p*q, t]));  listsort(l); for(i=1, #l, if(res[l[i][3]]==0, res[l[i][3]] = i)) \\ _David A. Corneth_, Jun 28 2017
%o A115392 (Python)
%o A115392 from math import isqrt
%o A115392 from sympy import primepi, prime, primerange
%o A115392 def A115392(n): return int(-((t:=primepi(s:=isqrt(a:=prime(n)<<1)))*(t-1)>>1)+sum(primepi(a//p) for p in primerange(s+1))) # _Chai Wah Wu_, Apr 03 2025
%Y A115392 Cf. A000040, A001358.
%K A115392 nonn
%O A115392 1,2
%A A115392 _Zak Seidov_, Mar 08 2006
%E A115392 Edited by _Zak Seidov_, Jun 27 2017