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.

Previous Showing 51-60 of 61 results. Next

A144840 Numbers k such that the three numbers k-1, k+3 and k+5 are all prime.

Original entry on oeis.org

8, 14, 38, 68, 98, 104, 194, 224, 278, 308, 458, 614, 824, 854, 878, 1088, 1298, 1424, 1448, 1484, 1664, 1694, 1784, 1868, 1874, 1994, 2084, 2138, 2378, 2684, 2708, 2798, 3164, 3254, 3458, 3464, 3848, 4154, 4514, 4784, 5228, 5414, 5438, 5648, 5654, 5738
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 23 2008

Keywords

Crossrefs

Programs

  • Python
    from sympy import isprime
    def ok(n): return n > 4 and isprime(n-1) and isprime(n+3) and isprime(n+5)
    print(list(filter(ok, range(5739)))) # Michael S. Branicky, Aug 14 2021

Formula

a(n) = A022005(n) + 1. - R. J. Mathar, Sep 24 2008

Extensions

Definition edited and extended by R. J. Mathar, Sep 24 2008

A215918 Numbers n such that 6*n + {1, 5, 7} are all primes.

Original entry on oeis.org

1, 2, 6, 11, 16, 17, 32, 37, 46, 51, 76, 102, 137, 142, 146, 181, 216, 237, 241, 247, 277, 282, 297, 311, 312, 332, 347, 356, 396, 447, 451, 466, 527, 542, 576, 577, 641, 692, 752, 797, 871, 902, 906, 941, 942, 956, 1091, 1137, 1201, 1292, 1312, 1381, 1437
Offset: 1

Views

Author

Zak Seidov, Aug 27 2012

Keywords

Comments

Subsequence of A056956.

Crossrefs

