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.

A355849 a(n) is the least k > 1 such that k*n is the average of two consecutive primes.

Original entry on oeis.org

4, 2, 2, 3, 3, 2, 3, 7, 2, 3, 9, 5, 2, 3, 2, 4, 2, 4, 4, 3, 2, 7, 3, 3, 2, 10, 3, 2, 12, 2, 3, 2, 3, 3, 3, 2, 3, 2, 5, 3, 5, 10, 2, 4, 4, 3, 6, 3, 9, 3, 2, 5, 12, 2, 3, 10, 4, 6, 4, 2, 10, 3, 5, 3, 3, 3, 2, 8, 2, 6, 6, 2, 10, 5, 2, 3, 2, 4, 14, 2, 4, 3, 9, 5, 2, 12, 4, 2, 4, 2, 12, 6, 2, 3, 6, 2
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 28 2022

Keywords

Comments

a(n) is the least k > 1 such that k*n is in A024675.

Examples

			a(4) = 3 because 3*4 = 12 is the average of consecutive primes 11 and 13.
		

Crossrefs

Cf. A024675.

Programs

  • Maple
    M:= {seq((ithprime(i)+ithprime(i+1))/2, i=2..10^5)}:
    f:= proc(p) local k;
      for k from 2 do if member(k*p,M) then return k fi od
    end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_] := Module[{m = 2*n}, While[Plus @@ NextPrime[m, {-1, 1}] != 2*m, m += n]; m/n]; Array[a, 100] (* Amiram Eldar, Aug 05 2022 *)