OFFSET
1,1
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..10000
EXAMPLE
53 is in this sequence because 53 = prime(16) = (prime(15) + prime(17))/2 = (47 + 59)/2 and 53 = squarefree(33) = (squarefree(32) + squarefree(34))/2 = (51 + 55)/2.
MAPLE
Primes:= select(isprime, [$1..10^5]):
Sqfree:= select(numtheory:-issqrfree, [$1..10^5]):
A:= NULL:
for i from 2 to nops(Primes)-1 do
if Primes[i] = (Primes[i+1]+Primes[i-1])/2 then
member(Primes[i], Sqfree, 'j');
if Primes[i] = (Sqfree[j-1]+Sqfree[j+1])/2 then
A:= A, Primes[i]
fi
fi
od:
A; # Robert Israel, Aug 21 2014
PROG
(PARI)
maxp=60000;
p=[]; my(v=primes(maxp)); for(k=2, #v-1, if(2*v[k] == v[k-1]+v[k+1], p=concat(p, v[k]))); p;
v = select(n->issquarefree(n), vector(maxp, n, n));
s=[]; for(k=2, #v-1, if(2*v[k] == v[k-1]+v[k+1], s=concat(s, v[k]))); s;
setintersect(p, s) \\ Colin Barker, Aug 07 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jul 26 2014
EXTENSIONS
Missing term (16937) inserted by Colin Barker, Aug 07 2014
STATUS
approved