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.

Showing 1-4 of 4 results.

A309176 a(n) = n^2 * (n + 1)/2 - Sum_{k=1..n} sigma_2(k).

Original entry on oeis.org

0, 0, 2, 3, 12, 13, 33, 40, 66, 81, 135, 135, 212, 249, 319, 354, 489, 511, 681, 725, 876, 981, 1233, 1235, 1509, 1660, 1920, 2032, 2437, 2472, 2936, 3091, 3488, 3755, 4275, 4290, 4955, 5292, 5854, 6024, 6843, 6968, 7870, 8190, 8839, 9340, 10420, 10442, 11568, 12038, 13014, 13474, 14851, 15098, 16436
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 15 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n^2 (n + 1)/2 - Sum[DivisorSigma[2, k], {k, 1, n}], {n, 1, 55}]
    nmax = 55; CoefficientList[Series[x (1 + 2 x)/(1 - x)^4 - 1/(1 - x) Sum[k^2 x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[Sum[Mod[n, k] k, {k, 1, n}], {n, 1, 55}]
  • PARI
    a(n) = n^2*(n+1)/2 - sum(k=1, n, sigma(k, 2)); \\ Michel Marcus, Sep 18 2021
    
  • Python
    from math import isqrt
    def A309176(n): return (n**2*(n+1)>>1)+((s:=isqrt(n))**2*(s+1)*(2*s+1)-sum((q:=n//k)*(6*k**2+q*(2*q+3)+1) for k in range(1,s+1)))//6 # Chai Wah Wu, Oct 21 2023

Formula

G.f.: x * (1 + 2*x)/(1 - x)^4 - (1/(1 - x)) * Sum_{k>=1} k^2 * x^k/(1 - x^k).
a(n) = Sum_{k=1..n} (n mod k) * k.
a(n) = A002411(n) - A064602(n).

A154586 Numbers n for which abs((-1)^k*Sum_{k=1..n} ((n-k+1) mod k)) = 0.

Original entry on oeis.org

1, 4, 8, 25, 27, 75, 209, 3507, 8466, 16179, 29285, 33987, 175904, 326764, 1161207
Offset: 1

Views

Author

Keywords

Comments

Subset of A154585.
a(16) > 10^7. - Donovan Johnson, Oct 03 2011

Examples

			n=8 -> abs(-(8 mod 1) + (7 mod 2) - (6 mod 3) + (5 mod 4) - (4 mod 5) + (3 mod 6) - (2 mod 7) + (1 mod 8)) = abs(-0 + 1 - 0 + 1 - 4 + 3 - 2 + 1) = abs(0) = 0.
		

Crossrefs

Programs

  • C
    #include  int main(int argc, char * argv[]) { for(int n=1;;n++) { unsigned long long a = 0; for(int k=1;k <=n;k += 2) a -= (n-k+1) % k ; for(int k=2;k <=n;k += 2) a += (n-k+1) % k ; if ( a == 0) printf("%d,\n",n) ; } } /* R. J. Mathar, Jan 14 2009 */
  • Maple
    P:=proc(i) local a,n; for n from 1 to i do a:=abs(add((-1)^k*((n-k+1) mod k),k=1..n)); if a=0 then print(n); fi; od; end: P(100);

Formula

abs{(-1)^k*A004125} = 0
{a(n): A154585(a(n))=0}. - R. J. Mathar, Jan 14 2009

Extensions

8466 inserted, and sequence extended up to a(13), by R. J. Mathar, Jan 14 2009
a(14)-a(15) from Donovan Johnson, Oct 03 2011

A329970 a(n) = (-1)^(n + 1) * n * ceiling(n/2) + Sum_{k=1..n} (-1)^k * k^2 * floor(n/k).

Original entry on oeis.org

0, 0, -2, 3, 0, -3, -7, 16, 2, -15, -21, 31, 24, -15, -57, 34, 25, -17, -27, 77, 8, -99, -111, 155, 117, -36, -140, 40, 25, -80, -96, 259, 112, -157, -249, 202, 183, -156, -354, 224, 203, -40, -62, 342, -21, -524, -548, 562, 488, -34, -358, 194, 167, -262
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 26 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(-1)^(n + 1) n Ceiling[n/2] + Sum[(-1)^k k^2 Floor[n/k], {k, 1, n}], {n, 1, 54}]
    nmax = 54; CoefficientList[Series[x (1 - x + 2 x^2)/((1 - x)^2 (1 + x)^3) + 1/(1 - x) Sum[(-1)^k k^2 x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[Sum[(-1)^(k + 1) Mod[n, k] k, {k, 1, n}], {n, 1, 54}]
  • PARI
    a(n) = (-1)^(n + 1)*n*ceil(n/2) + sum(k=1, n, (-1)^k * k^2 * (n\k)); \\ Michel Marcus, Sep 20 2021

Formula

G.f.: x * (1 - x + 2*x^2) / ((1 - x)^2 * (1 + x)^3) + (1/(1 - x)) * Sum_{k>=1} (-1)^k * k^2 * x^k / (1 - x^k).
a(n) = Sum_{k=1..n} (-1)^(k + 1) * (n mod k) * k.

A375746 The alternating sum of sequentially decreasing moduli for every positive integer.

Original entry on oeis.org

0, 0, -1, -1, 0, 1, -2, -4, 0, 3, -4, -5, 4, 1, -10, -4, 3, 1, -2, -9, -2, 11, -12, -17, 11, 0, -13, 0, -1, 6, -7, -23, 8, 7, -20, -10, 9, 8, -25, -14, 13, -4, 3, -20, -13, 34, -35, -34, 26, -8, -13, -6, 5, 8, -25, -24, 1, 26, -27, -34
Offset: 1

Views

Author

Lavender Malison, Aug 26 2024

Keywords

Comments

It is expected that this sequence will contain all integers, however in the first 25000 terms, there are only 14907 distinct integers, with -39 and 54 being the two 2 digit numbers not appearing in the first 25000 terms. This sequence, while generated in a different manner, appears to be A154585 shifted over one term and without the absolute value taken.

Examples

			For n=6, a(6) = (6 mod 6)-(6 mod 5)+(6 mod 4)-(6 mod 3)+(6 mod 2)-(6 mod 1) = 0-1+2-0+0-0 = 1.
		

Crossrefs

Cf. A154585.

Programs

  • Mathematica
    Table[Sum[(-1)^(n-k)*Mod[n,k],{k,n}],{n,60}] (* James C. McMahon, Oct 18 2024 *)

Formula

a(n) = Sum_{k=1..n} (-1)^(n-k) * (n mod k).
abs(a(n)) = A154585(n-1) for n>=2.
Showing 1-4 of 4 results.