Programs

  • Magma
    [n: n in [1..1000] | forall{6*n+r: r in [1,5,7] | IsPrime(6*n+r)}]; // Bruno Berselli, Aug 27 2012
  • Mathematica
    Select[Range[1437], Union[PrimeQ[6 # + {1, 5, 7}]] == {True} &] (* T. D. Noe, Aug 27 2012 *)
  • PARI
    for(n=1,2000,if(isprime(6*n+1)&&isprime(6*n+5)&&isprime(6*n+7),print(n",")))
    

Formula

a(n) = (A022005(n)-1)/6.

A236552 a(n) = |{0 < k < n: 6*k - 1, 6*k + 1, 6*k + 5 and prime(n-k) + 6 are all prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 28 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3.
(ii) For any integer n > 4, there is a positive integer k < n such that 6*k - 5, 6*k - 1, 6*k + 1 and prime(n-k) + 6 are all prime.
(iii) Any integer n > 7 can be written as p + q with q > 0 such that p, p + 6 and prime(q) + 6 are all prime.
(iv) Each integer n > 4 can be written as k*(k+1) + m with k > 0 and m > 0 such that prime(m) + 6 is prime.

Examples

			a(4) = 1 since 6*1 - 1, 6*1 + 1, 6*1 + 5 and prime(4-1) + 6 = 11 are all prime.
a(48) = 1 since 6*32 - 1 = 191, 6*32 + 1 = 193, 6*32 + 5 = 197 and prime(48-32) + 6 = 53 + 6 = 59 are all prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[6n-1]&&PrimeQ[6n+1]&&PrimeQ[6n+5]
    q[n_]:=PrimeQ[Prime[n]+6]
    a[n_]:=Sum[If[p[k]&&q[n-k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A290635 Greatest of 4 consecutive primes with consecutive gaps 6, 4, 2.

Original entry on oeis.org

43, 73, 283, 619, 1303, 1669, 1789, 1873, 1999, 2143, 2383, 2689, 2803, 4519, 5419, 5443, 5653, 7879, 9013, 11833, 13693, 14563, 17389, 18133, 18313, 20359, 21493, 22159, 24109, 27283, 32719, 35533, 36793, 37573, 41233, 41959, 42409, 42463, 44269, 47149, 50593, 55219, 55819, 55933
Offset: 1

Views

Author

Muniru A Asiru, Aug 08 2017

Keywords

Comments

All terms = {13, 19} mod 30.

Examples

			43 is a member of the sequence because 43 is the greatest of the 4 consecutive primes 31, 37, 41, 43 with consecutive gaps 6, 4, 2; that is, 37 - 31 = 6, 41 - 37 = 4, 43 - 41 = 2.
		

Crossrefs

Subsequence of A006512 and A098413.

Programs

  • GAP
    K:=2*10^5+1;; # to get all terms <= K.
    P:=Filtered([1,3..K],IsPrime);;  I:=Reversed([2,4,6]);;
    P1:=List([1..Length(P)-1],i->P[i+1]-P[i]);;
    P2:=List([1..Length(P)-Length(I)],i->[P1[i],P1[i+1],P1[i+2]]);;
    P3:=List(Positions(P2,I),i->P[i+Length(I)]);
    # More efficient
    
  • GAP
    Filtered(Set(Flat(List([13,19],j->List([1..2000],i->30*i+j)))),j->IsPrime(j) and IsPrime(j-12) and not IsPrime(j-10) and not IsPrime(j-8) and IsPrime(j-6) and not IsPrime(j-4) and IsPrime(j-2)); # Muniru A Asiru, Jul 03 2018
    
  • Maple
    for i from 1 to 10^5 do if ithprime(i+1)=ithprime(i)+6 and ithprime(i+2)=ithprime(i)+4 and ithprime(i+3)=ithprime(i)+2  then print(ithprime(i+3)); fi; od; # Corrected by Robert Israel, Jun 28 2018
    # More efficient:
    primes:= select(isprime,[seq(seq(30*i+j,j=[13,19]),i=1..10^4)]):
    select(t -> isprime(t-2) and isprime(t-6) and isprime(t-12) and not isprime(t-8), primes); # Robert Israel, Jun 28 2018
  • Mathematica
    With[{s = Differences@ Prime@ Range[10^4]}, Prime[1 + SequencePosition[s, {6, 4, 2}][[All, -1]] ] ] (* Michael De Vlieger, Aug 16 2017 *)
    Select[Partition[Prime[Range[6000]],4,1],Differences[#]=={6,4,2}&][[All,4]] (* Harvey P. Dale, Feb 13 2022 *)
  • PARI
    is(n) = if(!ispseudoprime(n), return(0), my(v=[n-2, n-6, n-12]); if(v[1]==precprime(n-1) && v[2]==precprime(v[1]-1) && v[3]==precprime(v[2]-1), return(1))); 0 \\ Felix Fröhlich, Aug 10 2017

Formula

a(n) = A078855(n) + 12.

A308086 Carmichael numbers c such that c-4, c-2 and c+2 are primes.

Original entry on oeis.org

656601, 11512252145095521, 35151891169379601, 89283676825965441, 209606994019068801, 584047819872236721, 627126355430628801, 1107574117930742001, 1152431453119654401, 2990125943388676401, 6919232969930803761
Offset: 1

Views

Author

Rick L. Shepherd, May 11 2019

Keywords

Comments

Subsequence of A287591 (Carmichael numbers that are arithmetic means of cousin primes). Calculated from Amiram Eldar's table in that sequence. The Carmichael numbers here are contained within intervals defined by prime triples of the form (p, p+2, p+6); therefore, for each term, four consecutive odd numbers are prime, prime, Carmichael number (divisible by 3), then prime. None of the terms of A287591 available so far are contained within intervals defined by prime triplets of the form (p, p+4, p+6). Is that possible? If so, is it also possible for a Carmichael number to be immediately preceded and succeeded by twin primes, i.e., to be "contained" in a prime quadruplet? (Such Carmichael numbers would necessarily be multiples of 15.)

Examples

			656601 = 3*11*101*197 is a term because 656597 and 656599 are twin primes, 656601 is a Carmichael number, and 656603 is also a prime.
		

Crossrefs

Extensions

More terms from Amiram Eldar, Jul 02 2019

A309594 Smallest members of prime triples, the sum of which results in a perfect square.

Original entry on oeis.org

13, 37, 277, 613, 12157, 14557, 23053, 55213, 81013, 203317, 331333, 393853, 824773, 867253, 1008037, 2038573, 3026053, 3322213, 5198197, 5497237, 5793517, 5984053, 9107173, 17246413, 20850757, 20871853, 21327997, 25363573, 25678573, 27258613, 29134597, 30153037, 33313333
Offset: 1

Views

Author

Philip Mizzi, Aug 09 2019

Keywords

Comments

A prime triple is a set of three prime numbers of the form (p, p+2, p+6) or (p, p+4, p+6).
The smallest prime of the first form of these triples is not part of this sequence because p + (p+2) + (p+6) = 3p +8 and a number of this form is never a square.
PROOF:
From Bernard Schott, Aug 09 2019: (Start)
If a == 0 (mod 3) ==> a^2 == 0 (mod 3),
If a == 1 (mod 3) ==> a^2 == 1 (mod 3),
If a == 2 (mod 3) ==> a^2 == 4 == 1 (mod 3).
Hence, a square is always == 0 or == 1 (mod 3)
As p + (p+2) + (p+6) = 3*p+8, and 3*p+8 == 2 (mod 3), there is no prime triple of the form (p, p+2, p+6) whose sum 3*p + 8 can be a square. (End)

Examples

			Let p = 277 (prime), q = p+4 = 281 (prime), r = p+6 = 283 (prime). We now have a prime triple. p+q+r = 841 = 29^2, a perfect square.
		

Crossrefs

Cf. A130621.
Intersection of A022005 and A206279.

Programs

  • Maple
    Res:= NULL: count:= 0:
    for k from 0 while count < 100 do
      for x in [6*k+1,6*k+5] do
        p:= (x^2-10)/3;
        if isprime(p) and isprime(p+4) and isprime(p+6) then
          count:= count+1;
          Res:= Res, p
        fi
    od od:
    Res; # Robert Israel, Aug 13 2019
  • Mathematica
    ok[p_] := If[AllTrue[{p, p+4, p+6}, PrimeQ], Sow@p]; Reap[Do[ok[3 y^2 + 2 y - 3]; ok[3 y^2 + 4 y - 2], {y, 4000}]][[2, 1]] (* Giovanni Resta, Aug 09 2019 *)
  • PARI
    issq(p) = issquare(3*p+10);
    istriple(p) = isprime(p+4) && isprime(p+6);
    isok(p) = isprime(p) && istriple(p) && issq(p); \\ Michel Marcus, Aug 10 2019

Extensions

More terms from Michel Marcus, Aug 09 2019

A361267 Numbers k such that prime(k+2) - prime(k) = 6.

Original entry on oeis.org

3, 4, 5, 6, 7, 12, 13, 19, 25, 26, 27, 28, 43, 44, 48, 49, 59, 63, 64, 69, 88, 89, 112, 116, 142, 143, 147, 148, 151, 152, 181, 182, 206, 211, 212, 224, 225, 229, 234, 235, 236, 253, 261, 264, 276, 285, 286, 287, 301, 302, 313, 314, 322, 332, 336, 352, 384, 389
Offset: 1

Views

Author

Atabey Kaygun, Mar 06 2023

Keywords

Crossrefs

Programs

  • Clojure
    (defn next-prime [n]
      (if (= n 2)
          3
          (let [m (+ n 2)
                t (-> n Math/sqrt int (+ 2))]
              (if (some #(zero? (mod m %)) (range 2 t))
                  (next-prime m)
                  m))))
    (def primes (lazy-seq (iterate next-prime 2)))
    (defn triplet-primes-positions [n]
      (->> primes
           (take n)
           (partition 3 1)
           (map list (range))
           (filter (fn [[i xs]] (= 6 (- (last xs) (first xs)))))
           (map #(-> % first inc))))
    (println (triplet-primes-positions 2000))
    
  • Maple
    q:= n-> is(ithprime(n+2)-ithprime(n)=6):
    select(q, [$1..400])[];  # Alois P. Heinz, Mar 06 2023
  • Mathematica
    Select[Range[400], Prime[# + 2] - Prime[#] == 6 &] (* Michael De Vlieger, Mar 06 2023 *)
    PrimePi/@(Select[Partition[Prime[Range[400]],3,1],#[[3]]-#[[1]]==6&][[;;,1]]) (* Harvey P. Dale, Sep 16 2023 *)
  • Python
    from itertools import count, islice
    from sympy import nextprime, prime
    def A361267_gen(startvalue=1): # generator of terms >= startvalue
        p = prime(m:=max(startvalue,1))
        q = nextprime(p)
        r = nextprime(q)
        for k in count(m):
            if r-p == 6:
                yield k
            p, q, r = q, r, nextprime(r)
    A361267_list = list(islice(A361267_gen(),20)) # Chai Wah Wu, Mar 27 2023

Formula

a(n) = A000720(A007529(n)). - Alois P. Heinz, Mar 06 2023

A128928 Smallest member p of a triple of primes (p,p+8,p+20).

Original entry on oeis.org

3, 11, 23, 53, 59, 89, 131, 173, 191, 263, 359, 389, 401, 479, 593, 599, 653, 719, 1013, 1031, 1109, 1193, 1229, 1283, 1439, 1451, 1523, 1559, 1601, 1733, 1979, 2273, 2531, 2663, 2699, 2711, 3041, 3209, 3251, 3299, 3323, 3449, 3491, 3539, 3623, 3719, 3911, 3923, 4091, 4211
Offset: 1

Views

Author

J. M. Bergot, Apr 25 2007

Keywords

Comments

A subsequence of A023202. The definition implies that the sum of the first two primes, 2(p+4), divides the sum of the product of the first two primes and the last, p(p+8)+p+20=(p+4)(p+5). This feature is shared with A022005 and common to prime triples of the format (p,p+2*a,p+a+a^2) with even a. - R. J. Mathar, Apr 26 2007

Crossrefs

Cf. A022005.

Programs

  • Maple
    isA128928 := proc(n) isprime(n) and isprime(n+8) and isprime(n+20) ; end: for n from 1 to 300 do if isA128928(ithprime(n)) then printf("%d,",ithprime(n)) ; fi ; od ; # R. J. Mathar, Apr 26 2007
  • Mathematica
    kmax = 580; Select[ Prime[ Range[1, kmax] ], (PrimeQ[ # + 8] && PrimeQ[ # + 20])& ] (* Stuart Clary *)

Extensions

Corrected and extended by Robert G. Wilson v, R. J. Mathar and Stuart Clary, Apr 26 2007

A297709 Table read by antidiagonals: Let b be the number of digits in the binary expansion of n. Then T(n,k) is the k-th odd prime p such that the binary digits of n match the primality of the b consecutive odd numbers beginning with p (or 0 if no such k-th prime exists).

Original entry on oeis.org

3, 5, 7, 7, 13, 3, 11, 19, 5, 23, 13, 23, 11, 31, 7, 17, 31, 17, 47, 13, 5, 19, 37, 29, 53, 19, 11, 3, 23, 43, 41, 61, 37, 17, 0, 89, 29, 47, 59, 73, 43, 29, 0, 113, 23, 31, 53, 71, 83, 67, 41, 0, 139, 31, 19, 37, 61, 101, 89, 79, 59, 0, 181, 47, 43, 7, 41, 67
Offset: 1

Views

Author

Jon E. Schoenfield, Apr 15 2018

Keywords

Comments

For each n >= 1, row n is the union of rows 2n and 2n+1.
Rows with no nonzero terms: 15, 21, 23, 28, 30, 31, ...
Rows whose only nonzero term is 3: 7, 14, 29, 59, 118, 237, 475, 950, 1901, 3802, 7604, ...
Rows whose only nonzero term is 5: 219, 438, 877, 1754, 3508, 7017, 14035, ...
For j = 2, 3, 4, ..., respectively, the first row whose only nonzero term is prime(j) is 7, 219, 2921, ...; is there such a row for every odd prime?

Examples

			13 = 1101_2, so row n=13 lists the odd primes p such that the four consecutive odd numbers p, p+2, p+4, and p+6 are prime, prime, composite, and prime, respectively; these are the terms of A022004.
14 = 1110_2, so row n=14 lists the odd primes p such that p, p+2, p+4, and p+6 are prime, prime, prime, and composite, respectively; since there is only one such prime (namely, 3), there is no such 2nd, 3rd, 4th, etc. prime, so the terms in row 14 are {3, 0, 0, 0, ...}.
15 = 1111_2, so row n=15 would list the odd primes p such that p, p+2, p+4, and p+6 are all prime, but since no such prime exists, every term in row 15 is 0.
Table begins:
  n in base|                    k                   |  OEIS
  ---------+----------------------------------------+sequence
  10     2 |   1    2    3    4    5    6    7    8 | number
  =========+========================================+========
   1     1 |   3    5    7   11   13   17   19   23 | A065091
   2    10 |   7   13   19   23   31   37   43   47 | A049591
   3    11 |   3    5   11   17   29   41   59   71 | A001359
   4   100 |  23   31   47   53   61   73   83   89 | A124582
   5   101 |   7   13   19   37   43   67   79   97 | A029710
   6   110 |   5   11   17   29   41   59   71  101 | A001359*
   7   111 |   3    0    0    0    0    0    0    0 |
   8  1000 |  89  113  139  181  199  211  241  283 | A083371
   9  1001 |  23   31   47   53   61   73   83  131 | A031924
  10  1010 |  19   43   79  109  127  163  229  313 |
  11  1011 |   7   13   37   67   97  103  193  223 | A022005
  12  1100 |  29   59   71  137  149  179  197  239 | A210360*
  13  1101 |   5   11   17   41  101  107  191  227 | A022004
  14  1110 |   3    0    0    0    0    0    0    0 |
  15  1111 |   0    0    0    0    0    0    0    0 |
  16 10000 | 113  139  181  199  211  241  283  293 | A124584
  17 10001 |  89  359  389  401  449  479  491  683 | A031926
  18 10010 |  31   47   61   73   83  151  157  167 |
  19 10011 |  23   53  131  173  233  263  563  593 | A049438
  20 10100 |  19   43   79  109  127  163  229  313 |
  21 10101 |   0    0    0    0    0    0    0    0 |
  22 10110 |   7   13   37   67   97  103  193  223 | A022005
  23 10111 |   0    0    0    0    0    0    0    0 |
  24 11000 | 137  179  197  239  281  419  521  617 |
  25 11001 |  29   59   71  149  269  431  569  599 | A049437*
  26 11010 |  17   41  107  227  311  347  461  641 |
  27 11011 |   5   11  101  191  821 1481 1871 2081 | A007530
  28 11100 |   0    0    0    0    0    0    0    0 |
  29 11101 |   3    0    0    0    0    0    0    0 |
  30 11110 |   0    0    0    0    0    0    0    0 |
  31 11111 |   0    0    0    0    0    0    0    0 |
*other than the referenced sequence's initial term 3
.
Alternative version of table:
.
  n in base|primal-|               k              |  OEIS
  ---------+  ity  +------------------------------+  seq.
  10     2 |pattern|   1    2    3    4    5    6 | number
  =========+=======+==============================+========
   1     1 | p     |   3    5    7   11   13   17 | A065091
   2    10 | pc    |   7   13   19   23   31   37 | A049591
   3    11 | pp    |   3    5   11   17   29   41 | A001359
   4   100 | pcc   |  23   31   47   53   61   73 | A124582
   5   101 | pcp   |   7   13   19   37   43   67 | A029710
   6   110 | ppc   |   5   11   17   29   41   59 | A001359*
   7   111 | ppp   |   3    0    0    0    0    0 |
   8  1000 | pccc  |  89  113  139  181  199  211 | A083371
   9  1001 | pccp  |  23   31   47   53   61   73 | A031924
  10  1010 | pcpc  |  19   43   79  109  127  163 |
  11  1011 | pcpp  |   7   13   37   67   97  103 | A022005
  12  1100 | ppcc  |  29   59   71  137  149  179 | A210360*
  13  1101 | ppcp  |   5   11   17   41  101  107 | A022004
  14  1110 | pppc  |   3    0    0    0    0    0 |
  15  1111 | pppp  |   0    0    0    0    0    0 |
  16 10000 | pcccc | 113  139  181  199  211  241 | A124584
  17 10001 | pcccp |  89  359  389  401  449  479 | A031926
  18 10010 | pccpc |  31   47   61   73   83  151 |
  19 10011 | pccpp |  23   53  131  173  233  263 | A049438
  20 10100 | pcpcc |  19   43   79  109  127  163 |
  21 10101 | pcpcp |   0    0    0    0    0    0 |
  22 10110 | pcppc |   7   13   37   67   97  103 | A022005
  23 10111 | pcppp |   0    0    0    0    0    0 |
  24 11000 | ppccc | 137  179  197  239  281  419 |
  25 11001 | ppccp |  29   59   71  149  269  431 | A049437*
  26 11010 | ppcpc |  17   41  107  227  311  347 |
  27 11011 | ppcpp |   5   11  101  191  821 1481 | A007530
  28 11100 | pppcc |   0    0    0    0    0    0 |
  29 11101 | pppcp |   3    0    0    0    0    0 |
  30 11110 | ppppc |   0    0    0    0    0    0 |
  31 11111 | ppppp |   0    0    0    0    0    0 |
.
     *other than the referenced sequence's initial term 3
		

Crossrefs

A360758 Numbers k for which k' - 1 and k' + 1 are twin primes, where the prime denotes the arithmetic derivative.

Original entry on oeis.org

4, 8, 9, 35, 36, 64, 65, 68, 77, 81, 112, 160, 161, 185, 188, 208, 209, 221, 225, 236, 335, 341, 371, 377, 428, 437, 441, 485, 515, 576, 596, 611, 671, 707, 731, 736, 756, 767, 779, 783, 792, 851, 868, 899, 917, 952, 965, 972, 1007, 1028, 1067, 1115, 1152, 1157
Offset: 1

Views

Author

Marius A. Burtea, Mar 01 2023

Keywords

Comments

Numbers that have an arithmetic derivative equal to the average of twin prime pairs (A014574).
If p is in A022005 then m = 5*p is a term. Indeed, p is prime and m' = (5*p)' = p + 5 and m' - 1 = p + 4 and m' + 1 = p + 6 which are twin prime numbers.
If p is in A046138 then m = 7*p is a term. Indeed, p is prime and m' = (7*p)' = p + 7 and m' - 1 = p + 6 and m' + 1 = p + 8 which are twin prime numbers.
If p is in A212492 then m = 11*p is a term. Indeed, p is prime and m' = (11*p)' = p + 11 and m' - 1 = p + 10 and m' + 1 = p + 12 which are twin prime numbers.

Examples

			4' =  4, 4' - 1 =  4 - 1 =  3, 4' + 1 =  4 + 1 =  5, so 4 is a term.
8' = 12, 8' - 1 = 12 - 1 = 11, 8' + 1 = 12 + 1 = 13, so 8 is a term.
9' =  6, 9' - 1 =  6 - 1 =  5, 9' + 1 =  6 + 1 =  7, so 9 is a term.
		

Crossrefs

Programs

  • Magma
    f:=func; [p:p in [2..1200]| IsPrime(Floor(f(p))-1) and IsPrime(Floor(f(p))+1)];
  • Mathematica
    d[1] = 0; d[n_] := n * Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); Select[Range[1200], And @@ PrimeQ[d[#] + {-1, 1}] &] (* Amiram Eldar, Mar 01 2023 *)
Previous Showing 51-60 of 61 results. Next