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.

Previous Showing 71-80 of 87 results. Next

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).

A354801 n^2 minus the sum of all aliquot divisors of all positive integers <= n.

Original entry on oeis.org

1, 3, 7, 11, 19, 24, 36, 44, 57, 68, 88, 95, 119, 136, 156, 172, 204, 218, 254, 271, 301, 330, 374, 385, 428, 463, 503, 530, 586, 603, 663, 695, 745, 792, 848, 864, 936, 989, 1049, 1078, 1158, 1187, 1271, 1318, 1374, 1439, 1531, 1550, 1639, 1695, 1775, 1832, 1936, 1977, 2069, 2116
Offset: 1

Views

Author

Omar E. Pol, Jun 06 2022

Keywords

Comments

After the Dyck paths described in A237593 we can see that a(n) has a symmetric representation as follows: a(n) is the sum of the areas of two polygons. In the fourth quadrant of the infinite square grid the first polygon has a vertex at (0,0) and its area is equal to A000217(n). The second polygon appears if n >= 3 and it has a vertex at (n,-n) and its area is equal to A004125(n). So the area of the arrowhead-shaped polygon is equal to A153485(n). See the illustration of initial terms in the Links section.

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[3*n - 1 - DivisorSigma[1, n], {n, 1, 60}]] (* Amiram Eldar, Jun 12 2022 *)
  • PARI
    a(n) = n^2 - sum(k=1, n, sigma(k)-k); \\ Michel Marcus, Jun 13 2022
    
  • Python
    from math import isqrt
    def A354801(n): return n*(3*n+1)+(s:=isqrt(n))**2*(s+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))>>1 # Chai Wah Wu, Oct 22 2023

Formula

a(n) = A000217(n) + A004125(n).
a(n) = A000290(n) - A153485(n).
a(n) = A024916(n) + A004125(n) - A153485(n).

A362081 Numbers k achieving record abundance (sigma(k) > 2*k) via a residue-based measure M(k) (see Comments), analogous to superabundant numbers A004394.

Original entry on oeis.org

1, 2, 4, 6, 12, 24, 30, 36, 72, 120, 360, 420, 840, 1680, 2520, 4032, 5040, 10080, 25200, 32760, 65520, 98280, 194040, 196560, 388080, 942480, 1801800, 3160080, 3603600, 6320160, 12640320, 24504480, 53721360, 61981920, 73513440, 115315200, 122522400, 189909720, 192099600, 214885440
Offset: 1

Views

Author

Richard Joseph Boland, Apr 08 2023

Keywords

Comments

The residue-based quantifier function, M(k) = (k+1)*(1 - zeta(2)/2) - 1 - ( Sum_{j=1..k} k mod j )/k, measures either abundance (sigma(k) > 2*k), or deficiency (sigma(k) < 2*k), of a positive integer k. It follows from the known facts that Sum_{j=1..k} (sigma(j) + k mod j) = k^2 and that the average order of sigma(k)/k is Pi^2/6 = zeta(2) (see derivation below).
M(k) ~ 0 when sigma(k) ~ 2*k and for sufficiently large k, M(k) is positive when k is an abundant number (A005101) and negative when k is a deficient number (A005100). The terms of this sequence are the abundant k for which M(k) > M(m) for all m < k, analogous to the superabundant numbers A004394, which utilize sigma(k)/k as the measure. However, sigma(k)/k does not give a meaningful measure of deficiency, whereas M(k) does, thus a sensible notion of superdeficient (see A362082).

Examples

			The abundance measure is initially negative, becoming positive for k > 30. Initial measures with factorizations from the Mathematica program:
   1  -0.64493406684822643647   {{1,1}}
   2  -0.46740110027233965471   {{2,1}}
   4  -0.36233516712056609118   {{2,2}}
   6  -0.25726923396879252765   {{2,1},{3,1}}
  12  -0.10873810118013850374   {{2,2},{3,1}}
  24  -0.10334250226949712257   {{2,3},{3,1}}
  30  -0.096478036147509765322  {{2,1},{3,1},{5,1}}
  36   0.068719763307810925260  {{2,2},{3,2}}
  72   0.12657322670640173542   {{2,3},{3,2}}
		

