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.

Showing 1-8 of 8 results.

A115095 Positions of 4's in A038800 with offset 1.

Original entry on oeis.org

1, 2, 11, 20, 83, 149, 188, 209, 326, 347, 566, 944, 1301, 1565, 1574, 1607, 1805, 1892, 1943, 2102, 2228, 2531, 3173, 3485, 4379, 5135, 5534, 6299, 6722, 6950, 7223, 7727, 7970, 8105, 8273, 8882, 9785, 9914, 10112, 10985, 11654, 11930, 12221, 13547
Offset: 1

Views

Author

Zak Seidov, Mar 01 2006

Keywords

Comments

Starting with a(2)=2, numbers m such that 10*(m-1)+{1,3,7,9} are all primes.
Essentially the same as A064975. - R. J. Mathar, Aug 11 2008

Examples

			11 is a term because 10*(11-1)+{1,3,7,9} = 101,103,107,109 are all prime.
		

References

  • 4 is the maximum possible number of primes between 10*n and 10*(n+1).

Crossrefs

Cf. A064975 (essentially the same).
Cf. A038800 (number of primes between 10*n and 10*n+9).
Cf. A007811.

Programs

  • Mathematica
    Join[{1}, Select[Range[2, 15000, 3], AllTrue[10*# - {1, 3, 7, 9}, PrimeQ] &]] (* Paolo Xausa, Jul 15 2025 *)

Formula

a(1) = 1; for n >= 2, a(n) = A007811(n-1) + 1. - Paolo Xausa, Jul 15 2025

Extensions

Name edited by Paolo Xausa, Jul 20 2025

A173037 Numbers k such that k-4, k-2, k+2 and k+4 are prime.

Original entry on oeis.org

9, 15, 105, 195, 825, 1485, 1875, 2085, 3255, 3465, 5655, 9435, 13005, 15645, 15735, 16065, 18045, 18915, 19425, 21015, 22275, 25305, 31725, 34845, 43785, 51345, 55335, 62985, 67215, 69495, 72225, 77265, 79695, 81045, 82725, 88815, 97845
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 07 2010

Keywords

Comments

Average k of the four primes in two twin prime pairs (k-4, k-2) and (k+2, k+4) which are linked by the cousin prime pair (k-2, k+2).
All terms are odd composites; except for a(1) they are multiples of 5.
Subsequence of A087679, of A087680 and of A164385.
All terms except for a(1) are multiples of 15. - Zak Seidov, May 18 2014
One of (k-1, k, k+1) is always divisible by 7. - Fred Daniel Kline, Sep 24 2015
Terms other than a(1) must be equivalent to 1 mod 2, 0 mod 3, 0 mod 5, and 0,+/-1 mod 7. Taken together, this requires terms other than a(1) to have the form 210k+/-15 or 210k+105. However, not all numbers of that form belong to this sequence. - Keith Backman, Nov 09 2023

Examples

			9 is a term because 9-4 = 5 is prime, 9-2 = 7 is prime, 9+2 = 11 is prime and 9+4 = 13 is prime.
		

Crossrefs

Programs

  • Magma
    [ p+4: p in PrimesUpTo(100000) | IsPrime(p) and IsPrime(p+2) and IsPrime(p+6) and IsPrime(p+8) ]; // Klaus Brockhaus, Feb 09 2010
    
  • Mathematica
    Select[Range[100000],AllTrue[#+{4,2,-2,-4},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 30 2015 *)
  • PARI
    is(n)=isprime(n-4) && isprime(n-2) && isprime(n+2) && isprime(n+4) \\ Charles R Greathouse IV, Sep 24 2015
    
  • Python
    from sympy import primerange
    def aupto(limit):
        p, q, r, alst = 2, 3, 5, []
        for s in primerange(7, limit+5):
            if p+2 == q and p+6 == r and p+8 == s: alst.append(p+4)
            p, q, r = q, r, s
        return alst
    print(aupto(10**5)) # Michael S. Branicky, Feb 03 2022

Formula

For n >= 2, a(n) = 15*A112540(n-1). - Michel Marcus, May 19 2014
From Jeppe Stig Nielsen, Feb 18 2020: (Start)
For n >= 2, a(n) = 30*A014561(n-1) + 15.
For n >= 2, a(n) = 10*A007811(n-1) + 5.
a(n) = A007530(n) + 4.
a(n) = A125855(n) + 5. (End)

Extensions

Edited and extended beyond a(9) by Klaus Brockhaus, Feb 09 2010

A214342 Count of the decimal descendants of the n-th prime.

Original entry on oeis.org

23, 22, 11, 23, 1, 14, 4, 40, 15, 6, 7, 13, 1, 14, 5, 0, 9, 16, 11, 4, 15, 1, 1, 0, 3, 10, 28, 0, 12, 0, 8, 1, 1, 9, 5, 1, 4, 1, 0, 2, 0, 6, 2, 5, 10, 19, 3, 5, 5, 6, 8, 5, 7, 0, 5, 3, 5, 8, 4, 1, 2, 5, 1, 2, 2, 0, 9, 5, 0, 7, 7, 2, 11, 9, 2, 2, 0, 0, 4, 28, 0, 7
Offset: 1

Views

Author

Alex Ratushnyak, Jul 12 2012

Keywords

Comments

Prime q is a decimal descendant of prime p if q = p*10+k and 0<=k<=9.
The number of direct decimal descendants is A038800(p).
a(n) is the total count of direct decimal descendants of the n-th prime that are also prime, plus their decimal descendants that are prime, and so on.
Conjecture: no terms bigger than 35 after a(8)=40.

Examples

			prime(3)=5 has eleven descendants: 53, 59, 593, 599, 5939, 59393, 59399, 593933, 593993, 5939333, 59393339. So a(3)=11. All candidates of the form 5nnn1 and 5nnn7 are divisible by 3.
prime(5)=11, the only decimal descendant of 11 that is prime is 113, and because there are no primes between 1130 and 1140, a(5)=1.
		

Crossrefs

Programs

  • Maple
    A214342 := proc(n)
        option remember;
        local a,p,k,d ;
        a := 0 ;
        p := ithprime(n) ;
        for k from 0 to 9 do
            d := 10*p+k ;
            if isprime(d) then
                a := a+1+procname(numtheory[pi](d)) ;
            end if;
        end do:
        return a;
    end proc: # R. J. Mathar, Jul 19 2012
  • Mathematica
    Table[t = {Prime[n]}; cnt = 0; While[t = Select[Flatten[Table[10*i + {1, 3, 7, 9}, {i, t}]], PrimeQ]; t != {}, cnt = cnt + Length[t]]; cnt, {n, 100}] (* T. D. Noe, Jul 24 2012 *)

A298008 a(n) = f(n-1,n) + 10*(n-1), where f(a,b) is the number of primes in the range [10*a,10*b].

Original entry on oeis.org

4, 14, 22, 32, 43, 52, 62, 73, 82, 91, 104, 111, 121, 133, 141, 152, 162, 172, 181, 194, 200, 211, 223, 232, 241, 252, 262, 272, 282, 291, 301, 313, 320, 332, 342, 352, 361, 372, 382, 391, 402, 411, 421, 433, 442, 451, 463, 471, 481, 492, 502, 510, 522, 530, 542, 551, 562, 572, 581, 592, 602, 613, 620, 631, 643
Offset: 1

Views

Author

Luis F.B.A. Alexandre, Jan 10 2018

Keywords

Examples

			The first term has the number of prime numbers between 0 and 9: 4. Since the numbers in this first range are smaller than 10, the left digit would be a zero (not represented). The second term has the number of prime numbers between 10 and 19 (4) and since it was counted in the range between 10 and 19 it represents this range with the one in the first digit in the left: 14. The third element is 22 as there are 2 primes between 20 and 29. And so on. Larger element: there is only one prime between 120 and 129, hence a(13)=121.
		

Crossrefs

Cf. A038800.

Programs

  • Mathematica
    Block[{p = 1, k}, k = 10^p; Array[Apply[Subtract, PrimePi[{k #, k (# - 1)}]] + (# - 1) k &, 67]] (* Michael De Vlieger, Jan 11 2018 *)
  • Python
    # Generates all elements of the sequence smaller than 'last'
    last = 1000
    p=[2]
    c=1
    for i in range(3,last+2,2):
        prime = True
        for j in p:
            if i%j == 0:
                prime=False;
                break;
        if prime:
            p.append(i)
            c = c + 1
        ii = (i//10)*10
        if i-ii == 1:
            if prime:
                print(ii-10+c-1, end=',')
                c = 1
            else:
                print(ii-10+c, end=',')
                c = 0

Formula

a(n) = A038800(n-1) + 10*(n-1). - Michel Marcus, Jan 11 2018

Extensions

Edited by N. J. A. Sloane, Jan 28 2018

A342852 a(n) = A342068(10^n).

Original entry on oeis.org

2, 5, 5, 7, 8, 12, 33, 52, 93, 236, 479, 1265, 2782, 6650, 15539
Offset: 0

Views

Author

Jon E. Schoenfield, Mar 24 2021

Keywords

Comments

In the table in the Example section, the numbers in the columns for n = 0..9 are the first a(n) terms of A010051, A038800, A038822, ..., A038829, respectively; each column ends at the first term that is greater than the term above it.
a(n) >= a(n-1)/10. - Chai Wah Wu, Mar 25 2021

Examples

			Number of primes in the interval [(k-1)*10^n + 1, k*10^n]:
.
   k\n| 0 1  2   3    4    5     6      7       8        9
  ----+---------------------------------------------------
    1 | 0 4 25 168 1229 9592 78498 664579 5761455 50847534
    2 | 1 4 21 135 1033 8392 70435 606028 5317482 47374753
    3 |   2 16 127  983 8013 67883 587252 5173388 46227250
    4 |   2 16 120  958 7863 66330 575795 5084001 45512275
    5 |   3 17 119  930 7678 65367 567480 5019541 44992411
    6 |        114  924 7560 64336 560981 4968836 44591145
    7 |        117  878 7445 63799 555949 4928228 44258984
    8 |             902 7408 63129 551318 4893248 43979302
    9 |                 7323 62712 547572 4863036 43739541
   10 |                 7224 62090 544501 4838319 43529316
   11 |                 7216 61938 541854 4814936 43336106
   12 |                 7224 61543 538339 4792235 43167234
   13 |                      61192 536539 4773628 43014349
   14 |                      60825 534012 4757140 42870136
   15 |                      60627 532197 4741055 42740180
  ... |                        ...    ...     ...      ...
   32 |                      57836 510685 4572164 41368791
   33 |                      57852 510269 4565024 41316074
  ... |                               ...     ...      ...
   51 |                            498385 4475770 40575830
   52 |                            498435 4472349 40547028
  ... |                                       ...      ...
   92 |                                   4357534 39621606
   93 |                                   4360247 39603089
  ... |                                                ...
  235 |                                           38196269
  236 |                                           38197686
		

Crossrefs

Extensions

a(10)-a(12) from Chai Wah Wu, Mar 25 2021
a(13)-a(14) from Chai Wah Wu, Mar 31 2021

A108216 Number of semiprimes between 10n and 10n + 9.

Original entry on oeis.org

3, 3, 4, 5, 2, 4, 3, 2, 4, 4, 1, 4, 4, 2, 5, 3, 3, 2, 3, 1, 6, 6, 2, 2, 2, 3, 3, 2, 2, 4, 5, 2, 5, 3, 2, 2, 3, 2, 3, 5, 2, 4, 2, 1, 3, 4, 2, 3, 4, 2, 3, 5, 3, 4, 3, 4, 3, 2, 4, 2, 0, 2, 4, 3, 1, 1, 3, 3, 4, 5, 3, 3, 2, 3, 3, 3, 3, 3, 3, 4, 3, 4, 0, 3, 4, 1, 4, 3, 2, 4, 2, 3, 4, 3, 2, 4, 2, 3, 3, 3, 3, 2, 1, 1, 5
Offset: 0

Views

Author

Giovanni Teofilatto, Jun 16 2005

Keywords

Comments

a(60) = a(82) = a(142) = 0. - Jonathan Vos Post, Jun 16 2005

Examples

			a(0) = 3 because between 0 and 9 there are three semiprimes: 4, 6 and 9.
a(1) = 3 because between 10 and 19 there are three semiprimes: 10, 14 and 15.
		

Crossrefs

Cf. A038800 number of primes between 10n and 10n+9.

Programs

  • Mathematica
    f[n_] := Sum[ PrimePi[n/Prime[i]] - (i - 1), {i, PrimePi[ Sqrt[n]]}]; Table[f[10n + 9] - f[Max[10n - 1, 0]], {n, 0, 104}] (* Robert G. Wilson v, Ray Chandler *)

Extensions

Edited and extended by Ray Chandler, Jul 07 2005

A271422 Concatenation of prime(n) and its square.

Original entry on oeis.org

24, 39, 525, 749, 11121, 13169, 17289, 19361, 23529, 29841, 31961, 371369, 411681, 431849, 472209, 532809, 593481, 613721, 674489, 715041, 735329, 796241, 836889, 897921, 979409, 10110201, 10310609, 10711449, 10911881, 11312769, 12716129, 13117161, 13718769
Offset: 1

Views

Author

Giovanni Teofilatto, Jul 13 2016

Keywords

Comments

All concatenations are divisible by the n-th prime.
a(n)/prime(n) gives a number of the form concatenate[(10^k)_prime(n)] for some k.
Subsequence of A053061.
Except for 24 and 525, a(n) have final decimal digit 1 or 9.

Examples

			For n=4, prime(4) = 7 (the fourth prime number) and 7^2 = 49. These are concatenated to get a(4) = 749. - _Michael B. Porter_, Jul 16 2016
		

Crossrefs

Cf. A001248 (primes squared), A030078 (primes cubed), A053061, A038800 (number of primes between 10n and 10n+9).

Programs

  • Maple
    seq(n*(n+10^(1+ilog10(n^2))), n=select(k->isprime(k),[$1..137])); # Peter Luschny, Jul 16 2016
  • Mathematica
    Table[FromDigits@ Flatten@ Map[IntegerDigits, {#, #^2}] &@ Prime@ n, {n, 33}] (* Michael De Vlieger, Jul 13 2016 *)
  • PARI
    a(n) = eval(Str(prime(n), prime(n)^2)) \\ Felix Fröhlich, Jul 14 2016

Formula

a(n) = Concatenate [prime(n)_A001248(n)].
a(n) = p*(p+10^A055642(p^2)) with p = prime(n). - Peter Luschny, Jul 17 2016

A346979 Count of the prime decimal descendants of n.

Original entry on oeis.org

83, 63, 23, 22, 23, 11, 29, 23, 3, 4, 54, 1, 9, 14, 6, 7, 3, 4, 7, 40, 0, 4, 19, 15, 8, 7, 10, 14, 5, 6, 2, 7, 0, 16, 9, 11, 12, 13, 4, 1, 34, 1, 8, 14, 5, 1, 13, 5, 5, 16, 6, 0, 9, 0, 24, 4, 6, 19, 2, 9, 25, 16, 0, 7, 4, 4, 3, 11, 2, 7, 7, 4, 1, 15, 2, 8, 8
Offset: 0

Views

Author

Ya-Ping Lu, Aug 09 2021

Keywords

Comments

The number of direct decimal descendants (i.e., decimal children) of n is A038800(n). The number of prime decimal descendants of the n-th prime is A214342(p_n). a(n) is the number of prime decimal descendants of n, which include the prime decimal children of n, the prime decimal children of the prime decimal children of n, and so on.
a(0) = Sum_{m=1..4} (A214342(m) + 1); a(1) = Sum_{m=5..8} (A214342(m) + 1).
a(A032352(m)) = 0; a(A119289(m)) = 0.
A214342 is a subset, as A214342(m) = a(prime(m)).
Conjecture 1: a(n) <= 83. Conjecture 2: lim_{n->oo} (n0/n) = 1, where n0 is the number of zero terms, a(k) = 0, for k <= n.

Examples

			a(4) = 23. The 23 prime decimal descendants of 4 are shown in the tree below.
       _____ 4__________________________
      /      |                          \
     41   ___43______________            47
    /    /   |               \             \
  419  431  433               439          479
            / \              /   \        /   \
        4337  4339         4391  4397   4793  4799
             /  |  \        |     |     /  \
        43391 43397 43399 43913 43973 47933 47939
                            |
                         439133
                            |
                        4391339
		

Crossrefs

Programs

  • Mathematica
    Table[Length@Rest@Flatten[FixedPointList[(b=#;Select[Flatten[(a=#;FromDigits/@(Join[IntegerDigits@a,{#}]&/@If[b=={0},Range@9,{1,3,7,9}]))&/@b],PrimeQ])&,{n}]],{n,0,76}] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
  • Python
    from sympy import isprime
    def p_count(k):
        global ct; d = [2, 3, 5, 7] if k == 0 else [1, 3, 7, 9]
        for i in range(4):
            m = 10*k + d[i]
            if isprime(m): ct += 1; p_count(m)
        return ct
    for n in range(100):
        ct = 0; print(p_count(n))
Showing 1-8 of 8 results.