%I #8 Sep 30 2024 12:56:35
%S 6,4,12,6,18,21,9,370,30,12,405,39,15,45,231,18,2619,2772,21,205,596,
%T 69,72,26,154,81,574,30,441,93,315,34,102,105,108,111,39,1377,120,42,
%U 1485,129,45,1990,138,465,144,50,150,4564,515,19684,1120,56,334,846,861,60,180,5474,186,64,192,195
%N a(n) is the least n-gonal number that is an interprime, i.e. the average of two consecutive primes.
%C a(n) is the first number of the form ((n-2)*k^2 - (n-4)*k)/2 for k >= 0 that is in A024675.
%C a(n) = n if n is in A024675.
%H Robert Israel, <a href="/A376614/b376614.txt">Table of n, a(n) for n = 3..10000</a>
%e 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.
%p f:= proc(s) local n,x;
%p for n from 1 do
%p x:= ((s-2)*n^2 - (s-4)*n)/2;
%p if x >= 4 and not isprime(x) and prevprime(x) + nextprime(x) = 2*x then return x fi
%p od
%p end proc:
%p map(f, [$3..100]);
%Y Cf. A024675, A000326, A086270.
%K nonn
%O 3,1
%A _Robert Israel_, Sep 29 2024