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 22 results. Next

A204901 The index jA204900) for which such j exists, and s(k) denotes the k-th odd prime.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2, 2, 1, 2, 1, 3, 2, 1, 1, 3, 3, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 5, 1, 5, 3, 2, 2, 2, 1, 3, 2, 1, 1, 4, 1, 3, 3, 1, 2, 3, 1, 1, 2, 2, 1, 2, 3, 3, 2, 1, 1, 2, 5, 1, 3
Offset: 1

Views

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Crossrefs

Programs

  • Mathematica
    (See the program at A204900.)

A204892 Least k such that n divides s(k)-s(j) for some j in [1,k), where s(k)=prime(k).

Original entry on oeis.org

2, 3, 3, 4, 4, 5, 7, 5, 5, 6, 6, 7, 10, 7, 7, 8, 8, 9, 13, 9, 9, 10, 16, 10, 16, 10, 10, 11, 11, 12, 19, 12, 20, 12, 12, 13, 22, 13, 13, 14, 14, 15, 24, 15, 15, 16, 25, 16, 26, 16, 16, 17, 29, 17, 30, 17, 17, 18, 18, 19, 31, 19, 32, 19, 19, 20, 33, 20, 20, 21
Offset: 1

Views

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

Suppose that (s(i)) is a strictly increasing sequence in the set N of positive integers. For i in N, let r(h) be the residue of s(i+h)-s(i) mod n, for h=1,2,...,n+1. There are at most n distinct residues r(h), so that there must exist numbers h and h' such that r(h)=r(h'), where 0<=h
Corollary: for each n, there are infinitely many pairs (j,k) such that n divides s(k)-s(j), and this result holds if s is assumed unbounded, rather than strictly increasing.
Guide to related sequences:
...
s(n)=prime(n), primes
... k(n), j(n): A204892, A204893
... s(k(n)),s(j(n)): A204894, A204895
... s(k(n))-s(j(n)): A204896, A204897
s(n)=prime(n+1), odd primes
... k(n), j(n): A204900, A204901
... s(k(n)),s(j(n)): A204902, A204903
... s(k(n))-s(j(n)): A109043(?), A000034(?)
s(n)=prime(n+2), primes >=5
... k(n), j(n): A204908, A204909
... s(k(n)),s(j(n)): A204910, A204911
... s(k(n))-s(j(n)): A109043(?), A000034(?)
s(n)=prime(n)*prime(n+1) product of consecutive primes
... k(n), j(n): A205146, A205147
... s(k(n)),s(j(n)): A205148, A205149
... s(k(n))-s(j(n)): A205150, A205151
s(n)=(prime(n+1)+prime(n+2))/2: averages of odd primes
... k(n), j(n): A205153, A205154
... s(k(n)),s(j(n)): A205372, A205373
... s(k(n))-s(j(n)): A205374, A205375
s(n)=2^(n-1), powers of 2
... k(n), j(n): A204979, A001511(?)
... s(k(n)),s(j(n)): A204981, A006519(?)
... s(k(n))-s(j(n)): A204983(?), A204984
s(n)=2^n, powers of 2
... k(n), j(n): A204987, A204988
... s(k(n)),s(j(n)): A204989, A140670(?)
... s(k(n))-s(j(n)): A204991, A204992
s(n)=C(n+1,2), triangular numbers
... k(n), j(n): A205002, A205003
... s(k(n)),s(j(n)): A205004, A205005
... s(k(n))-s(j(n)): A205006, A205007
s(n)=n^2, squares
... k(n), j(n): A204905, A204995
... s(k(n)),s(j(n)): A204996, A204997
... s(k(n))-s(j(n)): A204998, A204999
s(n)=(2n-1)^2, odd squares
... k(n), j(n): A205378, A205379
... s(k(n)),s(j(n)): A205380, A205381
... s(k(n))-s(j(n)): A205382, A205383
s(n)=n(3n-1), pentagonal numbers
... k(n), j(n): A205138, A205139
... s(k(n)),s(j(n)): A205140, A205141
... s(k(n))-s(j(n)): A205142, A205143
s(n)=n(2n-1), hexagonal numbers
... k(n), j(n): A205130, A205131
... s(k(n)),s(j(n)): A205132, A205133
... s(k(n))-s(j(n)): A205134, A205135
s(n)=C(2n-2,n-1), central binomial coefficients
... k(n), j(n): A205010, A205011
... s(k(n)),s(j(n)): A205012, A205013
... s(k(n))-s(j(n)): A205014, A205015
s(n)=(1/2)C(2n,n), (1/2)*(central binomial coefficients)
... k(n), j(n): A205386, A205387
... s(k(n)),s(j(n)): A205388, A205389
... s(k(n))-s(j(n)): A205390, A205391
s(n)=n(n+1), oblong numbers
... k(n), j(n): A205018, A205028
... s(k(n)),s(j(n)): A205029, A205030
... s(k(n))-s(j(n)): A205031, A205032
s(n)=n!, factorials
... k(n), j(n): A204932, A204933
... s(k(n)),s(j(n)): A204934, A204935
... s(k(n))-s(j(n)): A204936, A204937
s(n)=n!!, double factorials
... k(n), j(n): A204982, A205100
... s(k(n)),s(j(n)): A205101, A205102
... s(k(n))-s(j(n)): A205103, A205104
s(n)=3^n-2^n
... k(n), j(n): A205000, A205107
... s(k(n)),s(j(n)): A205108, A205109
... s(k(n))-s(j(n)): A205110, A205111
s(n)=Fibonacci(n+1)
... k(n), j(n): A204924, A204925
... s(k(n)),s(j(n)): A204926, A204927
... s(k(n))-s(j(n)): A204928, A204929
s(n)=Fibonacci(2n-1)
... k(n), j(n): A205442, A205443
... s(k(n)),s(j(n)): A205444, A205445
... s(k(n))-s(j(n)): A205446, A205447
s(n)=Fibonacci(2n)
... k(n), j(n): A205450, A205451
... s(k(n)),s(j(n)): A205452, A205453
... s(k(n))-s(j(n)): A205454, A205455
s(n)=Lucas(n)
... k(n), j(n): A205114, A205115
... s(k(n)),s(j(n)): A205116, A205117
... s(k(n))-s(j(n)): A205118, A205119
s(n)=n*(2^(n-1))
... k(n), j(n): A205122, A205123
... s(k(n)),s(j(n)): A205124, A205125
... s(k(n))-s(j(n)): A205126, A205127
s(n)=ceiling[n^2/2]
... k(n), j(n): A205394, A205395
... s(k(n)),s(j(n)): A205396, A205397
... s(k(n))-s(j(n)): A205398, A205399
s(n)=floor[(n+1)^2/2]
... k(n), j(n): A205402, A205403
... s(k(n)),s(j(n)): A205404, A205405
... s(k(n))-s(j(n)): A205406, A205407

