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.

A376614 a(n) is the least n-gonal number that is an interprime, i.e. the average of two consecutive primes.

Original entry on oeis.org

6, 4, 12, 6, 18, 21, 9, 370, 30, 12, 405, 39, 15, 45, 231, 18, 2619, 2772, 21, 205, 596, 69, 72, 26, 154, 81, 574, 30, 441, 93, 315, 34, 102, 105, 108, 111, 39, 1377, 120, 42, 1485, 129, 45, 1990, 138, 465, 144, 50, 150, 4564, 515, 19684, 1120, 56, 334, 846, 861, 60, 180, 5474, 186, 64, 192, 195
Offset: 3

Views

Author

Robert Israel, Sep 29 2024

Keywords

Comments

a(n) is the first number of the form ((n-2)*k^2 - (n-4)*k)/2 for k >= 0 that is in A024675.
a(n) = n if n is in A024675.

Examples

			a(5) = 12 because 12 = A000326(3) is a pentagonal number and is the average of consecutive primes 11 and 13, and neither of the previous pentagonal numbers (1 and 5) are averages of consecutive primes.
		

Crossrefs

Programs

  • Maple
    f:= proc(s) local n,x;
       for n from 1 do
         x:= ((s-2)*n^2 - (s-4)*n)/2;
         if x >= 4 and not isprime(x) and prevprime(x) + nextprime(x) = 2*x then return x fi
       od
    end proc:
    map(f, [$3..100]);