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.

A166744 Unlucky primes: numbers which are members of both A000040 (primes) and A050505 (unlucky).

This page as a plain text file.
%I A166744 #21 Sep 04 2020 10:34:47
%S A166744 2,5,11,17,19,23,29,41,47,53,59,61,71,83,89,97,101,103,107,109,113,
%T A166744 131,137,139,149,157,167,173,179,181,191,197,199,227,229,233,239,251,
%U A166744 257,263,269,271,277,281,293,311,313,317,337,347,353,359,373,379,383,389
%N A166744 Unlucky primes: numbers which are members of both A000040 (primes) and A050505 (unlucky).
%C A166744 There are infinitely many unlucky prime numbers, in particular all those of the form 6n - 1, eliminated in the second step of Ulam's procedure for lucky numbers. - _Davide Rotondo_, Aug 31 2020
%H A166744 Robert Israel, <a href="/A166744/b166744.txt">Table of n, a(n) for n = 1..10000</a>
%p A166744 L:= [seq(2*i+1, i=0..10^3)]:
%p A166744 for n from 2 while n < nops(L) do
%p A166744   r:= L[n];
%p A166744   L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);
%p A166744 od:
%p A166744 U:= {2, seq(i,i=3..2*10^3+1,2)} minus convert(L,set):
%p A166744 sort(convert(select(isprime,U),list)); # _Robert Israel_, Jul 26 2019
%o A166744 (SageMath)
%o A166744 # Copy from  A000959 - (Robert FERREOL, Nov 19 2014)
%o A166744 def lucky(n):
%o A166744   L=list(range(1, n+1, 2)); j=1
%o A166744   while L[j] <= len(L)-1:
%o A166744     L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]
%o A166744     j+=1
%o A166744   return(L)
%o A166744 [ p for p in prime_range(1000) if p not in lucky(1000) ] # _Hauke Löffler_, Jul 26 2019
%Y A166744 Cf. A007528, A031157 (lucky primes).
%K A166744 nonn
%O A166744 1,1
%A A166744 Gabriel Finch (salsaman(AT)xs4all.nl), Oct 21 2009