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

A229019 Minimal position at which the sequence defined in the same way as A159559 but with initial term prime(n) merges with A159559; a(n)=0 if there is no such position.

Original entry on oeis.org

2, 11, 47, 47, 47, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 6257, 6257, 6257, 6257, 6257, 6257, 6257, 6257, 390703, 390703, 390703, 390703, 390703, 390703, 390703, 390703
Offset: 2

Views

Author

Vladimir Shevelev, Sep 11 2013

Keywords

Comments

All positive terms of the sequence are prime.
Conjecture: all terms are positive.

Examples

			For n>=2, denote by A_n the sequence defined in the same way as A159559 but with initial term A_n(2)=prime(n). In case n=2 A_2(2)=3, hence A_2 = A159559, and so a(2)=2. Suppose n=3. Then A_3(2)=5 and by the definition of A159559 we have A_3(3)=7, A_3(4)=8, A_3(5)=11, A_3(6)=12, A_3(7)=13, A_3(8)=14, A_3(9)=15, A_3(10)=16, A_3(11)=17. Since A159559(11) is also 17, then, beginning with 11, A_3 merges with A159559 and a(3)=11. - _Vladimir Shevelev_, Sep 11 2016.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p) option remember; local m;
          if n=2 then p
        else for m from b(n-1,p)+1 while isprime(m) xor isprime(n)
             do od; m
          fi
        end:
    a:= proc(n) option remember; local k;
          for k from 2 while b(k, 3)<>b(k, ithprime(n)) do od; k
        end:
    seq(a(n), n=2..20);  # Alois P. Heinz, Sep 15 2013
  • Mathematica
    f[n_, r_] := Block[{a}, a[2] = n; a[x_] := a[x] = If[PrimeQ@ x, NextPrime@ a[x - 1], NestWhile[# + 1 &, a[x - 1] + 1, PrimeQ@ # &]]; Map[a, Range[2, r]]]; nn = 10^4; t = f[3, nn]; Table[1 + First@ Flatten@ Position[BitXor[t, f[Prime@ n, nn]], 0], {n, 2, 37}] (* Michael De Vlieger, Sep 13 2016, after Peter J. C. Moses at A159559 *)

Extensions

More terms from Alois P. Heinz, Sep 15 2013

A276703 Let A_n be the sequence defined in the same way as A159559 but with initial term prime(n), n>=2; a(n) = max(A_n(m) - A159559(m)), m>=2.

Original entry on oeis.org

0, 4, 14, 14, 14, 70, 70, 70, 90, 90, 90, 90, 90, 90, 90, 90, 90, 121, 121, 121, 121, 121, 121, 126, 126, 126, 126, 126, 172, 172, 172, 172, 172, 172, 174, 174, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260
Offset: 2

Views

Author

Vladimir Shevelev, Sep 15 2016

Keywords

Comments

It is clear that m<=A229019(n).

Examples

			A_3(2)=5 and, by the definition of A159559 we have A_3(3)=7, A_3(4)=8, A_3(5)=11, A_3(6)=12, A_3(7)=13, A_3(8)=14, A_3(9)=15, A_3(10)=16, A_3(11)=17. Since A229019(3)=11, then comparing with the first 11 terms of A159559, we conclude that a(3)=A_3(5)-A_2(5)=4.
		

Crossrefs

Extensions

More terms from Peter J. C. Moses, Sep 15 2016

A276676 Triangle read by rows: T(n,k) (n>=2, k=2,...,n) is the minimal position at which the sequence A_n merges with the sequence A_k, where A_n be the sequence defined in the same way as A159559 but with initial term prime(n).

Original entry on oeis.org

2, 11, 2, 47, 47, 2, 47, 47, 11, 2, 47, 47, 17, 17, 2, 683, 683, 683, 683, 683, 2, 683, 683, 683, 683, 683, 11, 2, 683, 683, 683, 683, 683, 17, 17, 2, 683, 683, 683, 683, 683, 467, 467, 467, 2, 683, 683, 683, 683, 683, 467, 467, 467, 11, 2, 683, 683, 683, 683, 683, 467, 467, 467, 79, 79, 2
Offset: 2

Views

Author

Vladimir Shevelev, Sep 13 2016

Keywords

Examples

			Triangle begins
2;
11,2;
47,47,2;
47,47,11,2;
47,47,17,17,2;
683,683,683,683,683,2;
683,683,683,683,683,11,2;
683,683,683,683,683,17,17,2;
683,683,683,683,683,467,467,467,2;
683,683,683,683,683,467,467,467,11,2;
683,683,683,683,683,467,467,467,79,79,2;
683,683,683,683,683,467,467,467,79,79,17,2;
683,683,683,683,683,467,467,467,79,79,41,41,2;
683,683,683,683,683,467,467,467,79,79,41,41,11,2;
683,683,683,683,683,467,467,467,79,79,41,41,17,17,2;
683,683,683,683,683,467,467,467,107,107,107,107,107,107,107,2;
683,683,683,683,683,467,467,467,107,107,107,107,107,107,107,11,2;
The first column forms A229019.
		

Crossrefs

Cf. A159559, A229019 (the first column), A229132.

Programs

  • Mathematica
    f[n_, r_] := Block[{a}, a[2] = n; a[x_] := a[x] = If[PrimeQ@ x, NextPrime@ a[x - 1], NestWhile[# + 1 &, a[x - 1] + 1, PrimeQ@ # &]]; Map[a, Range[2, r]]]; nn = 10^4; Table[1 + First@ Flatten@ Position[BitXor[f[Prime@ n, nn], f[Prime@ k, nn]], 0], {n, 2, 12}, {k, 2, n}] // Flatten (* Michael De Vlieger, Sep 13 2016, after Peter J. C. Moses at A159559 *)

Extensions

More terms from Peter J. C. Moses, Sep 13 2016

A276767 Let A_n be the sequence defined in the same way as A159559 but with initial term prime(n), n>=2; a(n) is the smallest m such that for i>=2, A_n(i) - A_2(i) <= A_n(m) - A_2(m).

Original entry on oeis.org

2, 5, 17, 17, 17, 359, 359, 359, 163, 163, 163, 163, 163, 163, 163, 163, 163, 448, 448, 448, 448, 448, 448, 71, 71, 71, 17, 17, 443, 443, 443, 443, 443, 443, 37, 37, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2789
Offset: 2

Views

Author

Vladimir Shevelev, Sep 17 2016

Keywords

Comments

By definition, A_2 = A159559.

Examples

			Let n=4. Set r(i)= A_4(i)- A_2(i), i>=2. Then, by the definition of A_4 and A_2, we have
r(2)=7-3=4,
r(3)=11-5=6, further,
r(4)=...=r(12)=6,
r(13)=r(14)=10,
r(15)=r(16)=11,
r(17)=r(18)=14,
r(19)=...=r(22)=12,
r(23)=...r(26)=10,
r(27)=9,
r(28)=8,
r(29)=...=r(32)=6,
r(33)=...=r(36)=7,
r(37)=r(38)=8,
r(39)=r(40)=7,
r(41)=r(42)=4,
r(43)=r(44)=2,
r(45)=r(46)=1
r(n)=0, n>=47.
So max r(i)=14 and the smallest m such that r(m)=14 is 17.
Thus a(4)=17.
		

Crossrefs

Extensions

More terms from Peter J. C. Moses, Sep 17 2016

A276826 a(n) is the maximal difference between the corresponding terms of sequences defined in the same way as A159559, but with initial terms A001359(n-1)+2 and A001359(n-1) respectively.

Original entry on oeis.org

4, 14, 6, 6, 6, 12, 6, 8, 14, 14, 18, 36, 24, 65, 18, 6, 10, 6, 84, 14, 162, 10, 54, 84, 179, 10, 23, 12, 18, 18, 24, 128, 18, 24, 28, 10, 10, 72, 34, 23, 12, 18, 6, 6, 12, 34, 8, 644, 12, 12, 6, 29, 24, 12, 18, 28, 28, 24, 22, 22, 10, 14, 12, 12, 16, 6, 58
Offset: 2

Views

Author

Vladimir Shevelev, Sep 19 2016

Keywords

Comments

It seems likely that 6 occurs infinitely often.

Examples

			Since A276703(3)=4 (cf. example there), a(2)=4.
		

Crossrefs

Extensions

More terms from Peter J. C. Moses, Sep 19 2016

A277118 For a lesser p of twin primes, let B_k be A159559, but with initial term k; then a(n) is the smallest m such that B_(p+2)(m)-B_p(m)>6, where p = A001359(n-1), or a(n) = 0 if there is no such m.

Original entry on oeis.org

0, 13, 0, 0, 0, 9, 0, 11, 11, 5, 3, 15, 3, 7, 3, 0, 3, 0, 3, 5, 7, 3, 11, 5, 3, 5, 11, 3, 9, 3, 3, 7, 3, 5, 5, 3, 5, 3, 5, 11, 3, 5, 0, 0, 5, 5, 7, 5, 13, 7, 0, 5, 3, 3, 3, 3, 7, 3, 3, 3, 5, 3, 7, 3, 3, 0, 3, 5, 5, 3, 11, 11, 5, 3, 5, 7, 5, 3, 0, 3, 3, 3, 3, 3
Offset: 2

Views

Author

Keywords

Comments

Theorem: a(n) takes only the values 0, 3, 5, 7, 9, 11, 13, 15, and 17.

Crossrefs

Programs

  • PARI
    nextcomposite(n)=if(n<4, return(4)); n=ceil(n); if(isprime(n), n+1, n)
    do(p)=my(a=p,b=p+2,f); for(n=3,17, f=if(isprime(n), nextprime, nextcomposite); a=f(a+1); b=f(b+1); if(b-a > 6, return(n))); 0
    p=2; forprime(q=3,1e3, if(q-p==2, print1(do(p)", ")); p=q) \\ Charles R Greathouse IV, Oct 17 2016

Formula

a(n) = 3 on a subsequence of measure 1. - Charles R Greathouse IV, Oct 17 2016

A229132 Initials for A159559 corresponding to records of A229019.

Original entry on oeis.org

3, 5, 7, 17, 67, 113, 163
Offset: 1

Views

Author

Vladimir Shevelev, Sep 15 2013

Keywords

Comments

Records of A229019 are 2, 11, 47, 683, 1117, 6257, 390703.

Examples

			If to take as the initial for A159559 a(4)=17, then we obtain a sequence which merges with A159559 for n equals the fourth record of A229019, that is, n=683.
		

Crossrefs

A276848 For a lesser p of twin primes, let B_(p+2) and B_p be sequences defined as A159559, but with initial terms p+2 and p respectively. The sequence lists p for which all differences B_(p+2)(n)-B_p(n)<=6.

Original entry on oeis.org

3, 11, 17, 29, 59, 227, 269, 1277, 1289, 1607, 2129, 2789, 3527, 3917, 4637, 4787, 5639, 8999, 13679, 14549, 18119, 27737, 36779, 38447, 39227, 44267, 62129, 71327, 75989, 80669, 83219, 88799, 93479, 97367, 99707, 113147, 113159, 115769, 122027, 122387, 124337, 124769, 132749, 150209, 160079
Offset: 1

Views

Author

Vladimir Shevelev, Sep 21 2016

Keywords

Comments

B_(p+2)(n) - B_p(n) < 6 for all n >= 2 if and only if p = 3.
It is astonishing that, although terms a(n) == 7 or 9 (mod 10) occur often, the first terms a(n)==1 (mod 10) are 11, 165701, ... (cf. A022009). This phenomenon is explained in the Shevelev link.

Crossrefs

Programs

  • PARI
    nextcomposite(n)=if(n<4, return(4)); n=ceil(n); if(isprime(n), n+1, n)
    is(n)=if(!isprime(n) || !isprime(n+2), return(0)); my(p=n,q=n+2,k=2,f); while(p!=q && q-p<7, f=if(isprime(k++),nextprime,nextcomposite); p=f(p+1); q=f(q+1)); p==q \\ Charles R Greathouse IV, Sep 21 2016

Extensions

More terms from Peter J. C. Moses, Sep 21 2016

A276831 For a lesser p=A001359(n-1), n>=2, of twin primes, let B_k be the sequence defined as A159559 but with initial term k; a(n) is the smallest m such that B_(p+2)(m)-B_p(m) = max_{t>=2} (B_(p+2)(t)-B_p(t)).

Original entry on oeis.org

5, 17, 11, 5, 3, 17, 3, 11, 11, 5, 31, 107, 13, 333, 17, 5, 3, 3, 281, 5, 997, 3, 487, 659, 5178, 5, 15, 3, 23, 53, 13, 1567, 13, 13, 181, 3, 5, 443, 37, 21, 19, 11, 5, 3, 5, 5, 7, 20786, 13, 7, 5, 21, 3, 5, 17, 61, 31, 23, 7, 3, 11, 5, 11, 5, 3, 3, 157, 37
Offset: 2

Views

Author

Vladimir Shevelev, Sep 20 2016

Keywords

Examples

			Let n=2, p=A001359(1)=3. Then B_3(2)=3, B_3(3)=5, B_3(4)=6, B_3(5)=7, B_3(6)=8, B_3(7)=11, B_3(8)=12, B_3(9)=14, B_3(10)=15, B_3(11)=17;
Further, B_5(2)=5, B_5(3)=7, B_5(4)=8, B_5(5)=11, B_5(6)=12, B_5(7)=13, B_5(8)=14, B_5(9)=15, B_5(10)=16, B_5(11)=17 and, beginning with t=11,
B_3 merges with B_5. So, max(B_5(t)-B_3(t))=4 reaching at t=5 and t=6.
Thus a(2)=min(5,6)=5.
		

Crossrefs

Formula

B_(p+2)(a(n)) - B_p(a(n)) = A276826(n).

Extensions

More terms from Peter J. C. Moses, Sep 20 2016

A277255 Let A_n defined in the same way as A159559, but with initial term prime(n); a(n) is the smallest number m such that A_(n+1)(m) - A_n(m) > 6 or a(n)=0 if there is no such m.

Original entry on oeis.org

0, 13, 0, 0, 9, 0, 0, 13, 0, 15, 0, 9, 0, 0, 11, 0, 17, 13, 11, 7, 5, 3, 2, 0, 11, 7, 5, 3, 2, 7, 5, 3, 2, 15, 0, 9, 0, 7, 5, 3, 2, 7, 5, 3, 2, 2, 9, 0, 7, 5, 3, 2, 0, 0, 11, 0, 7, 5, 3, 2, 2, 7, 5, 3, 2, 3, 2, 7, 5, 3, 2, 11, 7, 5, 3, 2, 3, 2, 2, 3, 2, 11, 7
Offset: 2

Views

Author

Keywords

Comments

A277118 is a subsequence. In contrast to A277118, the sequence contains some terms greater than 17. The first occurrence for 19 is n = 7061; the first occurrence for 21 is n = 214612 and the first occurrence for 23 is n = 30572.

Crossrefs

Formula

a(n)=2 if and only if prime(n+1) - prime(n) >=8.
Showing 1-10 of 22 results. Next