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.

A299251 a(n) = ((Sum_{k=1..floor((n+1)^2/4)} d(k)) - T(n)) / 2, where d(n) = number of divisors of n (A000005) and T(n) = the n-th triangular number (A000217).

This page as a plain text file.
%I A299251 #21 Oct 24 2023 02:14:36
%S A299251 0,0,1,2,4,7,11,15,21,28,37,45,55,67,80,95,110,127,146,164,187,209,
%T A299251 235,260,286,315,346,380,413,449,485,522,564,605,651,695,743,792,844,
%U A299251 898,950,1006,1064,1123,1185,1250,1318,1384,1451,1523,1596,1670,1747,1828
%N A299251 a(n) = ((Sum_{k=1..floor((n+1)^2/4)} d(k)) - T(n)) / 2, where d(n) = number of divisors of n (A000005) and T(n) = the n-th triangular number (A000217).
%C A299251 Twice this sequence is an attempt to find a counterpart to A161664: both compare triangular numbers T(n) and partial sums of numbers of divisors S(n). A161664 computes the excess of T(n) compared to S(n), whereas 2*a(n) computes the excess of S(n') compared to T(n), where n' is chosen equal to floor((n+1)^2/4). This choice appears structurally natural and economical when illustrated in a diagram. (See provided link.)
%H A299251 Luc Rousseau, <a href="/A299251/a299251.png">Accompanying diagram</a>
%F A299251 a(n) = (A006218(A002620(n + 1)) - A000217(n)) / 2.
%t A299251 F[n_] := Floor[(1/4)*n^2]
%t A299251 A[n_] := (Sum[DivisorSigma[0, k], {k, 1, F[n + 1]}] - n*(n + 1)/2)/2
%t A299251 Table[A[n], {n, 1, 100}]
%o A299251 (PARI)
%o A299251 f(n)=floor(n^2/4)
%o A299251 a(n)=(sum(k=1,f(n+1),numdiv(k))-n*(n+1)/2)/2
%o A299251 for(n=1,100,print1(a(n),", "))
%o A299251 (Python)
%o A299251 from math import isqrt
%o A299251 def A299251(n): return (-(s:=isqrt(m:=(n+1)**2>>2))**2-(n*(n+1)>>1)>>1)+sum(m//k for k in range(1,s+1)) # _Chai Wah Wu_, Oct 23 2023
%Y A299251 Cf. A000005, A000217, A002620, A006218, A161664.
%K A299251 nonn
%O A299251 1,4
%A A299251 _Luc Rousseau_, Feb 06 2018