This site is supported by donations to The OEIS Foundation.

User:Daniel Suteu

From OeisWiki
Jump to navigationJump to search


Free and open-source software developer, with main interests in programming language design, algorithms, mathematics (number theory) and data compression.


In March 2013, I started the Sidef programming language project, which combines many good things from good languages, trying to make programming easier and more enjoyable, focusing primarily on simplicity, elegance and readability.


Sidef tutorial:


Among other things, the language comes with fast built-in methods for primality testing and prime factorization, along with many other number-theoretic functions, most of them provided by Dana Jacobsen's excellent Math::Prime::Util::GMP module. Also built-in, we have support for arbitrary large integers, rationals, floats and complex numbers, using the GMP, MPFR and MPC libraries.


The language can also be tried online at: https://tio.run/#sidef.


WWW:


Partial sums of arithmetical functions

For any arithmetical function f(k), we have the following identity (for m >= 0):


k=1nd|kf(d)(k/d)m=k=1nf(k)j=1n/kjm=k=1nf(k)Fm(n/k)


where Fn(x) are the Faulhaber polynomials, defined as:


Fn(x)=Bn+1(x+1)Bn+1(1)n+1


where Bn(x) are the Bernoulli polynomials. The Faulhaber polynomials are particularly useful in efficiently summing the m-th powers of the first n positive integers (with m >= 0):


k=1nkm=Fm(n)


...and are also useful in efficiently computing second partial sums of m-th powers (sums of power sums) with m >= 0:


k=1nj=1kjm=(n+1)Fm(n)Fm+1(n)


In this section, we're interested in computing the following partial sum in sublinear time, with m >= 0, where f(k) is an arithmetical function:


k=1nf(k)Fm(n/k)


If the partial sums of f(k) can be computed efficiently:


S(n)=k=1nf(k)


then it's possible to create the following sublinear formula:


k=1nf(k)Fm(n/k)=k=1nFm(k)(S(n/k)S(n/(k+1)))+k=1n/(n+1)f(k)Fm(n/k)


More generally, the partial sums over the Dirichlet convolution of two arithmetic functions f and g, can be computed in sublinear time, if the individual partial sums of f and g can be computed efficiently:


R(n)=k=1nf(k)


S(n)=k=1ng(k)


Assuming that R(n) and S(n) can be computed efficiently, then we can use the Dirichlet hyperbola method to compute the following partial sum in sublinear time:


k=1nd|kf(d)g(k/d)=k=1n(f(k)S(n/k)+g(k)R(n/k))R(n)S(n)


More on this at: https://trizenx.blogspot.com/2018/11/partial-sums-of-arithmetical-functions.html

Partial sums of the sigma function

For m >= 0 and j >= 0, we have:


k=1nkmσj(k)=k=1nkm+jFm(n/k)=k=1nkmFm+j(n/k)


which can be computed in sublinear time by using the Dirichlet hyperbola method:


k=1nkmσj(k)=k=1n(kmFm+j(n/k)+km+jFm(n/k))Fm+j(n)Fm(n)


where Fn(x) are the Faulhaber polynomials.


An asymptotic approximation to this partial sum, with m >= 0 and j >= 1, is given by the following formula:


k=1nkmσj(k)ζ(j+1)nj+m+1j+m+1


where ζ(s) is the Riemann zeta function.

Partial sums of the Jordan totient function

The Jordan totient function is a generalization of the Euler totient function, and is defined as:


Jm(n)=nmp|n(11/pm)


and is multiplicative with:


Jm(pk)=pkmp(k1)m


An elegant formula for computing partial sums of the Jordan totient function, is given in terms of the Möbius function and the Faulhaber polynomials:


k=1nJm(k)=k=1nμ(k)Fm(n/k)


An asymptotic approximation to this partial sum, with m >= 1, is given by:


k=1nJm(k)nm+1(m+1)ζ(m+1)


where ζ(s) is the Riemann zeta function.

Partial sums of the Dedekind psi function

The generalized Dedekind psi function can be defined in terms of the Jordan totient function, as:


ψm(n)=J2m(n)Jm(n)


and is multiplicative with:


ψm(pk)=pkm+p(k1)m


Partial sums of the Dedekind psi function can be expressed in terms of the absolute value of the Möbius function and the Faulhaber polynomials:


k=1nψm(k)=k=1n|μ(k)|Fm(n/k)


with the following asymptotic approximation for m >= 1:


k=1nψm(k)nm+1ζ(m+1)(m+1)ζ(2(m+1))


where ζ(s) is the Riemann zeta function.

Partial sums of the omega(n) and bigomega(n) functions

We define the generalized ωm(n) and Ωm(n) functions as:


ωm(n)=pk|nnmpm

Ωm(n)=pk|nj=1knmpjm


where pk are primes p dividing n, with multiplicity k.


For ωm(n) we have the following sequences:


ω0(n)= A001221(n)

ω1(n)= A069359(n)

ω2(n)= A322078(n)


Similarly, for Ωm(n), we have:


Ω0(n)= A001222(n)

Ω1(n)= A095112(n)

Ω2(n)= A322664(n)


