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.

A087632 Number of n-digit primes ending in 7 in base 10.

Original entry on oeis.org

1, 5, 40, 262, 2103, 17210, 146590, 1274284, 11271819, 101051725, 915754298, 8372478663, 77114370790
Offset: 1

Views

Author

Meenakshi Srikanth (menakan_s(AT)yahoo.com) and Amarnath Murthy, Sep 15 2003

Keywords

Examples

			a(2) = 5 as there exist 5 two-digit prime numbers (17, 37, 47, 67, and 97) with units place 7.
a(3) = 40, since there are 40 three-digit numbers with units place digit as 7.
		

Crossrefs

Programs

  • Java
    /** The terms of the sequences are generated by changing the range for j for the various numbers of digits. E.g., it ranges from 100 to 999 for three-digit numbers. */
    float r, x;
    int c = 0, count = 0;
    for (float j = 100f; j < 1000f; j++) { for (float i = 2f; i < j; i++) { r = j % i; if (r == 0) c = 1; } if (c == 0) { x = j % 10; if (x == 7) count = count + 1; } c = 0; } System.out.println("count = " + count);
    
  • Mathematica
    Table[Length[Select[Range[10^n + 7, 10^(n + 1) - 3, 10], PrimeQ[#] &]], {n, 5}] (* Alonso del Arte, Apr 27 2014 *)
  • PARI
    a(n) = my(c=0); forprime(p=10^(n-1), 10^n, if(p%10==7, c++)); c \\ Iain Fox, Aug 07 2018

Formula

From Iain Fox, Aug 07 2018: (Start)
a(n) ~ (1/4) * Integral_{x=10^(n-1)..10^n} (dx/log(x)).
a(n) = A006879(n) - A087630(n) - A087631(n) - A087633(n), for n > 1.
(End)

Extensions

More terms from Ray Chandler, Oct 04 2003
Offset corrected by Iain Fox, Aug 07 2018
a(11) from Iain Fox, Aug 07 2018
a(12)-a(13) from Giovanni Resta, Aug 07 2018