Examples

			Let s(k)=prime(k).  As in A204890, the ordering of differences s(k)-s(j), follows from the arrangement shown here:
k...........1..2..3..4..5...6...7...8...9
s(k)........2..3..5..7..11..13..17..19..23
...
s(k)-s(1)......1..3..5..9..11..15..17..21..27
s(k)-s(2).........2..4..8..10..14..16..20..26
s(k)-s(3)............2..6..8...12..14..18..24
s(k)-s(4)...............4..6...10..12..16..22
...
least (k,j) such that 1 divides s(k)-s(j) for some j is (2,1), so a(1)=2.
least (k,j) such that 2 divides s(k)-s(j): (3,2), so a(2)=3.
least (k,j) such that 3 divides s(k)-s(j): (3,1), so a(3)=3.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = Prime[n]; z1 = 400; z2 = 50;
    Table[s[n], {n, 1, 30}]          (* A000040 *)
    u[m_] := u[m] = Flatten[Table[s[k] - s[j],
       {k, 2, z1}, {j, 1, k - 1}]][[m]]
    Table[u[m], {m, 1, z1}]          (* A204890 *)
    v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]
    w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]
    d[n_] := d[n] = First[Delete[w[n],
       Position[w[n], 0]]]
    Table[d[n], {n, 1, z2}]          (* A204891 *)
    k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]
    m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]
    j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2
    Table[k[n], {n, 1, z2}]          (* A204892 *)
    Table[j[n], {n, 1, z2}]          (* A204893 *)
    Table[s[k[n]], {n, 1, z2}]       (* A204894 *)
    Table[s[j[n]], {n, 1, z2}]       (* A204895 *)
    Table[s[k[n]] - s[j[n]], {n, 1, z2}]     (* A204896 *)
    Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A204897 *)
    (* Program 2: generates A204892 and A204893 rapidly *)
    s = Array[Prime[#] &, 120];
    lk = Table[NestWhile[# + 1 &, 1, Min[Table[Mod[s[[#]] - s[[j]], z], {j, 1, # - 1}]] =!= 0 &], {z, 1, Length[s]}]
    Table[NestWhile[# + 1 &, 1, Mod[s[[lk[[j]]]] - s[[#]], j] =!= 0 &], {j, 1, Length[lk]}]
    (* Peter J. C. Moses, Jan 27 2012 *)
  • PARI
    a(n)=forprime(p=n+2,,forstep(k=p%n,p-1,n,if(isprime(k), return(primepi(p))))) \\ Charles R Greathouse IV, Mar 20 2013

A204908 Least k such that n divides s(k)-s(j) for some j in [1,k], where s(k) is the k-th prime >=5.

Original entry on oeis.org

2, 2, 3, 3, 5, 3, 6, 4, 7, 5, 8, 5, 9, 6, 10, 7, 11, 7, 12, 9, 13, 8, 14, 8, 16, 9, 15, 11, 18, 10, 17, 10, 18, 11, 21, 11, 20, 12, 21, 13, 22, 13, 23, 16, 23, 14, 24, 14, 25, 16
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

See A204892 for a discussion and guide to related sequences.

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = Prime[n + 2]; z1 = 400; z2 = 50;
    Table[s[n], {n, 1, 30}] (* primes >=5 *)
    u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]
    Table[u[m], {m, 1, z1}]     (* A204906 *)
    v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]
    w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]
    d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]]
    Table[d[n], {n, 1, z2}]     (* A204907 *)
    k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]
    m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]
    j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2
    Table[k[n], {n, 1, z2}]     (* A204908 *)
    Table[j[n], {n, 1, z2}]     (* A204909 *)
    Table[s[k[n]], {n, 1, z2}]  (* A204910 *)
    Table[s[j[n]], {n, 1, z2}]  (* A204911 *)
  • PARI
    a(n) = {my(p=5, k=1); while(sum(i=5, p-1, isprime(i)&&(p-i)%n==0)==0, p=nextprime(p+1); k++); k; } \\ Jinyuan Wang, Jan 30 2020

