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-6 of 6 results.

A085416 Take prime[n] and continue adding 1,2,..., A085415(n) until one reaches a prime a(n).

Original entry on oeis.org

3, 13, 11, 13, 17, 19, 23, 29, 29, 107, 37, 43, 47, 53, 53, 59, 137, 67, 73, 107, 79, 89, 89, 167, 103, 107, 109, 113, 137, 149, 137, 137, 173, 149, 227, 157, 163, 173, 173, 179, 257, 191, 197, 199, 233, 227, 239, 229, 233, 239, 239, 317, 251, 257, 263, 269, 347
Offset: 1

Views

Author

Zak Seidov, Jun 29 2003

Keywords

Comments

Primes resulting in procedure of A085415. See also A085417, A085418.

Examples

			a(2)=13 because prime[2]=3 and 3+(1+2+3+4)=3+10=13 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Prime[n]+Accumulate[Range[20]],PrimeQ],{n,60}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 11 2019 *)

A085417 Take prime[n] and continue adding n,n+1,..., n+a(n)-1 until one reaches a prime.

Original entry on oeis.org

1, 1, 3, 1, 3, 1, 3, 9, 3, 5, 3, 5, 3, 12, 4, 9, 3, 1, 3, 4, 3, 1, 4, 1, 7, 1, 7, 5, 3, 4, 3, 1, 3, 1, 3, 8, 3, 9, 7, 5, 4, 1, 8, 12, 4, 4, 15, 1, 8, 21, 3, 5, 24, 9, 12, 8, 3, 4, 3, 9, 11, 4, 3, 5, 48, 1, 7, 33, 3, 1, 3, 1, 15, 12, 3, 5, 8, 5, 3, 36, 19, 1, 3, 5, 11, 5, 12, 5, 4, 4, 3, 1, 3, 5, 3, 1, 15, 1
Offset: 1

Views

Author

Zak Seidov, Jun 30 2003

Keywords

Comments

Primes obtained are in A085418. See also A085415, A085416.
No terms == 2 (mod 4). - Robert Israel, Mar 24 2023

Examples

			a(3)=3 because prime[3]=5 and 5+(3+4+5)=17= is a prime A085418(3).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m,k,x;
      m:= ithprime(n) - (n-1)*n/2;
      for k from n do
        x:= k*(k+1)/2 + m;
        if isprime(x) then return k+1-n fi
      od;
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 24 2023

A085418 Primes reached in A085417.

Original entry on oeis.org

3, 5, 17, 11, 29, 19, 41, 127, 53, 89, 67, 107, 83, 277, 113, 233, 113, 79, 127, 157, 139, 101, 181, 113, 293, 127, 313, 257, 199, 239, 223, 163, 239, 173, 257, 467, 271, 541, 461, 383, 349, 223, 563, 787, 383, 389, 1021, 271, 647, 1489, 389, 509, 1789, 773, 983
Offset: 1

Views

Author

Zak Seidov, Jun 30 2003

Keywords

Examples

			a(3)=17 because prime[3]=5 and 5+(3+4+5)=17 is a prime.
		

Crossrefs

A249112 Second smallest k > 0 such that n+(1+2+...+k) is prime.

Original entry on oeis.org

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

Views

Author

Gil Broussard, Oct 21 2014

Keywords

Comments

Take the counting numbers and continue adding 1, 2, ..., a(n) until reaching a second prime.
Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014
It appears that the minimum value reached by a(n) is 2, and this occurs for n= 2, 4, 10, 16, 28, 40, 58, 70, ... Is this A144834? - Michel Marcus, Oct 26 2014

Examples

			a(3)=7 because 3+1+2+3+4+5+6+7=31 and one partial sum is prime.
a(4)=2 because 4+1=5 and 4+1+2=7.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; Do[k++; While[! PrimeQ[n + Total@ Range@ k], k++], {x, 2}]; k, {n, 77}] (* Michael De Vlieger, Jan 03 2016 *)
  • PARI
    a(n)=my(k, s=2); while(s, if(isprime(n+=k++), s--)); k \\ Charles R Greathouse IV, Oct 21 2014
    
  • PARI
    a(n,s=2)=my(k);until(isprime(n+=k++)&&!s--,);k \\ allows one to get A249113(n) as a(n,3). - M. F. Hasler, Oct 21 2014

