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.

A255769 Primes p such that there are a prime number of composite numbers less than p.

This page as a plain text file.
%I A255769 #40 Nov 04 2018 13:26:48
%S A255769 7,11,23,31,47,59,67,83,97,109,137,149,167,179,197,211,233,269,331,
%T A255769 347,353,367,389,419,431,439,587,617,739,751,829,859,907,919,977,991,
%U A255769 1009,1031,1039,1063,1117,1171,1187,1237,1319,1327,1427,1447,1471,1499,1553,1567,1723,1901,1913,1933,2207,2221,2269,2293,2333
%N A255769 Primes p such that there are a prime number of composite numbers less than p.
%H A255769 Alois P. Heinz, <a href="/A255769/b255769.txt">Table of n, a(n) for n = 1..10000</a>
%e A255769 There are two composite numbers less than 7, namely, 4 and 6, and 2 is prime. Therefore 7 is a member of the sequence.
%p A255769 c:= proc(n) option remember; `if`(n<4, 0,
%p A255769       c(n-1)+`if`(isprime(n-1), 0, 1))
%p A255769     end:
%p A255769 a:= proc(n) option remember; local p;
%p A255769       p:= `if`(n=1, 1, a(n-1));
%p A255769       do p:= nextprime(p);
%p A255769          if isprime(c(p)) then break fi
%p A255769       od; p
%p A255769     end:
%p A255769 seq(a(n), n=1..100);  # _Alois P. Heinz_, Jul 23 2015
%t A255769 fQ[n_]:=PrimeQ[n-PrimePi[n]-1];Select[Prime[Range@400],fQ[#]&] (* _Ivan N. Ianakiev_, Jul 12 2015 *)
%o A255769 (PARI) is_ok(n)=my(i,k=0); for(i=2,n-1,if(bigomega(i)>1,k++)); isprime(k)&&isprime(n);
%o A255769 first(m)=my(i=1,v=vector(m),k=0);while(i<=m,if(is_ok(k), v[i]=k;i++);k++);v; \\ _Anders Hellström_, Jul 29 2015
%o A255769 (PARI) listp(nn)=forprime(p=2, nn, if (isprime(p - primepi(p) - 1), print1(p, ", "));); \\ _Michel Marcus_, Aug 27 2016
%o A255769 (PARI) list(lim)=my(v=List(),n=1); forprime(p=2,lim, if(isprime(p - n++), listput(v,p))); Vec(v) \\ _Charles R Greathouse IV_, Aug 28 2016
%Y A255769 Cf. A072677.
%K A255769 nonn
%O A255769 1,1
%A A255769 _Antonio Gimenez_, Jul 11 2015
%E A255769 a(16)-a(61) from _Ivan N. Ianakiev_, Jul 12 2015