A204916 Least k such that n divides s(k)-s(j) for some j in [1,k), where s(k)=(prime(k))^2.

Original entry on oeis.org

2, 3, 3, 3, 2, 4, 3, 3, 4, 4, 6, 4, 5, 5, 4, 3, 8, 5, 7, 4, 3, 7, 10, 4, 9, 8, 10, 5, 11, 6, 10, 5, 6, 9, 7, 5, 14, 11, 5, 4, 14, 7, 13, 7, 4, 10, 16, 5, 15, 11, 8, 8, 17, 11, 6, 5, 7, 13, 18, 6
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

See A204892 for a discussion and guide to related sequences

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = Prime[n]^2; z1 = 1000; z2 = 60;
    Table[s[n], {n, 1, 30}]  (* A001248 *)
    u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]
    Table[u[m], {m, 1, z1}]             (* A204914 *)
    v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]
    w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]
    d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]]
    Table[d[n], {n, 1, z2}]             (* A204915 *)
    k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]
    m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]
    j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2
    Table[k[n], {n, 1, z2}]             (* A204916 *)
    Table[j[n], {n, 1, z2}]             (* A204917 *)
    Table[s[k[n]], {n, 1, z2}]          (* A204918 *)
    Table[s[j[n]], {n, 1, z2}]          (* A204919 *)
    Table[s[k[n]] - s[j[n]], {n, 1, z2}]     (* A204920 *)
    Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A204921 *)

A204911 The prime q>=5 such that n divides p-q, where p>q is the least prime for which such a prime q exists.

Original entry on oeis.org

5, 5, 5, 7, 7, 5, 5, 5, 5, 7, 7, 5, 5, 5, 7, 7, 7, 5, 5, 11, 5, 7, 7, 5, 11, 5, 5, 13, 13, 7, 5, 5, 5, 7, 13, 5, 5, 5, 5, 7, 7, 5, 11, 17, 7, 7, 7, 5, 5, 11, 5, 7, 7, 5, 17, 5, 13, 13, 13, 7, 5, 5, 5, 7, 7, 5, 5, 5, 11, 13, 7, 7, 5, 5, 7, 7, 13, 5, 5, 17, 5, 7, 7, 5, 11, 11, 5, 13, 13, 7, 11, 5, 5
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Crossrefs

Programs

  • Maple
    f:= proc(n) local V,q,r;
      V:= Array(0..n-1); q:= 4;
      do
       q:= nextprime(q);
       r:= q mod n;
       if V[r] = 0 then V[r]:= q
       else return V[r]
       fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 24 2018
  • Mathematica
    (See the program at A204908.)
  • Python
    from sympy import nextprime
    def a(n):
        V, q = [0 for _ in range(n)], 4
        while True:
            q = nextprime(q)
            r = q%n
            if V[r] == 0: V[r] = q
            else: return int(V[r])
    print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Jun 25 2024 after Robert Israel