Formula

n+A000217(k) is prime for k=a(n) and exactly one smaller positive value. - M. F. Hasler, Oct 21 2014

A249113 Take n and successively add 1, 2, ..., a(n) until reaching a prime for the third time.

Original entry on oeis.org

4, 5, 16, 5, 11, 13, 8, 6, 19, 6, 12, 13, 7, 9, 28, 5, 11, 13, 12, 17, 19, 6, 11, 25, 8, 6, 28, 5, 20, 37, 7, 14, 19, 10, 11, 34, 8, 6, 40, 6, 20, 25, 8, 9, 31, 6, 11, 25, 19, 21, 19, 6, 12, 25, 16, 9, 28, 5, 20, 22, 7, 14, 40, 9, 11, 34, 19, 6, 52, 17, 12
Offset: 1

Views

Author

Gil Broussard, Oct 21 2014

Keywords

Comments

Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014

Examples

			a(1)=4 because 1+1+2+3+4=11 and exactly two partial sums are prime (2,7).
a(2)=5 because 2+1+2+3+4+5=17 and exactly two partial sums are prime (3,5).
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; Do[k++; While[! PrimeQ[n + Total@ Range@ k], k++], {x, 3}]; k, {n, 71}] (* Michael De Vlieger, Jan 03 2016 *)
  • PARI
    a(n)=my(k,s=3); while(s,if(isprime(n+=k++),s--));k \\ Charles R Greathouse IV, Oct 21 2014
    
  • PARI
    a(n,s=3)=my(k);until(isprime(n+=k++)&&!s--,);k \\ allows one to get A249112(n) as a(n,2). - M. F. Hasler, Oct 21 2014

Formula

n+A000217(k) is prime for k=a(n) and exactly two smaller positive values. - M. F. Hasler, Oct 21 2014

A249114 Take the counting numbers and continue adding 1, 2, ..., a(n) until one reaches a fourth prime.

Original entry on oeis.org

7, 6, 19, 10, 12, 25, 11, 9, 40, 13, 15, 25, 11, 17, 67, 6, 15, 22, 15, 18, 43, 9, 12, 34, 12, 9, 31, 9, 32, 58, 8, 21, 28, 14, 12, 37, 11, 9, 55, 13, 23, 46, 11, 14, 43, 10, 15, 34, 24, 26, 28, 9, 15, 37, 23, 18, 40, 6, 24, 61, 8, 18, 43, 22, 27, 37, 20, 9
Offset: 1

Views

Author

Gil Broussard, Oct 21 2014

Keywords

Comments

Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014
It appears that the minimum value reached by a(n) is 6. This occurs for n=2, 16, 58, 136, 178, 418, 598, 808, ... . - Michel Marcus, Oct 26 2014
The conjecture in the previous line is true - if n is odd, then n+1 is even, n+3 is even, n+6 and n+10 are odd, etc., so a(n)>6. If n is even, then +1 and +3 are odd, +6, +10 are even, so the fourth prime can be first for a(n)=6. - Jon Perry, Oct 29 2014
Conjecture: a(n) is odd approximately 50% of the time. - Jon Perry, Oct 29 2014

Examples

			a(1) = 7 because 1+1+2+3+4+5+6+7 = 29 and exactly three partial sums are prime (2,7,11).
a(2) = 6 because 2+1+2+3+4+5+6 = 23 and exactly three partial sums are prime (3,5,17).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local j,count;
          count:= 0;
          for j from 1 do
            if isprime(n + j*(j+1)/2) then
               count:= count+1;
               if count = 4 then return j fi
            fi
          od
    end proc:
    seq(f(n),n=1..100); # Robert Israel, Oct 29 2014
  • Mathematica
    a[n_] := Module[{j, cnt = 0}, For[j = 1, True, j++, If[PrimeQ[n+j(j+1)/2], cnt++; If[cnt == 4, Return[j]]]]];
    Array[a, 100] (* Jean-François Alcover, Oct 03 2020, after Maple *)
  • PARI
    a(n)=my(k, s=4); while(s, if(isprime(n+=k++), s--)); k \\ Charles R Greathouse IV, Oct 21 2014

Formula

a(n) = Min_{k>0 | { n+A000217(j), j=1...k} contains four primes}. - M. F. Hasler, Oct 29 2014
Showing 1-6 of 6 results.