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-6 of 6 results.

A003973 Inverse Möbius transform of A003961; a(n) = sigma(A003961(n)), where A003961 shifts the prime factorization of n one step towards the larger primes.

Original entry on oeis.org

1, 4, 6, 13, 8, 24, 12, 40, 31, 32, 14, 78, 18, 48, 48, 121, 20, 124, 24, 104, 72, 56, 30, 240, 57, 72, 156, 156, 32, 192, 38, 364, 84, 80, 96, 403, 42, 96, 108, 320, 44, 288, 48, 182, 248, 120, 54, 726, 133, 228, 120, 234, 60, 624, 112, 480, 144, 128, 62, 624, 68
Offset: 1

Views

Author

Keywords

Comments

Sum of the divisors of the prime shifted n, or equally, sum of the prime shifted divisors of n. - Antti Karttunen, Aug 17 2020

Crossrefs

Cf. A000203, A000290 (positions of odd terms), A003961, A007814, A048673, A108228, A151800, A295664, A336840.
Permutation of A008438.
Used in the definitions of the following sequences: A326042, A336838, A336841, A336844, A336846, A336847, A336848, A336849, A336850, A336851, A336852, A336856, A336931, A336932.
Cf. also A003972.

Programs

  • Mathematica
    b[1] = 1; b[p_?PrimeQ] := b[p] = Prime[ PrimePi[p] + 1]; b[n_] := b[n] = Times @@ (b[First[#]]^Last[#] &) /@ FactorInteger[n]; a[n_] := Sum[ b[d], {d, Divisors[n]}]; Table[a[n], {n, 1, 70}]  (* Jean-François Alcover, Jul 18 2013 *)
  • PARI
    aPrime(p,e)=my(q=nextprime(p+1));(q^(e+1)-1)/(q-1)
    a(n)=my(f=factor(n));prod(i=1,#f~,aPrime(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Jul 18 2013
    
  • PARI
    A003973(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); sigma(factorback(f)); }; \\ Antti Karttunen, Aug 06 2020
    
  • Python
    from math import prod
    from sympy import factorint, nextprime
    def A003973(n): return prod(((q:=nextprime(p))**(e+1)-1)//(q-1) for p,e in factorint(n).items()) # Chai Wah Wu, Jul 05 2022

Formula

Multiplicative with a(p^e) = (q^(e+1)-1)/(q-1) where q = nextPrime(p). - David W. Wilson, Sep 01 2001
From Antti Karttunen, Aug 06-12 2020: (Start)
a(n) = Sum_{d|n} A003961(d) = Sum_{d|A003961(n)} d.
a(n) = A000203(A003961(n)) = A000593(A003961(n)).
a(n) = 2*A336840(n) - A000005(n) = 2*Sum_{d|n} (A048673(d) - (1/2)).
a(n) = A008438(A108228(n)) = A008438(A048673(n)-1).
a(n) = A336838(n) * A336856(n).
a(n) is odd if and only if n is a square.
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} p^3/((p+1)*(p^2-nextprime(p))) = 3.39513795..., where nextprime is A151800. - Amiram Eldar, Dec 08 2022, May 30 2025

Extensions

More terms from David W. Wilson, Aug 29 2001
Secondary name added by Antti Karttunen, Aug 06 2020

A286385 a(n) = A003961(n) - A000203(n).

Original entry on oeis.org

0, 0, 1, 2, 1, 3, 3, 12, 12, 3, 1, 17, 3, 9, 11, 50, 1, 36, 3, 21, 23, 3, 5, 75, 18, 9, 85, 43, 1, 33, 5, 180, 17, 3, 29, 134, 3, 9, 29, 99, 1, 69, 3, 33, 97, 15, 5, 281, 64, 54, 23, 55, 5, 255, 19, 177, 35, 3, 1, 147, 5, 15, 171, 602, 35, 51, 3, 45, 49, 87, 1, 480, 5, 9, 121, 67, 47, 87, 3, 381, 504, 3, 5, 271, 25, 9, 35, 171, 7, 291, 75, 93, 57, 15, 41, 963
Offset: 1

Views

Author

Antti Karttunen, May 09 2017

Keywords

Comments

Are all terms nonnegative? This question is equivalent to the question posed in A285705.
From Antti Karttunen, Aug 05 2020: (Start)
The answer to the above question is yes. Because both A000203 and A003961 are multiplicative sequences, it suffices to prove that for any prime p, and e >= 1, q^e >= sigma(p^e) = ((p^(1+e))-1) / (p-1), where q = A151800(p), i.e., the next larger prime after p. If p is a lesser twin prime, then q = p+2 (and this difference can't be less than 2, apart from case p=2), and it is easy to see that (n+2)^e > ((n^(e+1)) - 1) / (n-1), for all n >= 2, e >= 1.
See comments in A326042.
(End)
This is the inverse Möbius transform of A337549, from which it is even easier to see that all terms are nonnegative. - Antti Karttunen, Sep 22 2020

Crossrefs

Cf. A326057 [= gcd(a(n), A252748(n))].

Programs

  • Mathematica
    Array[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] - DivisorSigma[1, #] &, 96] (* Michael De Vlieger, Oct 05 2020 *)
  • PARI
    A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); }; \\ From A003961
    A286385(n) = (A003961(n) - sigma(n));
    for(n=1, 16384, write("b286385.txt", n, " ", A286385(n)));
    
  • Python
    from sympy import factorint, nextprime, divisor_sigma as D
    from operator import mul
    def a048673(n):
        f = factorint(n)
        return 1 if n==1 else (1 + reduce(mul, [nextprime(i)**f[i] for i in f]))/2
    def a(n): return 2*a048673(n) - D(n) - 1 # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286385 n) (- (A003961 n) (A000203 n)))
    

Formula

a(n) = A285705(A048673(n)) - 1 = 2*A048673(n) - A000203(n) - 1.
a(n) = A336852(n) - A336851(n). - Antti Karttunen, Aug 05 2020
a(n) = Sum_{d|n} A337549(d). - Antti Karttunen, Sep 22 2020
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} ((p^2-p)/(p^2-q(p))) - Pi^2/12 = 1.24152934..., where q(p) = nextprime(p) (A151800). - Amiram Eldar, Dec 21 2023

A337381 Numbers k for which A003973(k) >= 2*sigma(k).

Original entry on oeis.org

6, 8, 9, 12, 14, 15, 16, 18, 20, 21, 24, 27, 28, 30, 32, 35, 36, 40, 42, 44, 45, 48, 49, 50, 52, 54, 56, 60, 63, 64, 66, 68, 70, 72, 75, 76, 78, 80, 81, 84, 88, 90, 92, 96, 98, 99, 100, 102, 104, 105, 108, 110, 112, 114, 117, 120, 124, 125, 126, 128, 130, 132, 135, 136, 138, 140, 144, 147, 148, 150, 152, 153, 154
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2020

Keywords

Comments

Note that A003973(n) >= sigma(n) for all n. See A336852.
Like the abundancy index (ratio A000203(n)/n), and ratio A003961(n)/n, the ratio A003973(n)/sigma(n) is also multiplicative and > 1 for all n > 1. Thus if the number has a proper divisor that is in this sequence, then the number itself is also. See A337543 for those terms included here, but which have no proper divisor in this sequence. - Antti Karttunen, Aug 31 2020
All terms are in A246282 because A341528(n) < A341529(n) for all n > 1. - Antti Karttunen, Feb 22 2021

Crossrefs

Cf. A337382 (complement), A337383 (characteristic function).
Subsequences: A337378, A337384, A337386, A337543 (primitive terms).
Subsequence of A246282.

Programs

  • PARI
    A003973(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); sigma(factorback(f)); };
    isA337381(n) = (A003973(n)>=2*sigma(n));

A336853 a(n) = A003961(n) - n, where A003961 is the prime shift towards larger primes.

Original entry on oeis.org

0, 1, 2, 5, 2, 9, 4, 19, 16, 11, 2, 33, 4, 19, 20, 65, 2, 57, 4, 43, 34, 17, 6, 111, 24, 25, 98, 71, 2, 75, 6, 211, 32, 23, 42, 189, 4, 31, 46, 149, 2, 123, 4, 73, 130, 41, 6, 357, 72, 97, 44, 101, 6, 321, 36, 241, 58, 35, 2, 255, 6, 49, 212, 665, 54, 129, 4, 103, 76, 161, 2, 603, 6, 49, 170, 131, 66, 177, 4, 487, 544
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2020

Keywords

Crossrefs

Cf. A000035, A001359 (positions of 2's), A003961, A252748, A336852 (inverse Möbius transform).

Programs

  • PARI
    A336853(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); (factorback(f)-n); };

Formula

a(n) = A003961(n) - n.
a(n) = A252748(n) + n.
A000035(a(n)) = 1 - A000035(n).

A336851 a(n) = sigma(A003961(n)) - A003961(n), where A003961 is a prime shift towards larger primes, sigma is the sum of divisors.

Original entry on oeis.org

0, 1, 1, 4, 1, 9, 1, 13, 6, 11, 1, 33, 1, 15, 13, 40, 1, 49, 1, 41, 17, 17, 1, 105, 8, 21, 31, 57, 1, 87, 1, 121, 19, 23, 19, 178, 1, 27, 23, 131, 1, 123, 1, 65, 73, 33, 1, 321, 12, 81, 25, 81, 1, 249, 21, 183, 29, 35, 1, 309, 1, 41, 97, 364, 25, 141, 1, 89, 35, 153, 1, 565, 1, 45, 97, 105, 25, 177, 1, 401, 156, 47
Offset: 1

Views

Author

Antti Karttunen, Aug 05 2020

Keywords

Comments

Even terms occur on square n, odd terms on nonsquare n.
Numbers k such that a(k) = 2^e for e >= 1, are: 4, 25, 841, 12769, 66896041, etc., i.e., terms of A073715 squared.

Crossrefs

Programs

  • PARI
    A003961(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A336851(n) = (sigma(A003961(n)) - A003961(n));

Formula

a(n) = A003973(n) - A003961(n) = A000203(A003961(n)) - A003961(n).
a(n) = A001065(A003961(n)).
a(n) = A336852(n) - A286385(n).

Extensions

Comments edited by Antti Karttunen, Jul 03 2023

A336855 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), for all i, j >= 1, where f(p) = p-nextprime(p) for primes p, and f(n) = n for all other numbers.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 6, 7, 8, 9, 3, 10, 6, 11, 12, 13, 3, 14, 6, 15, 16, 17, 18, 19, 20, 21, 22, 23, 3, 24, 18, 25, 26, 27, 28, 29, 6, 30, 31, 32, 3, 33, 6, 34, 35, 36, 18, 37, 38, 39, 40, 41, 18, 42, 43, 44, 45, 46, 3, 47, 18, 48, 49, 50, 51, 52, 6, 53, 54, 55, 3, 56, 18, 57, 58, 59, 60, 61, 6, 62, 63, 64, 18, 65, 66
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2020

Keywords

Comments

Restricted growth sequence transform of function f defined as: f(n) = -{distance to the next larger prime} when n is a prime, otherwise f(n) = -n.
For all i, j:
a(i) = a(j) => A305801(i) = A305801(j),
a(i) = a(j) => A336852(i) = A336852(j),
a(i) = a(j) => A336853(i) = A336853(j).

Crossrefs

Cf. also A001359 (positions of 3's), A305801, A319704, A331304, A336852, A336853.

Programs

  • PARI
    up_to = 100000;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A336855aux(n) = if(isprime(n),n-nextprime(1+n),n);
    v336855 = rgs_transform(vector(up_to,n,A336855aux(n)));
    A336855(n) = v336855[n];
Showing 1-6 of 6 results.