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.

A065897 The a(n)-th composite number is twice the n-th prime.

This page as a plain text file.
%I A065897 #26 Aug 25 2024 02:49:36
%S A065897 1,2,5,7,13,16,22,25,31,41,43,52,59,62,69,78,87,91,101,107,111,120,
%T A065897 127,137,149,155,159,166,170,177,199,206,215,218,235,239,248,259,266,
%U A065897 277,286,289,306,309,316,319,339,359,366,369,375,386,389,406,416,426,438
%N A065897 The a(n)-th composite number is twice the n-th prime.
%C A065897 Also the least k such that the n-th primorial (A002110) is a divisor of the k-th compositorial (A036691). - _Reinhard Zumkeller_, Sep 03 2002
%H A065897 Harry J. Smith, <a href="/A065897/b065897.txt">Table of n, a(n) for n = 1..1000</a>
%F A065897 a(n) = 2*prime(n) - (pi(2*prime(n))) - 1, where pi = A000720.
%e A065897 a(7) = 22 because twice the 7th prime (2*17 = 34) is the 22nd composite number: 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34.
%p A065897 A065897:=n->2*ithprime(n)-(numtheory[pi](2*ithprime(n)))-1: seq(A065897(n), n=1..100); # _Wesley Ivan Hurt_, Sep 16 2017
%t A065897 Table[2*Prime[n]-(PrimePi[2*Prime[n]])-1, {n, 128}]
%o A065897 (PARI) { for (n=1, 1000, f=2*prime(n); a=f - primepi(f) - 1; write("b065897.txt", n, " ", a) ) } \\ _Harry J. Smith_, Nov 04 2009
%o A065897 (Magma)
%o A065897 A065897:= func< n | 2*NthPrime(n) -1 -#PrimesUpTo(2*NthPrime(n)) >;
%o A065897 [A065897(n): n in [1..130]]; // _G. C. Greubel_, Aug 24 2024
%o A065897 (SageMath)
%o A065897 def A065897(n): return 2*nth_prime(n) -prime_pi(2*nth_prime(n)) -1
%o A065897 [A065897(n) for n in range(1,131)] # _G. C. Greubel_, Aug 24 2024
%Y A065897 Cf. A000720, A002110, A002808, A036691, A100484 (even semiprimes).
%K A065897 nonn,easy
%O A065897 1,2
%A A065897 _Labos Elemer_, Nov 28 2001