Partial sums of this functions can be expressed in terms of the Faulhaber polynomials, as:


k=1nωm(k)=pnFm(n/p)

k=1nΩm(k)=pknFm(n/pk)


where p and pk (with k>=1) run over the prime numbers and the prime powers, respectively, less than or equal to n.


For m>=1, the partial sums of ωm(k) can be described asymptotically as:


k=1nωm(k)Fm(n)P(m+1)


where Fm(n) are the Faulhaber polynomials and P(s) is the Prime zeta function, defined as:


P(s)=p1ps


Very similarly, for m>=1, the partial sums of Ωm(k) satisfy:


k=1nΩm(k)Fm(n)Q(m+1)


where Fm(n) are the Faulhaber polynomials and Q(s) is defined as:


Q(s)=k=1p1psk=p1ps1


where p runs over the prime numbers.

Partial sums - OEIS sequences

Considering the following partial sum, where f(k) is an arithmetic function and Fn(x) are the Faulhaber polynomials:


Rm(n)=k=1nd|kf(d)(k/d)m=k=1nf(k)Fm(n/k)


gives us the following table of interesting sequences:

+------------+------------+------------+
|    f(k)    |   R_0(n)   |   R_1(n)   |
+------------+------------+------------+
| A000012(k) | A006218(n) | A024916(n) |
| A000027(k) | A024916(n) | A143127(n) |
| A010051(k) | A013939(n) | A322068(n) |
| A069513(k) | A022559(n) | A328893(n) |
| A008966(k) | A064608(n) | A173290(n) |
| A008683(k) | A000012(n) | A002088(n) |
| A000290(k) | A064602(n) | A143128(n) |
| A000010(k) | A000217(n) | A272718(n) |
| A034444(k) | A061503(n) | A306775(n) |
+------------+------------+------------+

Generalized Pillai arithmetical function

For any arithmetical function f(k), we have the following identity:


k=1nf(gcd(n,k))=d|nf(d)ϕ(n/d)


where ϕ(x) is the Euler totient function.

Abundant Fermat pseudoprimes

On 17 December 2017, Shyam Sunder Gupta published the following problem on their website: "Can you find the smallest abundant number which is also pseudoprime (base-2)?".


On 9th November 2019, I generated 42 abundant Fermat pseudoprimes to base 2, the smallest one in my list being the following 40-digit number:

3470207934739664512679701940114447720865


Meanwhile, I generated a few more abundant pseudoprimes to base 2, which can be found here.


Update (28 August 2022): using a new idea, I generated two smaller abundant Fermat pseudoprimes to base 2:

2596282479202818734176082185090403265

12796625128232187655293894634808130945


Update (10 March 2023): using the same idea as above, I've found two smaller abundant Fermat pseudoprimes to base 2:

898943937249247967890084629421065

222042825169546323981793629414604065


Challenge: find a smaller abundant Fermat pseudoprime to base 2, or prove that there is no smaller one.

Abundant Carmichael numbers

Inspired by Shyam Sunder Gupta's problem, in A329460, Amiram Eldar asked the question: "Do abundant Carmichael numbers exist?".


On 15th August 2020, I answered the question in positive (source code) by generating the following 97-digit abundant Carmichael number, showing that abundant Carmichael numbers do exist:

2050222770372550554323267720953963601363820698627252818938445687085323309254089582862054255135745


In constructing abundant Carmichael numbers, one important idea (source code) is the following: if a Carmichael number is a multiple of an odd abundant cyclic number, such as:

8177568910636879136524885826320973235

or

17277031840122951876810012573270045985

then it will be abundant. Since the above multipliers are both odd abundant cyclic numbers and all odd cyclic numbers seem to have Carmichael multiples, suggests that infinitely many abundant Carmichael numbers do exist.


