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-6 of 6 results.

A320703 Indices of primes followed by a gap (distance to next larger prime) of 10.

Original entry on oeis.org

34, 42, 53, 61, 68, 80, 82, 101, 106, 115, 125, 127, 138, 141, 145, 157, 172, 175, 177, 191, 193, 204, 222, 233, 258, 266, 269, 279, 289, 306, 308, 310, 316, 324, 369, 383, 397, 399, 403, 418, 422, 431, 443, 474, 491, 497, 500, 502, 518, 525, 531, 535, 575
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes given in A031928.

Crossrefs

Equals A000720 o A031928.
Row 5 of A174349.
Indices of 10's in A001223.
Subsequence of A107730: prime(n+1) ends in same digit as prime(n).
Cf. A029707, A029709, A320701, A320702, ..., A320720 (analog for gaps 2, 4, 6, 8, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

Formula

a(n) = A000720(A031928(n)).
A320703 = { i > 0 | prime(i+1) = prime(i) + 10 }.

A320708 Indices of primes followed by a gap (distance to next larger prime) of 20.

Original entry on oeis.org

154, 259, 442, 480, 548, 753, 777, 783, 876, 971, 1035, 1066, 1095, 1106, 1147, 1254, 1277, 1302, 1337, 1345, 1355, 1381, 1396, 1400, 1423, 1438, 1562, 1592, 1613, 1662, 1669, 1808, 1955, 2016, 2043, 2081, 2116, 2129, 2147, 2226, 2302, 2307, 2387, 2517, 2547, 2563, 2694, 2724, 2745, 2755, 2766
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A031938.

Crossrefs

Equals A000720 o A031938.
Row 10 of A174349.
Subsequence of A107730 (prime(n+1) ends in same digit as prime(n)).
Indices of 20's in A001223.
Cf. A029707, A029709, A320701, A320702, ..., A320720 (analog for gaps 2, 4, 6, 8, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

  • Magma
    [n: n in [1..3000] | NthPrime(n+1) - NthPrime(n) eq 20]; // Vincenzo Librandi, Mar 22 2019
  • Mathematica
    Select[Range[3000], Prime[#] + 20 == Prime[# + 1] &] (* Vincenzo Librandi, Mar 22 2019 *)
  • PARI
    A(N=100,g=20,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)} \\ returns the list of first N terms of the sequence
    

Formula

a(n) = A000720(A031938(n)).
A320708 = { i > 0 | prime(i+1) = prime(i) + 20 } = A001223^(-1)({20}).

A320713 Indices of primes followed by a gap (distance to next larger prime) of 30.

Original entry on oeis.org

590, 650, 708, 757, 842, 890, 928, 985, 1006, 1051, 1108, 1556, 1570, 1648, 1650, 1675, 1754, 1900, 1919, 2027, 2125, 2149, 2321, 2391, 2397, 2429, 2631, 2637, 2699, 2781, 2866, 2918, 2989, 2993, 3010, 3085, 3153, 3207, 3315, 3340, 3350, 3373, 3420, 3511, 3551, 3580, 3637, 3751, 3777, 3948
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A124596.

Crossrefs

Equals A000720 o A124596.
Indices of 30's in A001223.
Row 15 of A174349.
Subsequence of A107730 (prime(n+1) ends in same digit as prime(n)).
Cf. A029707, A029709, A320701, A320702, ..., A320720 (analog for gaps 2, 4, 6, 8, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

  • PARI
    A(N=100,g=30,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)} \\ returns the list of first N terms of the sequence

Formula

a(n) = A000720(A124596(n)).
A320713 = { i>0 | prime(i+1) = prime(i) + 30 } = A001223^(-1)({30}).

A320718 Indices of primes followed by a gap (distance to next larger prime) of 40.

Original entry on oeis.org

2191, 2344, 2524, 2788, 3562, 4058, 4677, 5030, 5349, 6076, 6145, 6256, 6320, 6442, 6454, 6902, 7232, 7488, 8119, 8152, 8245, 8366, 8553, 8567, 8591, 8746, 9260, 9361, 10536, 10735, 11095, 11407, 11534, 11781, 12227, 12312, 12663, 12815, 12940, 13015, 13333, 13676, 13873, 14065, 14123
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A126721.

Crossrefs

Equals A000720 o A126721.
Row 20 of A174349.
Subsequence of A107730 (prime(n+1) ends in same digit as prime(n)).
Indices of 40's in A001223.
Cf. A029707, A029709, A320701, A320702, ..., A320720 (analog for gaps 2, 4, 6, 8, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

  • PARI
    A(N=100,g=40,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)} \\ returns the list of first N terms of the sequence

Formula

a(n) = A000720(A126721(n)).
A320718 = { i > 0 | prime(i+1) = prime(i) + 40 } = A001223^(-1)({40}).

A371390 Numbers k such that prime(k), prime(k+1), prime(k+2), prime(k+3) and prime(k+4) all have the same last digit.

Original entry on oeis.org

11582, 17385, 19317, 20579, 22931, 42098, 51895, 52252, 55259, 60393, 62192, 62193, 62680, 64050, 65324, 71483, 76391, 76773, 76805, 77052, 81139, 86711, 95661, 100208, 102032, 113646, 113892, 113954, 115251, 124227, 125218, 125586, 144165, 144299, 147619, 147620
Offset: 1

Views

Author

Michel Lagneau, Mar 20 2024

Keywords

Examples

			11582 is a term because prime(11582) = 123229, prime(11583) = 123239, prime(11584) = 123259, prime(11585) = 123269 with the same last digit 9.
		

Crossrefs

Programs

  • Maple
    nn:=15*10^4:d:=array(1..5):
    for n from 1 to nn do:
     for k from 1 to 5 do:
       d[k]:=irem(ithprime(n+k-1),10):
     od:
      if d[1]=d[2] and d[1]=d[3] and
    d[1]=d[4] and d[1]=d[5]
        then
         printf(`%d, `,n):
        else
      fi:
    od:
  • PARI
    \\ See PARI link
    
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A371390_gen(): # generator of terms
        xlist, p = [2, 3, 5, 7, 1], 11
        for k in count(1):
            if len(set(xlist)) == 1:
                yield k
            p = nextprime(p)
            xlist = xlist[1:]+[p%10]
    A371390_list = list(islice(A371390_gen(),10)) # Chai Wah Wu, Apr 13 2024

A371403 Least k such that prime(k), prime(k+1), prime(k+2), ..., prime(k+n) all have the same last digit.

Original entry on oeis.org

34, 258, 2147, 11582, 62192, 274810, 1500309, 2235294, 10919138, 24000612, 3074210315, 6244442805, 6244442805, 143338476264, 244844614858
Offset: 1

Views

Author

Michel Lagneau, Mar 21 2024

Keywords

Comments

The interest in studying a sequence of n consecutive prime numbers having the same last digit is to look at the behavior of the rarefaction of these numbers when n becomes large.
a(k) > 10^10 for k >= 14. - David A. Corneth, Mar 22 2024

Examples

			a(1) = A107730(1) = 34 because prime(34) = 139, prime(35) = 149, both end with the digit 9, and no two consecutive smaller primes end with the same digit.
a(2) = 258 because prime(258) = 1627, prime(259) = 1637, prime(260) = 1657 with the same last digit 7, and no three consecutive smaller primes have the same last digit.
a(4) = A371390(1).
		

Crossrefs

Programs

  • Maple
    nn:=15*10^6:
    for n from 2 to 7 do :
       ii:=0:d:=array(1..n):
      for m from 1 to nn while(ii=0)
    do:
       lst:={}:
         for k from 1 to n do:
    d[k]:=irem(ithprime(m+k-1),10):
            lst:=lst union {d[k]}:
         od:
          if lst={d[1]}
           then
           printf(`%d %d \n`,n-1,m):ii:=1:
           else
          fi:
        od:
        od:
  • Mathematica
    a[n_] := Module[{v = Mod[Prime[Range[n + 1]], 10], k = 1, p}, p = Prime[n + 1]; While[! SameQ @@ v, p = NextPrime[p]; v = Join[Rest[v], {Mod[p, 10]}]; k++]; k]; Array[a, 6] (* Amiram Eldar, Mar 21 2024 *)
  • PARI
    upto(n) = {
    	n += 30;
    	my(res = List(), q = 2, t = 1, ld = 2, nld, streak = 0);
    	forprime(p = 3, oo,
    		nld = p%10;
    		if(nld == ld,
    			streak++;
    			if(streak > #res,
    				listput(res, t-streak+1);
    				print1(t-streak+1", ");
    			)
    		,
    			streak = 0
    		);
    		q = p;
    		ld = nld;
    		t++;
    		if(t > n,
    			return(res);
    		)
    	);
    	res
    } \\ David A. Corneth, Mar 23 2024

Extensions

a(7)-a(10) from Amiram Eldar, Mar 21 2024
a(11)-a(13) from David A. Corneth, Mar 22 2024
a(14) from Michael S. Branicky, May 15 2025
a(15) from Michael S. Branicky, May 21 2025
Showing 1-6 of 6 results.