Crossrefs

Programs

  • Mathematica
    Clear[max, Rp, R, seqtable, M];
    max = -1; Rp = 0; seqtable = {};
    Do[R = Rp + 2 k - 1 - DivisorSigma[1, k];
      M = N[(k + 1)*(1 - Zeta[2]/2) - 1 - R/k, 20];
      If[M > max, max = M; Print[k, "   ", max, "   ", FactorInteger[k]];
       AppendTo[seqtable, k]];
      Rp = R, {k, 1, 1000000000}];
    Print[seqtable]
  • PARI
    M(n) = (n+1)*(1 - zeta(2)/2) - 1 - sum(k=2, n, n%k)/n;
    lista(nn) = my(m=-oo, list=List()); for (n=1, nn, my(mm = M(n)); if (mm > m, listput(list, n); m = mm);); Vec(list); \\ Michel Marcus, Apr 21 2023

Formula

Derived starting with lemmas 1-3:
1) Sum_{j=1..k} (sigma(j) + k mod j) = k^2.
2) The average order of sigma(k)/k is Pi^2/6 = zeta(2).
3) R(k) = Sum_{j=1..k} k mod j, so R(k)/k is the average order of (k mod j).
Then:
Sum_{j=1..k} sigma(j) ~ zeta(2)*Sum_{j=1..k} j = zeta(2)*(k^2+k)/2.
R(k)/k ~ k - k*zeta(2)/2 - zeta(2)/2.
0 ~ (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k.
Thus M(k) = (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k is a measure of variance about sigma(k) ~ 2*k corresponding to M(k) ~ 0.

A362082 Numbers k achieving record deficiency via a residue-based measure, M(k) = (k+1)*(1 - zeta(2)/2) - 1 - ( Sum_{j=1..k} k mod j )/k.

Original entry on oeis.org

1, 5, 11, 23, 47, 59, 167, 179, 359, 503, 719, 1439, 5039, 6719, 7559, 15119, 20159, 52919, 75599, 83159, 166319, 415799, 720719, 831599, 1081079, 2162159, 4324319, 5266799, 7900199, 10533599, 18345599, 28274399, 41081039, 136936799, 205405199, 410810399
Offset: 1

Views

Author

Richard Joseph Boland, Apr 17 2023

Keywords

Comments

M(k) = (k+1)*(1 - zeta(2)/2) - 1 - ( Sum_{j=1..k} k mod j )/k is a measure of either abundance (sigma(k) > 2*k), or deficiency (sigma(k) < 2*k), of a positive integer k. The measure follows from the known facts that Sum_{j=1..k} (sigma(j) + k mod j) = k^2 and that the average order of sigma(k)/k is Pi^2/6 = zeta(2) (see derivation below).
M(k) ~ 0 when sigma(k) ~ 2*k and for sufficiently large k, M(k) is positive when k is an abundant number (A005101) and negative when k is a deficient number (A005100).
The terms of this sequence are the deficient k for which M(k) < M(m) for all m < k and may be thought of as "superdeficient", contra-analogous to the superabundant numbers A004394 utilizing sigma(k)/k as the measure of abundance, which is otherwise not particularly meaningful as a deficiency measure.
15119=13*1163 is the first term that is composite and subsequently, up to 1000000000, roughly half of the terms are composite.

Examples

			First few terms with their M(k) measure and factorizations as generated by the Mathematica program:
    1   -0.64493406684822643647   {{1,1}}
    5   -0.73480220054467930942   {{5,1}}
   11   -0.86960440108935861883  {{11,1}}
   23   -1.0000783673961085420   {{23,1}}
   47   -1.0528856894638174541   {{47,1}}
   59   -1.1107338698535727552   {{59,1}}
  167   -1.1984137110594038972  {{167,1}}
  179   -1.2619431113124463216  {{179,1}}
  359   -1.3499704727921791778  {{359,1}}
  503   -1.3722914063892448936  {{503,1}}
  719   -1.4363475145965658088  {{719,1}}
		

Crossrefs

Cf. A362081 (analogous to superabundant A004394).
Cf. A362083 (analogous to A335067, A326393).

Programs

  • Mathematica
    Clear[min, Rp, R, seqtable, M]; min = 1; Rp = 0; seqtable = {};
    Do[R = Rp + 2 k - 1 - DivisorSigma[1, k];
      M = N[(k + 1)*(1 - Zeta[2]/2) - 1 - R/k, 20];
      If[M < min, min = M; Print[k, "   ", min, "   ", FactorInteger[k]];
       AppendTo[seqtable, k]];
      Rp = R, {k, 1, 1000000000}];
    Print[seqtable]
  • PARI
    M(n) = (n+1)*(1 - zeta(2)/2) - 1 - sum(k=2, n, n%k)/n;
    lista(nn) = my(m=+oo, list=List()); for (n=1, nn, my(mm = M(n)); if (mm < m, listput(list, n); m = mm);); Vec(list); \\ Michel Marcus, Apr 21 2023

Formula

Derived starting with lemmas 1-3:
1) Sum_{j=1..k} (sigma(j) + k mod j) = k^2.
2) The average order of sigma(k)/k is Pi^2/6 = zeta(2).
3) R(k) = Sum_{j=1..k} k mod j, so R(k)/k is the average order of (k mod j).
Then:
Sum_{j=1..k} sigma(j) ~ zeta(2)*Sum_{j=1..k} j = zeta(2)*(k^2+k)/2.
R(k)/k ~ k - k*zeta(2)/2 - zeta(2)/2.
0 ~ (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k.
Thus M(k) = (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k is a measure of variance about sigma(k) ~ 2*k corresponding to M(k) ~ 0.

A362083 Numbers k such that, via a residue based measure M(k) (see Comments), k is deficient, k+1 is abundant, and abs(M(k)) + abs(M(k+1)) reaches a new maximum.

Original entry on oeis.org

11, 17, 19, 47, 53, 103, 347, 349, 557, 1663, 1679, 2519, 5039, 10079, 15119, 25199, 27719, 55439, 110879, 166319, 277199, 332639, 554399, 665279, 720719, 1441439, 2162159, 3603599, 4324319, 7207199, 8648639, 10810799, 21621599, 36756719, 61261199, 73513439, 122522399, 147026879
Offset: 1

Views

Author

Richard Joseph Boland, Apr 17 2023

Keywords

Comments

The residue-based quantifier function, M(k), measures either abundance (sigma(k) > 2*k), or deficiency (sigma(k) < 2*k), of a positive integer k. The measure is defined by M(k) = (k+1)*(1 - zeta(2)/2) - 1 - (Sum_{j=1..k} k mod j)/k. It follows from the known facts that Sum_{j=1..k} (sigma(j) + k mod j) = k^2 and that the average order of sigma(k)/k is Pi^2/6 = zeta(2) (see derivation below).
M(k) ~ 0 when sigma(k) ~ 2*k and for sufficiently large k, M(k) is positive when k is an abundant number (A005101) and negative when k is a deficient number (A005100). The terms of this sequence are the deficient k such that k+1 is abundant and abs(M(k)) + abs(M(k+1)) achieves a new maximum, somewhat analogous to A335067 and A326393.

Examples

			The first few terms with measure sums and factorizations generated by the Mathematica program:
0.90610439514731535319   35  {{5,1},{7,1}}   36   {{2,2},{3,2}}
1.1735781643159997761    59  {{59,1}}        60   {{2,2},{3,1},{5,1}}
1.3642976724582397229   119  {{7,1},{17,1}} 120   {{2,3},{3,1},{5,1}}
1.3954100615479538209   179  {{179,1}}      180   {{2,2},{3,2},{5,1}}
1.4600817810807682323   239  {{239,1}}      240   {{2,4},{3,1},{5,1}}
1.6088158511317518390   359  {{359,1}}      360   {{2,3},{3,2},{5,1}}
1.7153941935887132383   719  {{719,1}}      720   {{2,4},{3,2},{5,1}}
1.7851979872921589879   839  {{839,1}}      840   {{2,3},{3,1},{5,1},{7,1}}
		

Crossrefs

Cf. A362081 (analogous to superabundant A004394), A362082 (superdeficient).

Programs

  • Mathematica
    Clear[max, Rp, R, seqtable, Mp, M];max = -1; Rp = 0; Mp = -0.644934066; seqtable = {};
    Do[R = Rp + 2 k - 1 - DivisorSigma[1, k];
     M = N[(k)*(1 - Zeta[2]/2) - 1  - R/k, 20];
     If[DivisorSigma[1, k - 1] < 2 (k - 1) && DivisorSigma[1, k] > 2 k &&
       Abs[Mp] + Abs[M] > max, max = Abs[Mp] + Abs[M];
      Print[max, "   ", k - 1, "   ", FactorInteger[k - 1], "   ", k,
       "   ", FactorInteger[k]]; AppendTo[seqtable, {k - 1, k}]]; Rp = R;
     Mp = M, {k, 2, 1000000000}]; seq = Flatten[seqtable]; Table[seq[[2 j - 1]], {j, 1, Length[seq]/2}]

Formula

Derived starting with lemmas 1-3:
1) Sum_{j=1..k} (sigma(j) + k mod j) = k^2.
2) The average order of sigma(k)/k is Pi^2/6 = zeta(2).
3) R(k) = Sum_{j=1..k} k mod j, so R(k)/k is the average order of (k mod j).
Then:
Sum_{j=1..k} sigma(j) ~ zeta(2)*Sum_{j=1..k} j = zeta(2)*(k^2+k)/2.
R(k)/k ~ k - k*zeta(2)/2 - zeta(2)/2.
0 ~ (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k.
Thus M(k) = (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k is a measure of variance about sigma(k) ~ 2*k corresponding to M(k) ~ 0.

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

A166248 a(n) is the absolute value of n minus sum of all the remainders modulo the numbers below n.

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 1, 0, 3, 3, 11, 5, 15, 17, 21, 20, 34, 29, 45, 41, 49, 55, 75, 61, 78, 86, 98, 96, 122, 108, 136, 135, 151, 163, 183, 162, 196, 210, 230, 218, 256, 242, 282, 284, 294, 312, 356, 326, 365, 370, 398, 402, 452, 438, 474, 464, 496, 520, 576, 526, 584, 610
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 10 2009

Keywords

Examples

			a(1) = abs(1-0) = 1;
a(2) = abs(2-0) = 2;
a(3) = abs(3-1) = 2;
a(4) = abs(4-1) = 3;
a(5) = abs(5-4) = 1;
a(6) = abs(6-3) = 3;
a(7) = abs(7-8) = 1.
		

Crossrefs

Programs

  • Maple
    A004125 := proc(n) add( modp(n,k),k=1..n) ; end proc: A166248 := proc(n) abs(n-A004125(n)) ; end: seq(A166248(n),n=1..100) ; # R. J. Mathar, Oct 24 2009
  • Python
    from math import isqrt
    def A166248(n): return abs(n*(n-1)+((s:=isqrt(n))**2*(s+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))>>1)) # Chai Wah Wu, Nov 01 2023

Formula

a(n) = abs(n - Sum_{k=1..n} (n mod k)).
a(n) = abs(n - A004125(n)). - Michel Marcus, May 08 2019

Extensions

a(19), a(20), a(37) etc. corrected by R. J. Mathar, Oct 24 2009

A176314 Sum of remainders of mod(n, k), for 1 <= k <= sqrt(n).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 3, 0, 2, 2, 1, 1, 4, 2, 5, 2, 2, 3, 6, 0, 3, 5, 6, 4, 8, 2, 6, 4, 5, 7, 6, 1, 6, 9, 11, 5, 10, 4, 9, 8, 5, 8, 13, 3, 8, 7, 10, 10, 16, 11, 12, 5, 8, 12, 18, 4, 10, 14, 10, 10, 12, 8, 15, 16, 20, 13, 20, 4, 11, 16, 15, 16, 16, 12, 19, 7, 11, 17, 25, 11, 14, 20, 25
Offset: 1

Views

Author

Keywords

Comments

It appears, as one would expect, that a(n) is asymptotically 1/4 n.
24 is the last n for which a(n) = 0.

Crossrefs

Programs

  • Mathematica
    Total/@Table[Mod[n,k],{n,90},{k,Sqrt[n]}] (* Harvey P. Dale, Nov 20 2013 *)
  • PARI
    a(n) = sum(k=2,sqrtint(n),n%k)

Formula

a(n+1) = a(n) + floor(sqrt(n)) - A070039(n+1).

A244409 Numbers x such that it is possible to find a value k for which Sum_{j=1..x} (x mod j) = Sum_{j=1..k} j.

Original entry on oeis.org

3, 4, 6, 13, 15, 16, 43, 112, 278, 346, 527, 845, 1214, 1612, 2189, 2863, 10278, 610410, 981350, 2054106, 3286515, 3764767, 4293562, 5543363, 5728393, 20142483, 66790186, 67652048, 72730730, 137252581, 198373964, 338557754, 406463074, 687452210, 911028356
Offset: 1

Views

Author

Paolo P. Lava, Jun 27 2014

Keywords

Comments

a(38) > 2 * 10^9. - Hiroaki Yamanouchi, Sep 29 2014

Examples

			If x = 6 we have 6 mod 1 + 6 mod 2 + 6 mod 3 + 6 mod 4 + 6 mod 5 + 6 mod 6 = 0 + 0 + 0 + 2 + 1 + 0 = 3 and 1 + 2 = 3 (k = 2).
If x = 15 we have 15 mod 1 + 15 mod 2 + ... + 15 mod 14 + 15 mod 15 = 0 + 1 + 0 + 3 + 0 + 3 + 1 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 = 36 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 (k = 8).
		

Crossrefs

Programs

  • Maple
    with(numtheory); P:=proc(q)local a,b,c,k,n;
    for n from 1 to q do a:=add(n mod k,k=1..n); b:=n; c:=0;
    while c<=a do if c=a then lprint(n,b); break; else b:=b+1;
    c:=c+(b mod n); fi; od: od; end: P(10^9);

Formula

A004125(x) = A000217(k).

Extensions

a(18)-a(35) from Hiroaki Yamanouchi, Sep 29 2014

A244912 Sum of leading digits in representations of n in bases 2,3,...,n.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 9, 9, 11, 12, 15, 16, 18, 20, 20, 21, 25, 26, 29, 31, 33, 34, 38, 36, 38, 39, 42, 43, 47, 48, 52, 54, 56, 58, 58, 59, 61, 63, 67, 68, 72, 73, 76, 79, 81, 82, 88, 84, 88, 90, 93, 94, 99, 101, 105, 107, 109, 110, 116, 117, 119, 122, 117, 119, 123
Offset: 2

Views

Author

Alex Ratushnyak, Jul 08 2014

Keywords

Examples

			8 in bases 2...8 is:
  1000 (base 2)
  22 (base 3)
  20 (base 4)
  13 (base 5)
  12 (base 6)
  11 (base 7)
  10 (base 8)
The sum of first digits is 1+2+2+1+1+1+1 = 9, so a(8)=9.
		

Crossrefs

Cf. A004125 (sum of last digits), A043306 (sum of all digits).

Programs

  • Mathematica
    f[n_] := Sum[ IntegerDigits[n, k][[1]], {k, 2, n}]; Array[f, 70, 2] (* Robert G. Wilson v, Aug 02 2014 *)
  • PARI
    a(n) = sum(i=2, n, digits(n, i)[1]); \\ Michel Marcus, Jul 17 2014
  • Python
    import math
    def modlg(a, b):
        return a // b**int(math.log(a, b))
    for n in range(2,77):
        s=0
        for k in range(2,n+1):
            s += modlg(n,k)
        print(s, end=', ')
    

Formula

a(n) = Sum_{k=2..n} floor(n/f(n,k)), with f(n,k) = k^floor(log_k(n)). - Ridouane Oudra, Apr 26 2025
Previous Showing 71-80 of 87 results. Next