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-10 of 16 results. Next

A336841 Prime-shifted analog of A094471: a(n) = A336845(n) - A003973(n).

Original entry on oeis.org

0, 2, 4, 14, 6, 36, 10, 68, 44, 52, 12, 192, 16, 84, 92, 284, 18, 326, 22, 274, 148, 100, 28, 840, 90, 132, 344, 438, 30, 648, 36, 1094, 176, 148, 212, 1622, 40, 180, 232, 1192, 42, 1032, 46, 520, 802, 228, 52, 3324, 230, 654, 260, 684, 58, 2376, 252, 1896, 316, 244, 60, 3156, 66, 292, 1278, 4010, 332, 1224, 70, 766
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2020

Keywords

Comments

All terms are even because A003973 and A336845 match parity-wise. Also in the sum formulas, only even terms are summed (only one of which is zero).

Crossrefs

Cf. A336846 [= gcd(a(n), A003973(n))].
Twice the terms of A336854.

Programs

Formula

a(n) = A336845(n) - A003973(n) = (A000005(n)*A003961(n)) - A000203(A003961(n)).
a(n) = A094471(A003961(n)).
a(n) = Sum_{d|n} (A003961(n)-A003961(d)) = Sum_{d|A003961(n)} (A003961(n)-d).
a(n) = 2*A336854(n) = 2*Sum_{d|n} (A048673(n)-A048673(d)).
a(n) = ((A003961(n)+1)*A000005(n)) - 2*A336840(n).
a(n) = 2 * ((A000005(n)*A048673(n)) - A336840(n)).
a(n) = A000005(n) * (A336837(n)/A336839(n)) = A336837(n) * A336856(n).

A096847 Numbers k such that A094471(k) is prime.

Original entry on oeis.org

3, 4, 8, 36, 100, 128, 324, 400, 1296, 1600, 1936, 2116, 3364, 4356, 10404, 11236, 20736, 22500, 26244, 27556, 28900, 30976, 38416, 40000, 52900, 53824, 57600, 60516, 88804, 93636, 107584, 108900, 115600, 123904, 125316, 129600, 211600, 215296, 220900, 256036
Offset: 1

Views

Author

Labos Elemer, Jul 15 2004

Keywords

Comments

Old name was "Solutions to {A094471[x]=prime} that is to {x; x*tau[x]-sigma[x]=prime}."
All terms after the first are even, because A094471(n) is even if n is odd. The first term == 2 (mod 4) is a(135) = 9653618. - Robert Israel, Nov 11 2015
Except for 3, all the terms are either even squares or twice squares. - Amiram Eldar, Feb 14 2025

Examples

			8 is a term since 8*tau(8) - sigma(8) = 8*4 - 15 = 32 - 15 = 17 is a prime.
		

Crossrefs

Cf. A000005 (tau), A000203 (sigma), A094471, A096848.

