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 71-80 of 85 results. Next

A320714 Indices of primes followed by a gap (distance to next larger prime) of 32.

Original entry on oeis.org

738, 1315, 3022, 3042, 3607, 4112, 4300, 4362, 4555, 4619, 4761, 4893, 5204, 5358, 5615, 5637, 6215, 6265, 6479, 6610, 6706, 6933, 7295, 7829, 7884, 8049, 8198, 8548, 9085, 9155, 9524, 9588, 9641, 9826, 9924, 10463, 10824, 11367, 11590, 11701, 11729, 11869, 12159, 12258, 12275, 12327
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A126784.

Crossrefs

Equals A000720 o A126784.
Indices of 32's in A001223.
Row 16 of A174349.
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

  • Maple
    p:= 2: Res:= NULL: count:= 0:
    for k from 1 while count < 100 do
      q:= nextprime(p);
      if q - p = 32 then
        count:= count+1;
        Res:= Res, k;
      fi;
      p:= q;
    od:
    Res; # Robert Israel, Oct 25 2018
  • Mathematica
    PrimePi/@Select[Partition[Prime[Range[15000]],2,1],#[[2]]-#[[1]]==32&][[;;,1]] (* Harvey P. Dale, Jun 19 2024 *)
  • PARI
    A(N=100,g=32,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(A126784(n)).
A320714 = { i>0 | prime(i+1) = prime(i) + 32 }.

A320715 Indices of primes followed by a gap (distance to next larger prime) of 34.

Original entry on oeis.org

217, 1059, 1229, 1409, 1457, 1986, 2169, 2310, 2406, 3221, 3505, 3692, 3995, 4324, 4923, 5130, 5518, 6050, 6152, 6168, 6434, 7257, 7362, 7604, 7694, 7915, 8293, 8555, 8584, 8651, 8859, 9017, 9341, 9598, 9796, 9869, 10028, 10092, 10116, 10150, 10211, 10234, 10317, 10657, 10744, 10762
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A134116.

Crossrefs

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).
Equals A000720 o A134116.
Indices of 34's in A001223.
Row 17 of A174349.

Programs

  • Mathematica
    Position[Differences[Prime[Range[11000]]],34]//Flatten (* Harvey P. Dale, Jan 19 2021 *)
  • PARI
    A(N=100,g=34,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(A134116(n)).
A320715 = { i>0 | prime(i+1) = prime(i) + 34 }.

A320716 Indices of primes followed by a gap (distance to next larger prime) of 36.

Original entry on oeis.org

1183, 1532, 1663, 1847, 2146, 2489, 2500, 2550, 2700, 2976, 3087, 3238, 3461, 4236, 4483, 4681, 4692, 4834, 4849, 4946, 5178, 5836, 6062, 6098, 6269, 6591, 6613, 6787, 6862, 6904, 7091, 7178, 7200, 7285, 7577, 7743, 8057, 8097, 8215, 8355, 8572, 8637, 8767, 8832, 8877, 9023, 9129, 9161
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A134117.

Crossrefs

Cf. A029707, A029709 (analog for gaps 2 & 4), A320701, A320702, ... A320720 (analog for gaps 6, 8, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).
Equals A000720 o A134117.
Indices of 36's in A001223.
Row 18 of A174349.

Programs

  • PARI
    A(N=100,g=36,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(A134117(n)).
A320716 = { i>0 | prime(i+1) = prime(i) + 36 }.

A334142 Indices of twin primes.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 17, 18, 20, 21, 26, 27, 28, 29, 33, 34, 35, 36, 41, 42, 43, 44, 45, 46, 49, 50, 52, 53, 57, 58, 60, 61, 64, 65, 69, 70, 81, 82, 83, 84, 89, 90, 98, 99, 104, 105, 109, 110, 113, 114, 116, 117, 120, 121, 140, 141, 142, 143, 144, 145, 148, 149
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 15 2020

Keywords

Crossrefs

Programs

  • Maple
    q:= n-> (p-> isprime(p-2) or isprime(p+2))(ithprime(n)):
    select(q, [$1..150])[];  # Alois P. Heinz, Apr 15 2020
  • Mathematica
    With[{p = PositionIndex[(#[[2]] - #[[1]] - 2) & /@ Partition[Prime[Range[150]], 2, 1]][0]}, Union[p, p + 1]] (* Amiram Eldar, Sep 06 2024 *)

Formula

a(n) = A000720(A001097(n)).
Set union of A029707 and A107770.

A340468 a(n) is the least prime of the form 2 + Product_{i=n..m} prime(i).

Original entry on oeis.org

5, 7, 79, 13, 223, 19, 439, 130753887906569681111538991218568790437537693430279000532630035672131604633987039552816424896353327834998483765849409837393409377729040653460715050958787058270805333463, 31, 34826927179023475480751694965449235272424989980919
Offset: 2

Views

Author

Robert Israel, Jan 08 2021

Keywords

Comments

If n is in A029707, a(n) = 2+prime(n).
If n is not in A029707 but prime(n) is in A051507, a(n) = 2+prime(n)*prime(n+1).
a(15) > 10^1000 if it exists.

Examples

			a(2) = 2+3 = 5.
a(3) = 2+5 = 7.
a(4) = 2+7*11 = 79.
a(5) = 2+11 = 13.
a(6) = 2+13*17 = 223.
a(7) = 2+17 = 19.
a(8) = 2+19*23 = 439.
a(9) = 2+23*29*...*431.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i,t;
      t:= 1;
      for i from n do
        t:= t*ithprime(i);
        if isprime(t+2) then return t+2 fi;
      od
    end proc:
    seq(f(n),n=2..14);
  • Python
    from sympy import isprime, nextprime, prime
    def a(n):
      prodpnpm = pm = prime(n)
      while not isprime(2+prodpnpm): pm = nextprime(pm); prodpnpm *= pm
      return 2+prodpnpm
    print([a(n) for n in range(2, 12)]) # Michael S. Branicky, Jan 08 2021

A343496 First point of the straight lines in A340649.

Original entry on oeis.org

5, 31, 194, 1061, 6456, 40080, 251721, 1617206, 10553419, 69709769, 465769825
Offset: 1

Views

Author

Simon Strandgaard and Jamie Morken, Apr 17 2021

Keywords

Comments

prime(a(n)+1) - prime(a(n)) = n*2. E.g., for n=4: prime(a(4)+1) - prime(a(4)) = 4*2, prime(1062) - prime(1061) = 4*2, 8521 - 8513 = 8.

Examples

			For n=1, consider k's with prime gap 1*2 = 2, i.e., k's such that A001223(k)=2. k=5 is the first place where A001223(k)=2 and A141042(k)=A340649(k), so a(1)=5.
For n=2, consider k's with prime gap 2*2 = 4, i.e., k's such that A001223(k)=4. k=31 is the first place where A001223(k)=4 and A141042(k)=A340649(k), so a(2)=31.
For n=3, consider k's with prime gap 3*2 = 6, i.e., k's such that A001223(k)=6. k=194 is the first place where A001223(k)=6 and A141042(k)=A340649(k), so a(3)=194.
		

Crossrefs

Programs

  • Ruby
    n = 1
    last_prime = 2
    find_gap = 2
    result = []
    Prime.each(10_000) do |prime|
        next if prime == 2
        gap = prime - last_prime
        if gap == find_gap
            value = (n * prime) % last_prime
            if value == n * gap
                result << n
                find_gap += 2
            end
        end
        n += 1
        last_prime = prime
    end
    p result

Formula

a(n) = smallest k that satisfies A001223(k) = 2*n and A340649(k) = A141042(k).

A367805 a(1) = 0; for n > 1, a(n) is the least positive integer k for which k*prime(n) + 2 is prime.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 3, 3, 1, 5, 3, 1, 3, 7, 7, 1, 5, 5, 1, 5, 3, 3, 3, 3, 1, 3, 1, 5, 9, 3, 7, 1, 3, 1, 5, 5, 3, 3, 3, 1, 5, 1, 5, 1, 3, 9, 5, 1, 9, 3, 1, 15, 7, 3, 15, 1, 9, 11, 1, 9, 3, 21, 1, 3, 3, 5, 3, 1, 3, 3, 15, 3, 5, 9, 3, 13, 3, 19, 3, 1, 15, 1, 3, 3, 9, 13, 3, 1, 15
Offset: 1

Views

Author

Frank Hollstein, Dec 01 2023

Keywords

Examples

			For n = 4: a(4) = 3, because prime(4) = 7, 3*7 + 2 = 23 which is prime.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local p, q, r; p:= ithprime(n); q:= p;
          while irem(q-2, p, 'r')<>0 do q:= nextprime(q) od; r
        end:
    seq(a(n), n=1..99);  # Alois P. Heinz, Dec 04 2023
  • Mathematica
    nmax=90; a[1]=0; For[n=2, n<=nmax, n++, For[k=1, k>0, k++, If[PrimeQ[k*Prime[n]+2], a[n]=k; k=-1]]]; Array[a,nmax] (* Stefano Spezia, Dec 04 2023 *)
  • PARI
    a(n) = if (n==1, 0, my(k=1, p=prime(n)); while (!isprime(k*p+2), k++); k); \\ Michel Marcus, Dec 02 2023
    
  • Python
    from itertools import count, dropwhile
    from sympy import prime, isprime
    def A367805(n):
        if n==1:
            return 0
        else:
            p = prime(n)
            return next(dropwhile(lambda x:not isprime(x*p+2),count(1))) # Chai Wah Wu, Jan 04 2024

Formula

a(n) = (A279756(n) - 2)/A000040(n).
a(n) = 1 <=> n in A029707.

Extensions

More terms from Michel Marcus, Dec 02 2023

A385660 Numbers k such that prime(k+1)-prime(k) divides k.

Original entry on oeis.org

1, 2, 4, 8, 10, 12, 18, 20, 24, 26, 28, 36, 44, 48, 52, 54, 60, 64, 72, 80, 84, 88, 96, 98, 102, 104, 108, 112, 116, 120, 128, 136, 140, 142, 144, 148, 152, 168, 174, 176, 178, 180, 182, 190, 192, 206, 210, 212, 216, 224, 230, 234, 236, 240, 244, 248, 252, 256, 262, 264, 268, 276, 286, 288, 294
Offset: 1

Views

Author

Vighnesh Patil, Jul 06 2025

Keywords

Examples

			k = 18 is a term since prime(19) - prime(18) = 6 divides 18.
		

Crossrefs

Programs

  • Mathematica
    q[k_] := Divisible[k, Prime[k + 1] - Prime[k]]; Select[Range[300], q] (* Amiram Eldar, Jul 09 2025 *)
  • Python
    from sympy import prime
    def ok(k): return k % (prime(k+1) - prime(k)) == 0
    print([k for k in range(1, 300) if ok(k)])

A114961 Numbers n such that PrimePi(prime(n + 1)^2) - PrimePi(prime(n)^2) < c*n with c=9/5.

Original entry on oeis.org

7, 10, 13, 20, 26, 28, 33, 35, 43, 45, 49, 52, 57, 60, 64, 89, 98, 109, 113, 116, 120, 140, 142, 144, 148, 152, 171, 173, 176, 178, 182, 190, 201, 209, 212, 215, 225, 230, 234, 236, 253, 256, 262, 265, 268, 277, 286, 288, 294, 296, 302, 307, 313, 315, 318, 320
Offset: 1

Views

Author

Robert G. Wilson v, Feb 21 2006

Keywords

Comments

If c=2 instead of 1.8 then the sequence is A029707.
This sequence is probably finite with 699 terms with 14020 being the last.
If c=1.7 the sequence is just {7, 10, 13, 20, 26, 28, 33, 35, 45, 49, 57, 60, 64, 89, 98, 109, 113, 116, 171, 190, 201, 215, 225, 234, 236, 256, 288, 332, 384, 405, 430, 486, 495, 498, 524, 530, 601, 613, 625, 872}.
If c=1.6 the sequence is just {7, 13, 20, 28, 33, 57, 109}.
If c=3/2 the sequence has but one term, 33.

References

  • P. Ribenboim, The New Book of Prime Number Records, Springer-Verlag, NY, 1995, page 248.

Crossrefs

Cf. A029707.

Programs

  • Mathematica
    t = {}; Do[ If[ PrimePi[ Prime[n + 1]^2] - PrimePi[ Prime[n]^2] < 9n/5, AppendTo[t, n]], {n, 10^5}]; t

A227203 Prime(n)^2 mod (prime(n) + prime(n+1)).

Original entry on oeis.org

4, 1, 1, 13, 1, 19, 1, 25, 9, 1, 9, 43, 1, 49, 9, 9, 1, 9, 73, 1, 9, 85, 9, 109, 103, 1, 109, 1, 115, 49, 133, 9, 1, 25, 1, 9, 9, 169, 9, 9, 1, 25, 1, 199, 1, 241, 253, 229, 1, 235, 9, 1, 25, 9, 9, 9, 1, 9, 283, 1, 25, 49, 313, 1, 319, 49, 9, 25, 1, 355, 9, 379
Offset: 1

Views

Author

Zak Seidov, Sep 18 2013

Keywords

Comments

a(n) = 1 if and only if prime(n) and prime(n+1) are twin prime pair (that is, prime(n+1) = 2 + prime(n)).

Crossrefs

Programs

  • Mathematica
    Table[Mod[Prime[n]^2, Prime[n] + Prime[n + 1]], {n, 200}]
    PowerMod[#[[1]],2,Total[#]]&/@Partition[Prime[Range[80]],2,1] (* Harvey P. Dale, Dec 26 2017 *)
  • PARI
    for(n=1,200,print1(prime(n)^2%(prime(n)+prime(n+1))","))
Previous Showing 71-80 of 85 results. Next