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

A084560 Duplicate of A054681.

Original entry on oeis.org

2, 139, 1627, 18839, 123229, 776257, 3873011, 23884639, 36539311, 196943081
Offset: 1

Views

Author

Keywords

A380785 Smallest of two consecutive primes p and q, both ending with 1, such that q - p = 10n, or -1 if no such primes exist.

Original entry on oeis.org

181, 13421, 4831, 25261, 95651, 43331, 175141, 1060781, 404851, 1648081, 2597981, 6085441, 22151281, 10270451, 25180321, 79817581, 84549821, 135045091, 306099181, 529811591, 164710681, 707429491, 965524181, 391995431, 428045491, 1516828721, 4272226951, 2337682591
Offset: 1

Views

Author

Jean-Marc Rebert, Feb 03 2025

Keywords

Examples

			a(1) = 181, because 181 and 181 + 10 = 191 are two consecutive primes with the same last digit 1 and no smaller p has this property.
		

Crossrefs

Programs

  • PARI
    a(n) = my(p=11); while (!isprime(p) || ((nextprime(p+1)-p) != 10*n), p+=10); p; \\ Michel Marcus, Feb 20 2025

A057618 Initial prime in first sequence of n primes congruent to 1 modulo 5.

Original entry on oeis.org

11, 181, 4831, 22501, 216401, 2229971, 3873011, 36539311, 36539311, 196943081, 14293856441, 154351758091, 154351758091, 154351758091, 11992377039481, 41947964349971, 253931039382791, 253931039382791, 253931039382791
Offset: 1

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

a(20) > 4*10^14. - Giovanni Resta, Aug 04 2013

Examples

			a(6) = 2229971 because this number is the first in a sequence of 6 consecutive primes all of the form 5n + 1.
		

Crossrefs