Extensions

More terms from Robert G. Wilson v, Jul 24 2018

A204914 Ordered differences of squared primes.

Original entry on oeis.org

5, 21, 16, 45, 40, 24, 117, 112, 96, 72, 165, 160, 144, 120, 48, 285, 280, 264, 240, 168, 120, 357, 352, 336, 312, 240, 192, 72, 525, 520, 504, 480, 408, 360, 240, 168, 837, 832, 816, 792, 720, 672, 552, 480, 312, 957, 952, 936, 912, 840, 792, 672
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Examples

			a(1) = s(2) - s(1) =  9 - 4 =  5;
a(2) = s(3) - s(1) = 25 - 4 = 21;
a(3) = s(3) - s(2) = 25 - 9 = 16;
a(4) = s(4) - s(1) = 49 - 4 = 45.
		

Crossrefs

Programs

  • Mathematica
    (See the program at A204916.)
  • Python
    from math import isqrt
    from sympy import prime, primerange
    def aupton(terms):
      sqps = [p*p for p in primerange(1, prime(isqrt(2*terms)+1)+1)]
      return [b-a for i, b in enumerate(sqps) for a in sqps[:i]][:terms]
    print(aupton(52)) # Michael S. Branicky, May 21 2021

A204928 s(k(n)) - s(j(n)), where (s(k(n)), s(j(n))) is the least pair of distinct Fibonacci numbers for which n divides s(k(n)) - s(j(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 18, 10, 11, 12, 13, 42, 225, 16, 34, 18, 19, 20, 21, 88, 230, 144, 50, 26, 54, 84, 29, 2550, 31, 32, 33, 34, 17710, 144, 555, 76, 4173, 2440, 123, 42, 86, 88, 225, 230, 47, 144, 343, 50, 2550, 52, 53, 54, 55, 2576, 228, 232, 121304
Offset: 1

Author

Clark Kimberling, Jan 21 2012

Keywords

Comments

The ordering of the pairs (s(k(n)), s(j(n))) is given by A204922. For a guide to related sequences, see A204892.

Crossrefs

Programs

  • Mathematica
    (See the program at A204924.)

A204898 Ordered differences of odd primes.

Original entry on oeis.org

2, 4, 2, 8, 6, 4, 10, 8, 6, 2, 14, 12, 10, 6, 4, 16, 14, 12, 8, 6, 2, 20, 18, 16, 12, 10, 6, 4, 26, 24, 22, 18, 16, 12, 10, 6, 28, 26, 24, 20, 18, 14, 12, 8, 2, 34, 32, 30, 26, 24, 20, 18, 14, 8, 6, 38, 36, 34, 30, 28, 24, 22, 18, 12, 10, 4, 40, 38, 36, 32, 30, 26, 24
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Crossrefs

Programs

  • Mathematica
    (See the program at A204900.)

A204903 The odd prime q such that n divides p-q, where p>q is the least prime for which such a prime q exists.

Original entry on oeis.org

3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 7, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 7, 7, 5, 3, 3, 5, 3, 3, 7, 5, 5, 5, 3, 3, 5, 5, 3, 5, 3, 7, 5, 3, 3, 7, 7, 3, 5, 3, 3, 5, 7, 3, 5, 3, 3, 13, 3, 13, 7, 5, 5, 5, 3, 7, 5, 3, 3, 11, 3, 7, 7, 3, 5, 7, 3, 3, 5, 5, 3, 5, 7, 7, 5, 3, 3, 5, 13, 3, 7
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Crossrefs

Programs

  • Mathematica
    (See the program at A204900.)

A204910 Least prime p such that n divides p-q for some prime q satisfying 5<=q

Original entry on oeis.org

7, 7, 11, 11, 17, 11, 19, 13, 23, 17, 29, 17, 31, 19, 37, 23, 41, 23, 43, 31, 47, 29, 53, 29, 61, 31, 59, 41, 71, 37, 67, 37, 71, 41, 83, 41, 79, 43, 83, 47, 89, 47, 97, 61, 97, 53, 101, 53, 103, 61, 107, 59, 113, 59, 127, 61, 127, 71, 131, 67, 127, 67, 131, 71, 137, 71, 139, 73, 149, 83, 149, 79
Offset: 1

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,k;
      p:= n+4;
      do
        p:= nextprime(p);
        if ormap(isprime, [seq(p-n*k,k=1..(p-5)/n)]) then return p fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jun 27 2019
  • Mathematica
    (See the program at A204908.)

Extensions

More terms from Robert Israel, Jun 27 2019
Showing 1-10 of 22 results. Next