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.

A375752 a(n) is the difference between T=n*(n+1)/2 and the largest prime not exceeding T.

This page as a plain text file.
%I A375752 #18 Sep 27 2024 16:33:26
%S A375752 0,1,3,2,2,5,5,2,2,5,5,2,2,7,5,2,4,9,11,2,2,5,7,8,2,5,5,2,2,5,5,4,2,
%T A375752 11,5,2,2,7,9,2,16,5,7,2,12,5,5,2,16,5,5,2,2,9,13,16,2,11,7,2,2,5,11,
%U A375752 2,4,5,5,4,8,5,7,2,8,7,9,2,2,23,11,2,12,17,11,12,2
%N A375752 a(n) is the difference between T=n*(n+1)/2 and the largest prime not exceeding T.
%F A375752 a(n) = A000217(n) - A065384(n). - _Michel Marcus_, Aug 27 2024
%t A375752 Table[T=n(n+1)/2;T-If[PrimeQ[T],T,NextPrime[T,-1]],{n,2,86}] (* _James C. McMahon_, Sep 27 2024 *)
%o A375752 (PARI) a(n) = my(t=n*(n+1)/2); t - precprime(t)
%o A375752 (Python)
%o A375752 from sympy import prevprime
%o A375752 def A375752(n): return (t:=n*(n+1)//2) - prevprime(t) # _Karl-Heinz Hofmann_, Aug 27 2024
%Y A375752 Cf. A000217, A007917, A065384, A075402, A375753, A375754.
%K A375752 nonn,easy
%O A375752 2,3
%A A375752 _Hugo Pfoertner_, Aug 26 2024