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.

A104275 Numbers k such that 2k-1 is not prime.

This page as a plain text file.
%I A104275 #76 Aug 02 2024 15:58:59
%S A104275 1,5,8,11,13,14,17,18,20,23,25,26,28,29,32,33,35,38,39,41,43,44,46,47,
%T A104275 48,50,53,56,58,59,60,61,62,63,65,67,68,71,72,73,74,77,78,80,81,83,85,
%U A104275 86,88,89,92,93,94,95,98,101,102,103,104,105,107,108,109,110,111,113
%N A104275 Numbers k such that 2k-1 is not prime.
%C A104275 Same as A053726 except for the first term of this sequence.
%C A104275 Numbers k such that A064216(k) is not prime. - _Antti Karttunen_, Apr 17 2015
%C A104275 Union of 1 and terms of the form (u+1)*(v+1) + u*v with 1 <= u <= v. - _Ralf Steiner_, Nov 17 2021
%H A104275 Vincenzo Librandi (first 1000 terms) & Antti Karttunen, <a href="/A104275/b104275.txt">Table of n, a(n) for n = 1..10001</a>
%F A104275 a(n) = A047845(n-1) + 1.
%F A104275 For n > 1, a(n) = A053726(n-1) = n + A008508(n-1). - _Antti Karttunen_, Apr 17 2015
%F A104275 a(n) = (A014076(n)+1)/2. - _Robert Israel_, Apr 17 2015
%e A104275 a(1) = 1 because 2*1-1=1, not prime.
%e A104275 a(2) = 5 because 2*5-1=9, not prime (2, 3 and 4 give 3, 5 and 7 which are primes).
%e A104275 From _Vincenzo Librandi_, Jan 15 2013: (Start)
%e A104275 As a triangular array (apart from term 1):
%e A104275    5;
%e A104275    8,  13;
%e A104275   11,  18,  25;
%e A104275   14,  23,  32,  41;
%e A104275   17,  28,  39,  50,  61;
%e A104275   20,  33,  46,  59,  72,  85;
%e A104275   23,  38,  53,  68,  83,  98, 113;
%e A104275   26,  43,  60,  77,  94, 111, 128, 145;
%e A104275   29,  48,  67,  86, 105, 124, 143, 162, 181;
%e A104275   32,  53,  74,  95, 116, 137, 158, 179, 200, 221; etc.
%e A104275 which is obtained by (2*h*k + k + h + 1) with h >= k >= 1. (End)
%e A104275 The above array, which contains the same terms as A053726 but in different order and with some duplicates, has its own entry A144650. - _Antti Karttunen_, Apr 17 2015
%p A104275 remove(t -> isprime(2*t-1), [$1..1000]); # _Robert Israel_, Apr 17 2015
%t A104275 Select[Range[115], !PrimeQ[2#-1] &] (* _Robert G. Wilson v_, Apr 18 2005 *)
%o A104275 (Magma) [n: n in [1..220]| not IsPrime(2*n-1)]; // _Vincenzo Librandi_, Jan 28 2011
%o A104275 (Scheme) (define (A104275 n) (if (= 1 n) 1 (A053726 (- n 1)))) ;; More code in A053726. - _Antti Karttunen_, Apr 17 2015
%o A104275 (Python)
%o A104275 from sympy import isprime
%o A104275 def ok(n): return not isprime(2*n-1)
%o A104275 print(list(filter(ok, range(1, 114)))) # _Michael S. Branicky_, May 08 2021
%o A104275 (Python)
%o A104275 from sympy import primepi
%o A104275 def A104275(n):
%o A104275     if n <= 2: return ((n-1)<<2)+1
%o A104275     m, k = n-1, (r:=primepi(n-1)) + n - 1 + (n-1>>1)
%o A104275     while m != k:
%o A104275         m, k = k, (r:=primepi(k)) + n - 1 + (k>>1)
%o A104275     return r+n-1 # _Chai Wah Wu_, Aug 02 2024
%o A104275 (PARI) select( {is_A104275(n)=!isprime(n*2-1)}, [1..115]) \\ _M. F. Hasler_, Aug 02 2022
%o A104275 (SageMath) [n for n in (1..250) if not is_prime(2*n-1)] # _G. C. Greubel_, Oct 17 2023
%Y A104275 Cf. A006254 (complement), A246371 (a subsequence).
%Y A104275 Cf. A005097, A008508, A014076, A047845, A053726, A064216, A144650.
%K A104275 easy,nonn
%O A104275 1,2
%A A104275 _Alexandre Wajnberg_, Apr 17 2005
%E A104275 More terms from _Robert G. Wilson v_, Apr 18 2005