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-10 of 35 results. Next

A007811 Numbers k for which 10k+1, 10k+3, 10k+7 and 10k+9 are primes.

Original entry on oeis.org

1, 10, 19, 82, 148, 187, 208, 325, 346, 565, 943, 1300, 1564, 1573, 1606, 1804, 1891, 1942, 2101, 2227, 2530, 3172, 3484, 4378, 5134, 5533, 6298, 6721, 6949, 7222, 7726, 7969, 8104, 8272, 8881, 9784, 9913, 10111, 10984, 11653, 11929, 12220, 13546, 14416, 15727
Offset: 1

Views

Author

N. J. A. Sloane and J. H. Conway, Mar 15 1996

Keywords

Crossrefs

Programs

  • Haskell
    a007811 n = a007811_list !! (n-1)
    a007811_list = map (pred . head) $ filter (all (== 1) . map a010051') $
       iterate (zipWith (+) [10, 10, 10, 10]) [1, 3, 7, 9]
    -- Reinhard Zumkeller, Jul 18 2014
    
  • Magma
    [n: n in [0..10000] | forall{10*n+r: r in [1,3,7,9] | IsPrime(10*n+r)}]; // Bruno Berselli, Sep 04 2012
    
  • Maple
    for n from 1 to 10000 do m := 10*n: if isprime(m+1) and isprime(m+3) and isprime(m+7) and isprime(m+9) then print(n); fi: od: quit
  • Mathematica
    Select[ Range[ 1, 10000, 3 ], PrimeQ[ 10*#+1 ] && PrimeQ[ 10*#+3 ] && PrimeQ[ 10*#+7 ] && PrimeQ[ 10*#+9 ]& ]
    Select[Range[15000], And @@ PrimeQ /@ ({1, 3, 7, 9} + 10#) &] (* Ray Chandler, Jan 12 2007 *)
  • PARI
    p=2;q=3;r=5;forprime(s=7,1e5,if(s-p==8 && r-p==6 && q-p==2 && p%10==1, print1(p", ")); p=q;q=r;r=s) \\ Charles R Greathouse IV, Mar 21 2013
    
  • Perl
    use ntheory ":all"; my @s = map { ($-1)/10 } sieve_prime_cluster(10,1e9, 2,6,8); say for @s; # _Dana Jacobsen, May 04 2017

Formula

a(n) = 3*A014561(n) + 1. - Zak Seidov, Sep 21 2009

A068695 Smallest number (not beginning with 0) that yields a prime when placed on the right of n.

Original entry on oeis.org

1, 3, 1, 1, 3, 1, 1, 3, 7, 1, 3, 7, 1, 9, 1, 3, 3, 1, 1, 11, 1, 3, 3, 1, 1, 3, 1, 1, 3, 7, 1, 17, 1, 7, 3, 7, 3, 3, 7, 1, 9, 1, 1, 3, 7, 1, 9, 7, 1, 3, 13, 1, 23, 1, 7, 3, 1, 7, 3, 1, 3, 11, 1, 1, 3, 1, 3, 3, 1, 1, 9, 7, 3, 3, 1, 1, 3, 7, 7, 9, 1, 1, 9, 19, 3, 3, 7, 1, 23, 7, 1, 9, 7, 1, 3, 7, 1, 3, 1, 9, 3, 1
Offset: 1

Views

Author

Amarnath Murthy, Mar 03 2002

Keywords

Comments

Max Alekseyev (see link) shows that a(n) always exists. Note that although his argument makes use of some potentially large constants (see the comments in A060199), the proof shows that a(n) exists for all n. - N. J. A. Sloane, Nov 13 2020
Many numbers become prime by appending a one-digit odd number. Some numbers (such as 20, 32, 51, etc.) require a 2-digit odd number (A032352 has these). In the first 100000 values of n there are only 22 that require a 3-digit odd number (A091089). There probably are some values that require odd numbers of 4 or more digits, but these are likely to be very large. - Chuck Seggelin, Dec 18 2003

Examples

			a(20)=11 because 11 is the minimum odd number which when appended to 20 forms a prime (201, 203, 205, 207, 209 are all nonprime, 2011 is prime).
		

Crossrefs

Cf. A032352 (a(n) requires at least a 2 digit odd number), A091089 (a(n) requires at least a 3 digit odd number).
Cf. also A060199, A228325, A336893.

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; t={}; Do[k=1; While[!PrimeQ[FromDigits[Join[d[n],d[k]]]],k++]; AppendTo[t,k],{n,102}]; t (* Jayanta Basu, May 21 2013 *)
    mon[n_]:=Module[{k=1},While[!PrimeQ[n*10^IntegerLength[k]+k],k+=2];k]; Array[mon,110] (* Harvey P. Dale, Aug 13 2018 *)
  • PARI
    A068695=n->for(i=1,oo,ispseudoprime(eval(Str(n,i)))&&return(i)) \\ M. F. Hasler, Oct 29 2013
    
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(1) if isprime(int(str(n)+str(k))))
    print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Oct 18 2022

Extensions

More terms from Chuck Seggelin, Dec 18 2003
Entry revised by N. J. A. Sloane, Feb 20 2006
More terms from David Wasserman, Feb 14 2006

A119289 Prime numbers p such that there is no prime between 10*p and 10*p+9 inclusive.

Original entry on oeis.org

53, 89, 107, 113, 167, 179, 251, 317, 347, 389, 397, 419, 431, 443, 457, 461, 521, 599, 641, 643, 653, 709, 727, 761, 773, 797, 839, 863, 887, 907, 911, 977, 991, 1087, 1091, 1103, 1153, 1187, 1213, 1217, 1229, 1231, 1259, 1277, 1283, 1301, 1307, 1319, 1327
Offset: 1

Views

Author

Tanya Khovanova, Jul 23 2006

Keywords

Comments

Prime numbers p with property that appending any single decimal digit to p does not produce a prime. Prime members of A032352.

Crossrefs

Supersequence of A239747.

Programs

  • Maple
    a:=proc(n) if isprime(n) = true and isprime(10*n+1)=false and isprime(10*n+3)=false and isprime(10*n+5)=false and isprime(10*n+7)=false and isprime(10*n+9)=false then n else fi end: seq(a(n),n=1..1500); # Emeric Deutsch, Jul 24 2006
  • Mathematica
    Select[Prime[Range[1000]], PrimePi[10# + 9] - PrimePi[10# ] == 0 &] (* Stefan Steinerberger, Jul 24 2006 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (primepi(10*p+9) - primepi(10*p) == 0, print1(p, ", ")););} \\ Michel Marcus, Jun 23 2015
    
  • Python
    from sympy import isprime, primerange
    def ok(p): s = str(p); return all(not isprime(int(s+d)) for d in "1379")
    print(list(filter(ok, primerange(1, 1328)))) # Michael S. Branicky, Aug 08 2021

Extensions

More terms sent by several contributors, Jul 23 2006

A124665 Numbers that cannot be either prefixed or followed by one digit to form a prime.

Original entry on oeis.org

20, 32, 62, 84, 114, 126, 134, 135, 146, 150, 164, 168, 176, 185, 192, 196, 204, 210, 218, 232, 236, 240, 248, 256, 258, 282, 294, 298, 305, 314, 315, 324, 326, 328, 342, 348, 350, 356, 366, 368, 374, 375, 378, 395, 406, 408, 410, 414, 416, 418
Offset: 1

Views

Author

Tanya Khovanova, Dec 23 2006

Keywords

Comments

Prefixing by 0 gives the number itself, implying that a(n) is not prime.
Disjoint union of A124666 and (intersection of A065502 and A032352). - Reinhard Zumkeller, Oct 22 2011; edited by Michel Marcus, Aug 02 2022
All integers of the form 100*(21*n)^3 belong to the sequence, so it is infinite. - Mauro Fiorentini, Jan 05 2023

Examples

			If you prefix 20 with any digit you will get an even number. Also 201, 203, 207 and 209 are all composite.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=If[EvenQ[n]||Divisible[n,5],Union[PrimeQ[10 n+{1,3,7,9}]] == {False},!PrimeQ[n]&&Union[PrimeQ[10 n+{1,3,7,9}]]=={False} && Union[ PrimeQ[Table[FromDigits[Join[{i},IntegerDigits[n]]],{i,9}]]] == {False}]; Select[Range[500],okQ] (* Harvey P. Dale, Jul 15 2011 *)
  • PARI
    is(n)=my(N=10*n,D=10^#Str(n)); forstep(k=n, n+9*D, D, if(isprime(k), return(0)));!(isprime(N+1)||isprime(N+3)||isprime(N+7)||isprime(N+9)) \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from sympy import isprime
    def ok(n):
        s = str(n)
        if any(isprime(int(s+c)) for c in "1379"): return False
        return not any(isprime(int(c+s)) for c in "0123456789")
    print([k for k in range(419) if ok(k)]) # Michael S. Branicky, Aug 01 2022

Extensions

Deleted incorrect Haskell program. - N. J. A. Sloane, Aug 02 2022

A091089 Numbers which form a prime by appending a 3-digit odd number and form no primes by appending any 1- or 2-digit odd number not beginning with 0.

Original entry on oeis.org

16557, 16718, 26378, 35921, 46524, 46867, 50018, 55187, 58374, 58452, 60850, 63714, 68771, 71299, 78035, 78269, 81661, 84213, 89052, 90157, 95490, 97080, 102892, 105690, 108682, 115558, 115994, 116138, 116305, 121097, 128192, 131194
Offset: 1

Views

Author

Chuck Seggelin, Dec 18 2003

Keywords

Comments

Many numbers become prime by appending a one-digit odd number. Some numbers (such as 20, 32, 51, etc.) require a 2-digit odd number (A032352 has these). In the first 100000 values of n there are only 22 that require a 3-digit odd number.

Examples

			a(1)=16557 because 16557 is first number which requires a 3-digit odd number be appended to it to form a prime. 165571, 165573, 165575, ..., 165579, 1655711, 1655713, ..., 1655799 are all nonprime numbers. 16557103 is the first prime formed by appending odd numbers to 16657.
a(2) = 16718 because 16718111 is the first prime formed by appending odd numbers to 16718.
		

Crossrefs

Cf. A032352 (a(n) requires at least a 2-digit odd number), A068695 (minimum odd number that must be appended to n to form a prime).

Extensions

Definition edited by N. J. A. Sloane, Nov 08 2020

A008471 Exactly 3 out of 10m+1, 10m+3, 10m+7, 10m+9 are primes.

Original entry on oeis.org

4, 7, 13, 22, 31, 43, 46, 61, 64, 85, 88, 103, 106, 109, 130, 142, 145, 160, 166, 169, 178, 199, 238, 268, 271, 316, 367, 376, 391, 400, 409, 415, 421, 451, 472, 478, 493, 523, 541, 544, 547, 550, 574
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

A216292 Values of k such that there is exactly one prime between 10k and 10k + 9.

Original entry on oeis.org

9, 11, 12, 14, 18, 21, 24, 29, 30, 36, 39, 41, 42, 45, 47, 48, 55, 58, 63, 66, 68, 69, 71, 72, 74, 77, 78, 79, 80, 81, 83, 86, 87, 90, 92, 93, 95, 96, 98, 100, 102, 104, 105, 108, 111, 116, 117, 119, 120, 124, 125, 131, 137, 138, 139, 140, 144, 147, 151, 152
Offset: 1

Views

Author

V. Raman, Sep 03 2012

Keywords

Examples

			36 is in the sequence because between 360 and 369 there is exactly one prime: 367. [_Bruno Berselli_, Sep 04 2012]
		

Crossrefs

Programs

  • Magma
    [n: n in [1..200] | IsOne(#PrimesInInterval(10*n, 10*n+9))]; // Bruno Berselli, Sep 04 2012
    
  • Mathematica
    t = {}; Do[ps = Select[Range[10*n, 10*n + 9], PrimeQ]; If[Length[ps] == 1, AppendTo[t, n]], {n, 0, 199}]; t (* T. D. Noe, Sep 03 2012 *)
    Select[Range[200],PrimePi[10#+9]-PrimePi[10#]==1&] (* Harvey P. Dale, Feb 04 2015 *)
  • PARI
    is(n)=isprime(10*n+1)+isprime(10*n+3)+isprime(10*n+7)+isprime(10*n+9)==1 \\ Charles R Greathouse IV, Sep 07 2012
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A216292_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda k: sum(int(isprime(10*k+i)) for i in (1,3,7,9)) == 1, count(max(1,startvalue)))
    A216292_list = list(islice(A216292_gen(),30)) # Chai Wah Wu, Sep 23 2022

Formula

a(n) ~ 0.1 n log n. - Charles R Greathouse IV, Sep 07 2012
a(n) = floor(A078494(n) / 10). - Charles R Greathouse IV, Sep 07 2012

A216293 Values of k such that there are exactly two primes between 10k and 10k + 9.

Original entry on oeis.org

2, 3, 5, 6, 8, 15, 16, 17, 23, 25, 26, 27, 28, 33, 34, 35, 37, 38, 40, 44, 49, 50, 52, 54, 56, 57, 59, 60, 65, 67, 70, 73, 75, 76, 91, 94, 97, 99, 101, 110, 112, 115, 118, 121, 122, 123, 127, 128, 129, 132, 136, 143, 149, 154, 155, 157, 161, 162, 172, 174
Offset: 1

Views

Author

V. Raman, Sep 03 2012

Keywords

Examples

			23 is in the sequence because between 230 and 239 there are exactly two primes: 233 and 239. [_Bruno Berselli_, Sep 04 2012]
		

Crossrefs

Programs

  • Magma
    [n: n in [1..200] | #PrimesInInterval(10*n, 10*n+9) eq 2]; // Bruno Berselli, Sep 04 2012
  • Mathematica
    t = {}; Do[ps = Select[Range[10*n, 10*n + 9], PrimeQ]; If[Length[ps] == 2, AppendTo[t, n]], {n, 0, 229}]; t (* T. D. Noe, Sep 03 2012 *)
    Select[Range[200],Count[Range[10#,10#+9],?PrimeQ]==2&] (* _Harvey P. Dale, Jan 19 2017 *)

Formula

a(n) >> n log^2 n. - Charles R Greathouse IV, Sep 07 2012

A105052 Write a(n) as a four-bit number; those bits state whether 10n+1, 10n+3, 10n+7 and 10n+9 are primes.

Original entry on oeis.org

6, 15, 5, 10, 14, 5, 10, 13, 5, 2, 15, 4, 2, 11, 1, 10, 6, 5, 8, 15, 0, 8, 7, 5, 8, 10, 5, 10, 12, 4, 2, 14, 0, 10, 3, 5, 2, 5, 5, 2, 9, 1, 8, 13, 5, 2, 14, 1, 2, 9, 5, 0, 12, 0, 10, 2, 5, 10, 2, 5, 10, 7, 0, 8, 14, 5, 8, 6, 4, 8, 9, 1, 2, 5, 4, 10, 9, 4, 2, 2, 1, 8, 15, 1, 0, 7, 4, 2, 14, 0, 2, 9, 1, 2
Offset: 0

Views

Author

Robert G. Wilson v, Apr 01 2005

Keywords

Comments

Binary encoding of the prime-ness of the 4 integers r+10*n with remainder r=1, 3, 7 or 9. Classify the 4 integers 10n+r with r= 1, 3, 7, or 9, as nonprime or prime and associate bit positions 3=MSB,2,1,0=LSB with the 4 remainders in that order. Raise the bit if 10n+r is prime, erase it if 10n+r is nonprime. The sequence interprets the 4 bits as a number in base 2. a(n) is the decimal representation, obviously in the range 0<=a(n)<16. - Juri-Stepan Gerasimov, Jun 10 2008

Examples

			For n=2, the 4 numbers 21 (r=1), 23 (r=3), 27 (r=7), 29 (r=9) are nonprime, prime, nonprime, prime, which is rendered into 0101 = 2^0 + 2^2 = 5 = a(2).
These two hexadecimal lines represent the primes between 10 and 1010:
  F5AE5AD52F 42B1A658F0 8758A5AC42 E0A3525529 18D52E1295
  0C0A25A25A 708E586489 1254A94221 8F10742E02 912A42A4A1
		

Crossrefs

Cf. A140891 (analog in base 14, prime = bit 0, remainder 1 = LSB), A140387 (analog in base 30, prime = bit 0, remainder 1 = LSB).

Programs

  • Mathematica
    f[n_] := FromDigits[ PrimeQ[ Drop[ Range[10n + 1, 10n + 9, 2], {3, 3}]] /. {True -> 1, False -> 0}, 2]; Table[ f[n], {n, 2, 93}]
    f[n_] := If[ GCD[n, 10] == 1, If[PrimeQ@ n, 1, 0], -1]; FromDigits[#, 2] & /@ Partition[ DeleteCases[ Array[f, 940], -1], 4] (* Robert G. Wilson v, Jun 22 2012 *)
    Table[FromDigits[Boole[PrimeQ[10n+{1,3,7,9}]],2],{n,0,100}] (* Harvey P. Dale, Nov 07 2016 *)
  • PARI
    f(n)={s=0;if(isprime(10*n+1),s+=8);if(isprime(10*n+3), s+= 4);if(isprime(10*n+7),s+=2);if(isprime(10*n+9),s+=1); return(s)};for(n=0,93,print1(f(n),", ")) \\ Washington Bomfim, Jan 18 2011

Extensions

Edited by Don Reble, Nov 08 2005
Further edited by R. J. Mathar, Jun 18 2008
Further edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar

A179816 Sum of the prime numbers that are between 10*n and 10*(n+1).

Original entry on oeis.org

17, 60, 52, 68, 131, 112, 128, 223, 172, 97, 420, 113, 127, 407, 149, 308, 330, 352, 181, 780, 0, 211, 679, 472, 241, 508, 532, 548, 564, 293, 307, 941, 0, 668, 696, 712, 367, 752, 772, 397, 810, 419, 421, 1303, 892, 457, 1391, 479, 487, 990, 1012, 0, 1044, 0
Offset: 0

Views

Author

Odimar Fabeny, Jul 28 2010

Keywords

Comments

With the exception of the first term, the same as A140890. - R. J. Mathar, Jul 30 2010

Examples

			17 (2+3+5+7), 60 (11+13+17+19), 52 (23+29), 68 (31+37), 131 (41+43+47).
		

Crossrefs

Programs

  • Maple
    A179816 := proc(n) a := 0 ; for p from 10*n to 10*n+9 do if isprime(p) then a := a+p ; end if; end do: a ; end proc: seq(A179816(n),n=0..80) ;  # R. J. Mathar, Jul 30 2010
  • Mathematica
    f[n_] := Plus @@ Select[Range[10 n + 1, 10 n + 9], PrimeQ]; Array[f, 54, 0] (* Robert G. Wilson v, Aug 02 2010 *)
  • PARI
    a(n) = vecsum(select(isprime, [10*n..10*(n+1)])); \\ Michel Marcus, Aug 24 2022
    
  • Python
    from sympy import primerange
    def a(n): return sum(primerange(10*n, 10*(n+1)))
    print([a(n) for n in range(54)]) # Michael S. Branicky, Aug 23 2022

Formula

a(n) = 0 for n in A032352. - Michel Marcus, Aug 23 2022

Extensions

More terms from R. J. Mathar, Jul 30 2010
Name edited by Michel Marcus, Aug 23 2022
Showing 1-10 of 35 results. Next