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.

A102781 Number of positive even numbers less than the n-th prime.

This page as a plain text file.
%I A102781 #18 Oct 14 2024 00:10:27
%S A102781 0,1,2,3,5,6,8,9,11,14,15,18,20,21,23,26,29,30,33,35,36,39,41,44,48,
%T A102781 50,51,53,54,56,63,65,68,69,74,75,78,81,83,86,89,90,95,96,98,99,105,
%U A102781 111,113,114,116,119,120,125,128,131,134,135,138,140,141,146,153,155,156
%N A102781 Number of positive even numbers less than the n-th prime.
%C A102781 Same as A005097 ((odd primes - 1)/2) with a leading zero. - Lambert Klasen, Nov 06 2005
%H A102781 Ray Chandler, <a href="/A102781/b102781.txt">Table of n, a(n) for n = 1..10000</a>
%F A102781 Integer part of p#/((p-2)#*2#), where p=prime(n) and i# is the primorial function A034386(i). - _Cino Hilliard_, Feb 25 2005
%F A102781 n# = product of primes <= n. 0# = 1# = 2. [This is not a standard convention!] n#/(n-r)#/r# is analogous to the number of binomial coefficients A007318 = C(n, r) = n!/(n-r)!/r! where factorial ! is replaced by primorial #.
%F A102781 a(n) = prime_n - floor((prime_n)/2) - 1. - _Giovanni Teofilatto_, Nov 05 2005
%F A102781 a(n) = [A034386(prime(n))/(2*A034386(prime(n)-2))], n>2. - _R. J. Mathar_, May 18 2009
%F A102781 a(n) = [(prime(n)-1)/2] where the integer part [.] needs be taken only for n=1. - _M. F. Hasler_, Dec 13 2019
%t A102781 Table[Prime[n] - Floor[Prime[n]/2] - 1, {n, 65}] (* _Robert G. Wilson v_ *)
%o A102781 (PARI) c(n,r) = { local(p); forprime(p=r,n, print1(floor(primorial(p)/ primorial(p-r)/primorial(r)+.0)",") ) } primorial(n) = \ The product primes <= n using the pari primelimit. { local(p1,x); if(n==0||n==1, return(2)); p1=1; forprime(x=2,n,p1*=x); return(p1) }
%o A102781 (PARI) apply( A102781(n)=(prime(n)-1)\2, [1..99]) \\ _M. F. Hasler_, Dec 13 2019
%o A102781 (Python)
%o A102781 from sympy import prime
%o A102781 def A102781(n): return prime(n)-1>>1 # _Chai Wah Wu_, Oct 13 2024
%Y A102781 Cf. A005097. - _R. J. Mathar_, May 18 2009
%Y A102781 Equals (A000040-1)/2, integer part (0) for the first term. - _M. F. Hasler_, Dec 13 2019
%K A102781 easy,nonn
%O A102781 1,3
%A A102781 _Cino Hilliard_, Feb 25 2005
%E A102781 Simpler definition from _Giovanni Teofilatto_, Nov 05 2005
%E A102781 Edited by _N. J. A. Sloane_ Jul 05 2009 at the suggestion of R. J. Mathar