Cf. A054681.

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k = n + 1}, While[ ! PrimeQ[ k ], k++ ]; Return[ k ] ]; PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; Return[ k ] ]; p = 0; Do[ a = Table[ -1, {n} ]; k = Max[ 1, p ]; While[ Union[ a ] != {1}, k = NextPrime[ k ]; a = Take[ AppendTo[ a, Mod[ k, 5 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 10} ]

Extensions

More terms from Jens Kruse Andersen, Jun 03 2006
a(15)-a(19) from Giovanni Resta, Aug 04 2013

A068150 First of n consecutive primes == 7 mod 10.

Original entry on oeis.org

7, 337, 1627, 57427, 192637, 776257, 15328637, 70275277, 244650317, 452942827, 452942827, 73712513057, 319931193737, 2618698284817, 10993283241587, 54010894438097, 101684513099627, 196948379177587
Offset: 1

Views

Author

Amarnath Murthy, Feb 24 2002

Keywords

Comments

The next set of consecutive primes includes numbers > 10000000. - Larry Reeves (larryr(AT)acm.org), Jun 14 2002
Same as A057626 except a(1). - Jens Kruse Andersen, Jun 03 2006

Examples

			a(3) = 1627 as it is the start of the first occurrence of the three consecutive prime 1627, 1637 and 1657 ending in 7.
		

Crossrefs

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 14 2002
More terms from Labos Elemer, Jun 16 2003
More terms from Enoch Haga, Jan 17 2004. a(12) is from Phil Carmody.
More terms from Jens Kruse Andersen, Jun 03 2006
a(15)-a(18) from Giovanni Resta, Aug 04 2013

A328452 Primes p such that p=prime(k), prime(k+1), and prime(k+2) end in the same digit.

Original entry on oeis.org

1627, 3089, 4297, 4831, 6481, 6793, 8543, 11027, 11867, 13421, 13649, 14177, 17509, 17807, 18839, 18859, 20359, 20411, 22501, 22511, 22963, 22973, 24923, 25189, 26449, 26459, 27367, 27541, 28309, 29443, 29453, 31081, 32203, 32381, 34919, 35171, 35281, 36343, 36353, 37087, 37223, 37243, 38923
Offset: 1

Views

Author

Philip Mizzi, Oct 15 2019

Keywords

Examples

			(p,q,r) = (1627,1637,1657), are three primes which are consecutive and end in the same digit. Hence, p=1627 is a member of this sequence.
		

Crossrefs

Programs

  • Magma
    f:=func; a:=[]; for p in PrimesUpTo(40000) do if f(p,1) or f(p,3) or f(p,7) or f(p,9) then Append(~a,p); end if; end for; a; // Marius A. Burtea, Oct 16 2019
    
  • Maple
    q:= 3: r:= 5: count:= 0: R:= NULL:
    while count < 100 do
       p:= q; q:= r; r:= nextprime(r);
       if p-q mod 10 = 0 and q-r mod 10 = 0 then count:= count+1; R:= R, p; fi
    od:
    R; # Robert Israel, May 08 2020
  • Mathematica
    First /@ Select[Partition[Prime@ Range@ 4105, 3, 1], Length@ Union@ Mod[#, 10] == 1 &] (* Giovanni Resta, Oct 16 2019 *)
  • PARI
    isok(p) = {if (isprime(p), my(d = p % 10); my(q = nextprime(p+1), r = nextprime(q+1)); (d == (q % 10)) && (d == (r % 10)););} \\ Michel Marcus, Oct 17 2019

A329594 Earliest occurrences of n consecutive primes ending in the same decimal digit, written as triangle T(n,k), 1<=k<=n.

Original entry on oeis.org

2, 139, 149, 1627, 1637, 1657, 18839, 18859, 18869, 18899, 123229, 123239, 123259, 123269, 123289, 776257, 776267, 776287, 776317, 776327, 776357, 3873011, 3873041, 3873061, 3873071, 3873091, 3873101, 3873151, 23884639, 23884669, 23884699, 23884709, 23884739, 23884759, 23884769, 23884799
Offset: 1

Views

Author

Hugo Pfoertner, Nov 17 2019

Keywords

Comments

The n-th row of the table starts with A054681(n).

Examples

			The triangle begins:
        2;
      139,     149;
     1627,    1637,    1657;
    18839,   18859,   18869,   18899;
   123229,  123239,  123259,  123269,  123289;
   776257,  776267,  776287,  776317,  776327,  776357;
		

Crossrefs

Cf. A054681.

A382927 Smallest beginning of a sequence of exactly n consecutive palindromic primes, all ending with the same digit.

Original entry on oeis.org

2, 181, 151, 131, 101, 11, 17471, 16661, 16561, 16361, 16061, 15551, 15451, 14741, 14341, 13931, 13831, 13331, 12821, 12721, 12421, 11411, 11311, 10601, 10501, 10301, 1884881, 1883881, 1881881, 1880881, 1879781, 1878781, 1876781, 1865681, 1856581, 1853581, 1851581
Offset: 1

Views

Author

Jean-Marc Rebert, Apr 13 2025

Keywords

Examples

			a(6) = 11, because 11 initiates a sequence of exactly six consecutive palindromic primes: 11, 101, 131, 151, 181 and 191, each ending in the same digit 1.
		

Crossrefs

Programs

  • Maple
    # with A002385 e.g. from the b-file for that sequence
    R:= NULL:
    d:= 2: count:= 1: m:= 1;
    for i from 2 while m < 100 do
      dp:= A002385[i] mod 10;
      if d = dp then count:= count+1
      else
        d:= dp;
        if count >= m then
          R:= R, seq(A002385[i-j],j=m..count);
          m:= count+1;
        fi;
        count:= 1;
      fi
    od:
    R; # Robert Israel, May 13 2025
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def palprimes(): # generator of palprimes
        yield from [2, 3, 5, 7, 11]
        for d in count(3, 2):
            for last in "1379":
                for p in product("0123456789", repeat=d//2-1):
                    left = "".join(p)
                    for mid in [[""], "0123456789"][d&1]:
                        t = int(last + left + mid + left[::-1] + last)
                        if isprime(t):
                            yield t
    def agen(): # generator of terms
        adict, n, lastdigit, vlst = dict(), 1, 0, [2]
        for p in palprimes():
            if p%10 == lastdigit:
                vlst.append(p)
            else:
                if len(vlst) >= n:
                    for i in range(n, len(vlst)+1):
                        if i not in adict:
                            adict[i] = vlst[-i]
                    while n in adict: yield adict[n]; n += 1
                lastdigit, vlst = p%10, [p]
    print(list(islice(agen(), 40))) # Michael S. Branicky, Apr 13 2025

A057636 Initial prime in first sequence of n primes congruent to 4 modulo 5. The first prime in a sequence of length n all ending with the digit 9.

Original entry on oeis.org

19, 139, 3089, 18839, 123229, 2134519, 12130109, 23884639, 363289219, 9568590299, 24037796539, 130426565719, 405033487139, 3553144754209, 4010803176619, 71894236537009, 71894236537009
Offset: 1

Views

Author

Robert G. Wilson v, Oct 10 2000

Keywords

Examples

			a(5) = 123229 because this number is the first in a sequence of 5 consecutive primes all of the form 5n + 4.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k = n + 1}, While[ ! PrimeQ[ k ], k++ ]; Return[ k ] ]; PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; Return[ k ] ]; p = 0; Do[ a = Table[ -1, {n} ]; k = Max[ 1, p ]; While[ Union[ a ] != {4}, k = NextPrime[ k ]; a = Take[ AppendTo[ a, Mod[ k, 5 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 9} ]

Extensions

Phil Carmody gives a(15)= 4010803176619 in A054681
More terms from Jens Kruse Andersen, Jun 03 2006
a(16)-a(17) from Giovanni Resta, Aug 01 2013

A366310 First of a sequence of exactly n consecutive primes whose squares have the same last digit.

Original entry on oeis.org

2, 13, 43, 157, 401, 2969, 7237, 30697, 57397, 68239, 576019, 967019, 225769, 6590069, 10942949, 21235127, 57401779, 186564317, 154836067, 117219967, 2598759227, 7470538489, 28594410847, 59107046659, 240456558467, 34511350409, 193861351357, 249423946921, 368059259143
Offset: 1

Views

Author

Robert Israel and the late J. M. Bergot, Oct 06 2023

Keywords

Comments

a(n) > 4.5*10^11 for n >= 30. - David A. Corneth, Oct 07 2023

Examples

			a(3) = 43 because the 3 consecutive primes 43, 47, 53 all have squares ending in 9, while the primes 41 and 59 preceding 43 and following 53 have squares ending in 1.
		

Crossrefs

Cf. A054681.

Programs

  • Maple
    N:= 16: # for a(1) .. a(N)
    V:= Vector(N):
    p:= 2: q:= 2: count:= 0: d:= 4: i:= 1:
    while count < N do
      p:= nextprime(p);
      if p^2 mod 10 <> d then
        if i <= N and V[i] = 0 then
          V[i]:= q; count:= count+1;
        fi;
        q:= p; i:= 1; d:= p^2 mod 10;
      else
        i:= i+1;
      fi
    od:
    convert(V,list);
  • PARI
    upto(n) = {
    	my(res = [], ld = 4, streak = 1);
    	forprime(p = 3, n,
    		nd = p^2 % 10;
    		if(nd == ld,
    			streak++
    		,
    			if(streak > #res,
    				res = concat(res, vector(streak - #res, i, oo))
    			);
    			if(res[streak] == oo,
    				c = p;
    				for(i = 1, streak,
    					c = precprime(c-1);
    				);
    				res[streak] = c;
    			);
    			streak = 1;
    		);
    		ld = nd
    	); res
    } \\ David A. Corneth, Oct 07 2023

Extensions

More terms from David A. Corneth, Oct 07 2023
Showing 1-9 of 9 results.