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

A203836 Smallest sum s of two consecutive primes such that s = 0 mod prime(n).

Original entry on oeis.org

8, 12, 5, 42, 198, 52, 68, 152, 138, 696, 186, 222, 410, 172, 564, 1272, 472, 1220, 268, 852, 1460, 2212, 1494, 712, 1164, 1818, 618, 1284, 872, 2486, 508, 786, 548, 1668, 1192, 906, 3768, 978, 668, 6228, 3222, 6516, 3820, 772, 4728, 3980, 6330, 892, 5448, 1374
Offset: 1

Views

Author

Zak Seidov, Jan 06 2012

Keywords

Comments

Besides a(3)=5, all terms are even and >=4. - Zak Seidov, Nov 29 2014

Examples

			a(1) = 8 = 3 + 5 is the least sum of two consecutive primes that is a multiple of prime(1) = 2.
a(3) = 5 = 2 + 3 is the least sum of two consecutive primes that is a multiple of prime(3) = 5.
		

Crossrefs

Cf. A001043, A062703, A111163, A247245, A247252, A188815 (the smaller prime), A118134.

Programs

  • Maple
    N := 100: # for a(1)..a(N)
    M := ithprime(N):
    V := Vector(M):
    count:= 0:
    for i from 1 while count < N do
      x:= ithprime(i)+ithprime(i+1);
      Q:= convert(select(t -> t <= M and V[t]=0, numtheory:-factorset(x)), list);
      V[Q]:= x;
      count:= count + nops(Q);
    od:
    seq(V[ithprime(i)], i=1..N); # Robert Israel, May 25 2020
  • Mathematica
    pr=Prime[Range[1000]];rm=Rest[pr]+Most[pr];Table[Select[rm,Mod[#,pr[[n]]]==0&][[1]],{n,50}]
    s = Total /@ Partition[Prime@ Range[10^4], 2, 1]; Table[SelectFirst[s, Divisible[#, Prime@ n] &], {n, 52}] (* Michael De Vlieger, Jul 04 2017 *)
  • PARI
    a(n)=p = 2; pn = prime(n); forprime(q=3, , if (((s=p+q) % pn) == 0, return (s)); p = q;); \\ Michel Marcus, Jul 04 2017
    
  • PARI
    isA001043(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2
    a(n,p=prime(n))=if(p==5, return(5)); my(k=2); while(!isA001043(k*p), k+=2); k*p \\ Charles R Greathouse IV, Jul 05 2017

Formula

a(n) = 4*prime(n) if prime(n) is in A118134. - Robert Israel, May 25 2020

A247252 Smallest integer k>=1 such that k*prime(n) is the sum of two successive primes.

Original entry on oeis.org

4, 4, 1, 6, 18, 4, 4, 8, 6, 24, 6, 6, 10, 4, 12, 24, 8, 20, 4, 12, 20, 28, 18, 8, 12, 18, 6, 12, 8, 22, 4, 6, 4, 12, 8, 6, 24, 6, 4, 36, 18, 36, 20, 4, 24, 20, 30, 4, 24, 6, 16, 52, 6, 18, 6, 30, 42, 18, 30, 24, 4, 6, 24, 6, 6, 8, 8, 6, 12, 12, 24, 8, 26, 12, 10, 16, 6, 12, 8, 42, 14, 10, 18, 6, 8, 12, 30, 36, 48, 22, 12, 14, 4, 12, 20, 16, 6, 6, 6, 20
Offset: 1

Views

Author

Zak Seidov, Nov 29 2014

Keywords

Comments

Except for a(3)=1, all terms are even and >= 4.

Examples

			If n=1, prime(1)=2, and 4*2 = 8 = 3+5 is the sum of two consecutive primes, thus a(1) = 4.
		

Crossrefs

Formula

a(n) = A203836(n)/prime(n).

A260966 a(0)=1, then a(n) is the least sum of two successive primes that is a multiple of n and > a(n-1).

Original entry on oeis.org

1, 5, 8, 12, 24, 30, 36, 42, 112, 144, 210, 308, 360, 390, 434, 450, 480, 918, 990, 1064, 1120, 1428, 1518, 1656, 1848, 1900, 2132, 2430, 2604, 2610, 2640, 2728, 2912, 2970, 2992, 3010, 3240, 3330, 3952, 4056, 4680, 5740, 6090, 6450, 6600, 6660, 6762, 7990, 8256, 8428, 9000, 9282, 9308
Offset: 0

Views

Author

Zak Seidov, Aug 06 2015

Keywords

Examples

			a(1)=5=2+3, a(2)=8=3+5, a(3)=12=5+7, a(4)=24=11+13, a(5)=30=13+17.
		

Crossrefs

Programs

  • Maple
    N:= 10^5: # get all terms using primes <= N
    Primes:= select(isprime,[2,(2*i+1 $ i=1..floor((N-1)/2))]):
    Sprimes:= Primes[1..-2] + Primes[2..-1]:
    A[0]:= 1: x[0]:= 0: ok:= true:
    for n from 1 while ok do
      ok:= false;
      for t from x[n-1]+1 to nops(Sprimes) do
        if Sprimes[t] mod n = 0 then
          A[n]:= Sprimes[t]; x[n]:= t; ok:= true; break
        fi
      od
    od:
    seq(A[i],i=0..n-2); # Robert Israel, Aug 06 2015
  • Mathematica
    Prepend[Reap[n=1;Do[If[Mod[(a=Prime[k]+Prime[k+1]),n]<1,Sow[a];i++],{k,1000}]][[2,1]],1]
    nxt[{n_,a_}]:=Module[{sprs=Total/@Partition[Prime[Range[1000]],2,1]},{n+1, SelectFirst[sprs,Divisible[#,n+1]&&#>a&]}]; Transpose[ NestList[ nxt,{0,1},60]][[2]] (* Harvey P. Dale, Jun 02 2016 *)
Showing 1-3 of 3 results.