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.

Previous Showing 11-12 of 12 results.

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

Original entry on oeis.org

7, 11, 23, 31, 47, 59, 67, 83, 97, 109, 137, 149, 167, 179, 197, 211, 233, 269, 331, 347, 353, 367, 389, 419, 431, 439, 587, 617, 739, 751, 829, 859, 907, 919, 977, 991, 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
Offset: 1

Views

Author

Antonio Gimenez, Jul 11 2015

Keywords

Examples

			There are two composite numbers less than 7, namely, 4 and 6, and 2 is prime. Therefore 7 is a member of the sequence.
		

Crossrefs

Cf. A072677.

Programs

  • Maple
    c:= proc(n) option remember; `if`(n<4, 0,
          c(n-1)+`if`(isprime(n-1), 0, 1))
        end:
    a:= proc(n) option remember; local p;
          p:= `if`(n=1, 1, a(n-1));
          do p:= nextprime(p);
             if isprime(c(p)) then break fi
          od; p
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jul 23 2015
  • Mathematica
    fQ[n_]:=PrimeQ[n-PrimePi[n]-1];Select[Prime[Range@400],fQ[#]&] (* Ivan N. Ianakiev, Jul 12 2015 *)
  • PARI
    is_ok(n)=my(i,k=0); for(i=2,n-1,if(bigomega(i)>1,k++)); isprime(k)&&isprime(n);
    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
    
  • PARI
    listp(nn)=forprime(p=2, nn, if (isprime(p - primepi(p) - 1), print1(p, ", "));); \\ Michel Marcus, Aug 27 2016
    
  • 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

Extensions

a(16)-a(61) from Ivan N. Ianakiev, Jul 12 2015

A275989 a(n) = prime(prime(n)+1) - prime(n).

Original entry on oeis.org

3, 4, 8, 12, 26, 30, 44, 52, 66, 84, 100, 126, 140, 150, 176, 198, 222, 232, 270, 288, 300, 330, 350, 374, 424, 456, 466, 486, 492, 506, 592, 612, 650, 670, 714, 730, 772, 808, 830, 860, 890, 910, 972, 988, 1016, 1024, 1090, 1200, 1212, 1222, 1248, 1272, 1290, 1350, 1370, 1430, 1464
Offset: 1

Views

Author

Terry D. Grant, Aug 15 2016

Keywords

Examples

			For n=3, prime(prime(3)+1) = 13, and prime(3) = 5, therefore a(3) = 13 - 5 = 8.
		

Crossrefs

Programs

  • Mathematica
    Table[Prime[Prime[n]+1] - Prime[n], {n, 1, 100}]
  • PARI
    a(n) = prime(prime(n)+1) - prime(n); \\ Michel Marcus, Aug 18 2016

Formula

a(n) = A000040(A008864(n)) - A000040(n) = A072677(n) - A000040(n).
Previous Showing 11-12 of 12 results.