A day later, I constructed a slightly smaller (88-digit) abundant Carmichael number (but, most likely, it's still not the smallest one):

2059832906607460252767290568443059994787898033540634712711845135488141590979778401392385


Challenge: find an abundant Carmichael number divisible by 3.

Open problem: find the smallest abundant Carmichael number.


A list of Carmichael numbers with abundancy index > 1.9 can be found here.

Abundant Lucas-Carmichael numbers

A related question would be: "do abundant Lucas-Carmichael numbers exist?". The answer is "yes"!

For generating abundant Lucas-Carmichael numbers, we used a similar method as in the generation of abundant Carmichael numbers.

First, we generated odd squarefree (almost) abundant numbers k (source code), satisfying gcd(k,ψ(k))=1, where ψ(n) is the Dedekind psi function. Such a number k must be a term of A255602.

Then we used a modified version of Erdős's construction method for Carmichael numbers, adapted to the construction of Lucas-Carmichael numbers (source code) and also with support for using our multiplier k with its corresponding lambda value L.


The smallest abundant Lucas-Carmichael number that I was able to find so far, is the following 70-digit number:

1012591408428327888883952080728349448745451794025524955777432246705535


It is conjectured that every term of A255602 is a divisor of a Lucas-Carmichael number. The smallest such multiples are given in A253598. If the conjecture is true, then there exists infinitely many abundant Lucas-Carmichael numbers, as the A255602 sequence includes infinitely many abundant terms.


Challenge: find an abundant Lucas-Carmichael number divisible by 3.

Open problem: find the smallest abundant Lucas-Carmichael number.


Several upper-bounds to A253598 are listed here.

A list of Lucas-Carmichael numbers with abundancy index > 1.9 is available here.

Agrawal's conjecture

In the article Remarks on Agrawal's conjecture, Hendrick Lenstra showed that if a Carmichael number, with an odd number of prime factors p|n=>p=3mod80, is also a Lucas-Carmichael number, then it would be a counter-example to Agrawal's conjecture (cf. A329223).


Currently, only the following such Carmichael numbers are known, but none of them is also a Lucas-Carmichael number:


330468624532072027=2003*574003*287432003

1358406397003392026912594827=47051443*3811166803*7575282163

194462892367341977828363075381947=1571719603*22527980963*5492112195923


More Fermat pseudoprimes to base 2 with these properties, can be found here.

Upper-bounds to some OEIS sequences

Smallest anti-Carmichael Fermat psp-2 with n prime factors

Thomas Ordowski defined the following interesting sequence: a(n)= A316908(n) is the smallest k with n prime factors such that 2k1=1modk and p1 does not divide k1 for every prime p dividing k.


a(9)<=797365221484475174021

a(10)<=1315856103949347820015303981

a(11)<=6357507186189933506573017225316941

a(12)<=77822245466150976053960303855104674781

a(13)<=42864570625001423761497389323695509974049581

a(14)<=34015651529746754841597629769101132590516759547941

a(15)<=53986954871543199290951271756765558658193549930487667861


More upper-bounds can be found here.

Smallest imprimitive Carmichael number with n prime factors

Amiram Eldar defined the following interesting sequence: a(n)= A328938(n) is the smallest imprimitive Carmichael number with n prime factors.


An imprimitive Carmichael number is defined to be a Carmichael number, n=p1*p2*...*pk, such that:

gcd(p11,p21,...,pk1)2>lcm(p11,p21,...,pk1)


The list of imprimitive Carmichael numbers is given by A328935.


a(8)<=1717329690048308373193368241

a(9)<=3267914929260691848833226795711841

a(10)<=16412975107923138847512341751620644377601

a(11)<=325533792014488126487416882038879701391121

a(12)<=1605045791181700950034233564955898780122791301414374937801

a(13)<=1802188215375086135161896807172372148518756613537876342449815601

a(14)<=37301957856686414877340399600312307212530668530569712518803959550606029812859921

a(15)<=111752741147928878460543122185614013584493764844954493341714777557828905006762368931787841


More upper-bounds can be found here.

Smallest super-pseudoprime to base 2 with n prime factors

Also submitted by Amiram Eldar, the sequence a(n)= A328665(n) lists the smallest super-pseudoprime to base 2 with n prime factors.


The list of super-pseudoprimes to base 2 is given by A050217.


a(7)<=1842158622953082708177091

a(8)<=192463418472849397730107809253922101

a(9)<=1347320741392600160214289343906212762456021

a(10)<=70865138168006643427403953978871929070133095474701

a(11)<=3363391752747838578311772729701478698952546288306688208857

a(12)<=132153369641266990823936945628293401491197666138621036175881960329

a(13)<=9105096650335639994239038954861714246150666715328403635257215036295306537

a(14)<=7605797846771738682631804190686245080923244102451432651379391224410677241944951032625821


More upper-bounds can be found here.

Smallest super-pseudoprime to base 2 Carmichael number with n prime factors

In 2017, Max Alekseyev and Thomas Ordowski submitted the A291637 sequence, which lists the Carmichael numbers that are also super-pseudoprimes to base 2.


Letting a(n) to be the smallest such number with n prime factors, we have:

a(3)=294409

a(4)=3018694485093841


By using the tables of pseudoprimes up to 264, we find that a(5)>264.

a(5)<=521635331852681575100906881

a(6)<=2835402730651853232634509813787097410561

a(7)<=165784025660216242122027716057592895796242004385542265601


A list of terms with 5 or more prime factors, can be found here.

Smallest overpseudoprime to base 2 Carmichael number with n prime factors

The sequence A352987 lists the Carmichael numbers that are also overpseudoprimes to base 2.


Letting a(n) to be the smallest such number with n prime factors, we have:

a(3)=65700513721

a(4)<=84286331493236478328609

a(5)<=3157343757823970959759947380425728583752001


A list of terms with 4 or more prime factors, can be found here

Smallest overpseudoprime to base 2 with n prime factors

Inspired by the A328665 sequence, in A353409 we list the smallest overpseudoprime to base 2 with n distinct prime factors.


Some upper-bounds to this sequence are:

a(5)<=1376414970248942474729

a(6)<=48663264978548104646392577273

a(7)<=294413417279041274238472403168164964689

a(8)<=98117433931341406381352476618801951316878459720486433149

a(9)<=1252977736815195675988249271013258909221812482895905512953752551821


More upper-bounds can be found here.

Math scripts

Computer-generated images