Programs

  • Maple
    A094471:= n -> n*numtheory:-tau(n) - numtheory:-sigma(n):
    select(t -> isprime(A094471(t)), 2*[3/2,$1..10^6]); # Robert Israel, Nov 11 2015
  • Mathematica
    Do[s=n*DivisorSigma[0, n]-DivisorSigma[1, n]; If[PrimeQ[s], Print[{n, s}]; ta[[u]]=n; tb[[u]]=s; u=u+1], {n, 1, 1000000}]; ta
    Select[Range[215000],PrimeQ[# DivisorSigma[0,#]-DivisorSigma[1,#]]&] (* Harvey P. Dale, Dec 07 2021 *)
    q[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; PrimeQ[n * Times @@ (e + 1) - Times @@ ((p^(e + 1) - 1)/(p - 1))]]; seq[lim_] := Module[{m1 = Floor[Sqrt[lim/2]], m2 = Floor[Sqrt[lim]/2]}, Join[{3}, Union[Select[2*Range[m1]^2, q], Select[4*Range[m2]^2, q]]]]; seq[220000] (* Amiram Eldar, Feb 14 2025 *)
  • PARI
    isok(n) = isprime(n*numdiv(n)-sigma(n)); \\ Michel Marcus, Nov 12 2015
    
  • PARI
    isok(k) = if(k % 2, k == 3, if(!issquare(k) && !issquare(2*k), 0, my(f = factor(k)); isprime(k * numdiv(f) - sigma(f)))); \\ Amiram Eldar, Feb 14 2025

Extensions

Name modified by Tom Edgar, Nov 12 2015

A081307 a(n) = (n+1)*tau(n) - sigma(n).

Original entry on oeis.org

1, 3, 4, 8, 6, 16, 8, 21, 17, 26, 12, 50, 14, 36, 40, 54, 18, 75, 20, 84, 56, 56, 24, 140, 47, 66, 72, 118, 30, 176, 32, 135, 88, 86, 96, 242, 38, 96, 104, 238, 42, 248, 44, 186, 198, 116, 48, 366, 93, 213, 136, 220
Offset: 1

Views

Author

Benoit Cloitre, Apr 20 2003

Keywords

Comments

Old name was: Sum_{k=1..n} Sum_{m=1..k} 1/(1-x^m).
Number of positive integer pairs (s,t) with s <= t <= n, such that s|n. For example, when n = 6, the 16 pairs are (1,1), (1,2), (1,3), (1,4), (1,5), (1,6), (2,2), (2,3), (2,4), (2,5), (2,6), (3,3), (3,4), (3,5), (3,6), (6,6). - Wesley Ivan Hurt, Nov 15 2021

Crossrefs

Cf. A000005 (tau), A000203 (sigma), A094471, A113998.

Programs

  • Mathematica
    Table[(n + 1) DivisorSigma[0, n] - DivisorSigma[1, n], {n, 100}] (* Wesley Ivan Hurt, Nov 15 2021 *)
  • PARI
    a(n)=if(n<1,0,polcoeff(sum(k=1,n,sum(l=1,k,1/(1-x^l)),x*O(x^n)),n))
    
  • PARI
    a(n)=sum(j=1, n, sum(k=1, j, n%k==0)) \\ Hugo Pfoertner, Jul 09 2025

Formula

Sum_{k=1..n} Sum_{m=1..k} 1/(1-x^m).
a(n) = Sum_{k=1..n} k*A113998(n,k). - Philippe Deléham, Feb 03 2007

Extensions

Name changed by Wesley Ivan Hurt, Nov 16 2021 using formula from Vladeta Jovovic, Jan 22 2005

A152211 a(n) = n * sigma_0(n) + sigma_1(n).

Original entry on oeis.org

2, 7, 10, 19, 16, 36, 22, 47, 40, 58, 34, 100, 40, 80, 84, 111, 52, 147, 58, 162, 116, 124, 70, 252, 106, 146, 148, 224, 88, 312, 94, 255, 180, 190, 188, 415, 112, 212, 212, 410, 124, 432, 130, 348, 348, 256, 142, 604
Offset: 1

Views

Author

Ctibor O. Zizka, Nov 29 2008

Keywords

Comments

a(n) is the sum of all parts plus the total number of parts of all partitions of n into equal parts. - Omar E. Pol, Nov 30 2019

Examples

			For n = 4 the partitions of 4 into equal parts are [4], [2,2], [1,1,1,1]. The sum of all parts is 4 + 2 + 2 + 1 + 1 + 1 + 1 = 12. There are 7 parts, so a(4) = 12 + 7 = 19. - _Omar E. Pol_, Nov 30 2019
		

Crossrefs

Programs

  • Mathematica
    Array[Total[{#, 1} DivisorSigma[{0, 1}, #]] &, 48] (* Michael De Vlieger, Dec 01 2019 *)
  • PARI
    a(n) =  n*numdiv(n) + sigma(n) \\ Michel Marcus, Jun 02 2013

Formula

a(n) = n * A000005(n) + A000203(n).
a(n) = A038040(n) + A000203(n). - Torlach Rush, Feb 01 2019
G.f.: Sum_{k>=1} (k + 1) * x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Aug 14 2019
Sum_{k=1..n} a(k) ~ (n^2/2) * (log(n) + 2*gamma + zeta(2) - 1/2), where gamma is Euler's constant (A001620). - Amiram Eldar, Feb 01 2025

A134866 Table read by antidiagonals: T(n,k) = sigma(gcd(n,k)).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 7, 1, 3, 1, 1, 1, 4, 1, 1, 4, 1, 1, 1, 3, 1, 3, 6, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 7, 1, 12, 1, 7, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 8, 3, 1, 3, 1, 3, 1
Offset: 1

Views

Author

Gary W. Adamson, Nov 14 2007

Keywords

Comments

Previous name was: Triangle, antidiagonals of an array formed by A051731 * A127093 (transform).
Row sums give A094471.

Examples

			First few rows of the array:
  1, 1, 1, 1, 1, 1, 1, ...
  1, 3, 1, 3, 1, 3, 1, ...
  1, 1, 4, 1, 1, 4, 1, ...
  1, 3, 1, 7, 1, 3, 1, ...
  1, 1, 1, 1, 6, 1, 1, ...
  ...
First antidiagonals:
  1;
  1, 1;
  1, 3, 1;
  1, 1, 1, 1;
  1, 3, 4, 3, 1;
  1, 1, 1, 1, 1, 1;
  1, 3, 1, 7, 1, 3, 1;
  1, 1, 4, 1, 1, 4, 1, 1;
  1, 3, 1, 3, 6, 3, 1, 3, 1;
  ...
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSigma[1, GCD[#, k]] &[n - k + 1], {n, 13}, {k, n}] // Flatten (* Michael De Vlieger, Dec 19 2022 *)
  • PARI
    T(n, k) = sigma(gcd(n, k)); \\ Michel Marcus, Dec 19 2022

Formula

T(n,k) = A000203(A050873(n,k)). - Michel Marcus, Dec 19 2022

Extensions

New name and data corrected by Michel Marcus, Dec 19 2022

A367326 a(n) = Sum_{(n - k)|n} k^2.

Original entry on oeis.org

0, 0, 1, 4, 13, 16, 50, 36, 101, 100, 170, 100, 402, 144, 362, 440, 629, 256, 995, 324, 1266, 920, 962, 484, 2578, 976, 1370, 1576, 2618, 784, 4180, 900, 3477, 2408, 2402, 2840, 7023, 1296, 3026, 3416, 7810, 1600, 8548, 1764, 6786, 7496, 4490, 2116, 14546
Offset: 0

Views

Author

Peter Luschny, Nov 14 2023

Keywords

Crossrefs

Programs

  • Julia
    using AbstractAlgebra
    function A367326(n)
        sum(k^2 for k in 0:n if is_divisible_by(n, n - k))
    end
    [A367326(n) for n in 0:48] |> println
    
  • Maple
    divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0):
    a := n -> local d; add(`if`(divides(n - d, n), d^2, 0), d = 0..n-1):
    seq(a(n), n = 0..61);
  • Mathematica
    a[0] = 0; a[n_] := DivisorSum[n, (n - #)^2 &]; Array[a, 50, 0]
    (* Amiram Eldar, Nov 14 2023 *)
    a[n_] := Sum[If[Divisible[n, n - k], k^2, 0], {k, 0, n - 1}]
    Table[a[n], {n, 0, 48}]  (* Peter Luschny, Nov 14 2023 *)
  • PARI
    a(n) = if(n == 0, 0, sumdiv(n, d, (n-d)^2)); \\ Michel Marcus, Nov 14 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A367326(n):
        f = factorint(n).items()
        return n*(n*prod(e+1 for p,e in f) - (prod((p**(e+1)-1)//(p-1) for p,e in f)<<1))+prod((p**(e+1<<1)-1)//(p**2-1) for p,e in f) if n else 0
    # Chai Wah Wu, Nov 14 2023
  • SageMath
    def A367326(n): return sum(k^2 for k in (0..n) if (n-k).divides(n))
    print([A367326(n) for n in range(50)])
    

Formula

a(n) = n^2*A000005(n) - 2*n*A000203(n) + A001157(n) for n >= 1. - Chai Wah Wu, Nov 14 2023

A208460 Triangle read by rows: T(n,k) = n minus the k-th proper divisor of n.

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 4, 3, 6, 7, 6, 4, 8, 6, 9, 8, 5, 10, 11, 10, 9, 8, 6, 12, 13, 12, 7, 14, 12, 10, 15, 14, 12, 8, 16, 17, 16, 15, 12, 9, 18, 19, 18, 16, 15, 10, 20, 18, 14, 21, 20, 11, 22, 23, 22, 21, 20, 18, 16, 12, 24, 20, 25, 24, 13, 26, 24, 18, 27, 26, 24
Offset: 2

Views

Author

Omar E. Pol, Feb 28 2012

Keywords

Comments

Conjecture: one of the divisors of T(n,k) is also the k-th divisor of n. In a diagram of the structure of divisors of the natural numbers (see link) the mentioned divisors of the elements of row n are located on a straight line to 45 degrees from the vertical straight line that contains the divisors of n, therefore the divisors of n are predictable.

Examples

			Written as a triangle starting from n = 2:
1;
2;
3, 2;
4;
5, 4, 3;
6;
7, 6, 4;
8, 6;
9, 8, 5;
10;
11, 10, 9, 8, 6;
12;
		

Crossrefs

Column 1 is A000027. Row n has length A032741(n). Row sums give the positives A094471. Right border is A060681.

Programs

  • Maple
    with (numtheory):
    T:= n-> map(x-> n-x, sort([(divisors(n) minus {n})[]]))[]:
    seq (T(n), n=2..50); # Alois P. Heinz, Apr 11 2012
  • Mathematica
    T[n_] := Most[n-Divisors[n]]; Table[T[n], {n, 2, 50}] // Flatten (* Jean-François Alcover, Feb 21 2017 *)

Formula

T(n,k) = n - A027751(n,k).

A096848 Primes arising in A096847.

Original entry on oeis.org

2, 5, 17, 233, 683, 769, 4013, 5039, 28649, 29663, 24917, 15173, 24179, 105509, 252971, 81083, 871289, 941429, 639701, 199193, 713681, 768389, 873569, 1300813, 1308299, 1019687, 4459667, 1477139, 642779, 3953591, 2040443, 8445707, 4906973
Offset: 1

Views

Author

Labos Elemer, Jul 15 2004

Keywords

Comments

Primes of the form m*tau(m) - sigma(m), listed in the order in which the values of m appear in A096847.

Crossrefs

Cf. A000005 (tau), A000203 (sigma), A094471, A096847.

Programs

  • Mathematica
    Do[s=n*DivisorSigma[0, n]-DivisorSigma[1, n];If[PrimeQ[s], Print[{n, s}];ta[[u]]=n;tb[[u]]=s;u=u+1], {n, 1, 1000000}];ta
    s[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; n * Times @@ (e + 1) - Times @@ ((p^(e + 1) - 1)/(p - 1))]; q[n_] := PrimeQ[s[n]]; seq[lim_] := Module[{m1 = Floor[Sqrt[lim/2]], m2 = Floor[Sqrt[lim]/2]}, s /@ Join[{3}, Union[Select[2*Range[m1]^2, q], Select[4*Range[m2]^2, q]]]]; seq[200000] (* Amiram Eldar, Feb 14 2025 *)

Formula

a(n) = A094471(A096847(n)).

A367368 a(n) = Sum_{(n - k) does not divide n, 0 <= k <= n} k.

Original entry on oeis.org

0, 1, 2, 4, 5, 11, 9, 22, 19, 31, 33, 56, 34, 79, 73, 84, 87, 137, 102, 172, 132, 179, 201, 254, 168, 281, 289, 310, 294, 407, 297, 466, 399, 477, 513, 538, 433, 667, 649, 680, 590, 821, 663, 904, 810, 843, 969, 1082, 820, 1135, 1068, 1194, 1164, 1379, 1173
Offset: 0

Views

Author

Peter Luschny, Nov 15 2023

Keywords

Comments

The case n = 0 is well defined because zero divides zero. When implementing the sequence it is advisable to use the definition of divisibility of an integer directly and not the set of divisors, because this is infinite in the case n = 0 and, therefore, cannot be represented in computer algebra systems, which leads to a wide variety of error messages depending on the system. Some of these error messages are in turn incorrect, because the test of divisibility by zero does not involve division and therefore should not lead to a 'ZeroDivisionError' or similar.

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer 1976, p. 14.

Crossrefs

Cf. A094471 (the not negated case), A000217.

Programs

  • Julia
    using AbstractAlgebra
    function A367326(n) sum(k for k in 0:n if ! is_divisible_by(n, n - k)) end
    [A367326(n) for n in 0:54] |> println
    
  • Maple
    # Warning: Be careful when using the deprecated 'numtheory' package.
    # It might not handle the case n = 0 correctly. A better solution is:
    divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0):
    A367368 := n -> local k; add(`if`(divides(n - k, n), 0, k), k = 0..n):
    seq(A367368(n), n = 0..61);
  • Mathematica
    a[n_]:=n+Sum[k*Boole[!Divisible[n,n-k]],{k,0,n-1}]; Array[a,55,0] (* Stefano Spezia, Nov 15 2023 *)
  • Python
    def divides(k, n): return k == n or ((k > 0) and (n % k == 0))
    def A367368(n): return sum(k for k in range(n + 1) if not divides(n - k, n))
    print([A367368(n) for n in range(55)])
    
  • Python
    from math import prod
    from sympy import factorint
    def A367368(n):
        f = factorint(n).items()
        return (n*(n+1)>>1)-n*prod(e+1 for p,e in f)+prod((p**(e+1)-1)//(p-1) for p,e in f) if n else 0 # Chai Wah Wu, Nov 17 2023
  • SageMath
    def A367368(n): return sum(k for k in (0..n) if not (n - k).divides(n))
    print([A367368(n) for n in range(55)])
    

Formula

An additive decomposition of the triangular numbers:
a(n) + A094471(n) = A000217(n) for n >= 0 assuming A094471 with correct offset 0.

A367493 a(n) = Sum_{d|n} (n-d)^n.

Original entry on oeis.org

0, 1, 8, 97, 1024, 20450, 279936, 7509953, 144295424, 4570291850, 100000000000, 4491754172274, 106993205379072, 5221973073321002, 171975117132398592, 8931527427394008833, 295147905179352825856, 20290116242888952838355, 708235345355337676357632, 51879761166564630630389778
Offset: 1

Views

Author

Chai Wah Wu, Nov 20 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[(n-d)^n,{d,Divisors[n]}]; Array[a,20] (* Stefano Spezia, Nov 20 2023 *)
  • Python
    from sympy import divisors
    def A367493(n): return sum((n-d)**n for d in divisors(n, generator=True))

Formula

a(n) = Sum_{k=0..n} (-1)^k*binomial(n,k)*n^(n-k)*sigma_k(n).
Showing 1-10 of 16 results. Next