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.
%I A102552 #34 Feb 02 2025 15:35:31 %S A102552 0,-1,1,-1,1,-1,-1,2,-2,1,1,-1,-1,0,2,-2,1,1,-2,1,-1,-1,2,1,-1,1,-1, %T A102552 -5,5,-1,2,-4,4,-2,0,1,-1,0,2,-4,4,-1,1,-5,0,4,1,-1,-1,2,-4,2,0,0,2, %U A102552 -2,1,1,-4,-2,5,1,-1,-5,4,-2,4,-1,-1,-1,1,0,1,-1,-1,2,-2,-1,4,-4,4,-2,1,-1,-1,2,1,-1,-4,2,2,-2,2,-1,-3,5,-8,6,-2,2,0,2,-2 %N A102552 a(n) = prime(n) - (prime(n+1) + prime(n-1))/2. %D A102552 Eric Weisstein, CRC Concise Encyclopedia of Mathematics, 1998, page 1321. %H A102552 G. C. Greubel, <a href="/A102552/b102552.txt">Table of n, a(n) for n = 3..10000</a> %F A102552 a(n) = (1/2)*(A001223(n) - A001223(n+1)). %F A102552 a(n) = -A036263(n-1)/2. - _T. D. Noe_, Oct 06 2006 [corrected by _Georg Fischer_, Oct 19 2023] %e A102552 a(6)=-1 because 13-(17+11)/2=-1. %p A102552 a:=n->ithprime(n)-(ithprime(n+1)+ithprime(n-1))/2: seq(a(n),n=3..95); # _Emeric Deutsch_, Mar 02 2005 %t A102552 f[n_] := Prime[n] - (Prime[n - 1] + Prime[n + 1])/2; Table[f[n], {n, 3, 107}] (* _Robert G. Wilson v_, Sep 25 2006 *) %t A102552 #[[2]]-(#[[1]]+#[[3]])/2&/@Partition[Prime[Range[2,110]],3,1] (* _Harvey P. Dale_, Sep 21 2013 *) %o A102552 (PARI) a(n) = prime(n)-(prime(n+1)+prime(n-1))/2; %o A102552 vector(100,n,a(n+2)) \\ _Joerg Arndt_, Jan 20 2015 %o A102552 (Python) %o A102552 from sympy import sieve as p %o A102552 def A102552(n): return p[n]-(p[n+1]+p[n-1])//2 # _Karl-Heinz Hofmann_, May 22 2024 %o A102552 (Magma) %o A102552 A102552:= func< n | (2*NthPrime(n)-NthPrime(n+1)-NthPrime(n-1))/2 >; %o A102552 [A102552(n): n in [3..120]]; // _G. C. Greubel_, Feb 02 2025 %Y A102552 Cf. A000040, A006562, A036263, A051634, A051635, A066875. %K A102552 sign %O A102552 3,8 %A A102552 _Yasutoshi Kohmoto_, Feb 25 2005 %E A102552 More terms from _Emeric Deutsch_, Mar 02 2005