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.

User: Luis H. Gallardo

Luis H. Gallardo's wiki page.

Luis H. Gallardo has authored 25 sequences. Here are the ten most recent ones:

A355891 Numbers k such that k = ivgenpoly(A) for some composite polynomial A in F_2[x] that satisfies the condition sigma(A) = A + 1.

Original entry on oeis.org

1905, 424321, 438065, 443617, 7044945, 7899377, 7925761, 26397649, 32286449, 38123521, 55759233
Offset: 1

Author

Luis H. Gallardo, Jul 28 2022

Keywords

Comments

Let A be a polynomial in F_2[x]. We let lift(A) in Z[x] denote the same polynomial, but with integer coefficients 0,1.
Let ivgenpoly(A) be the positive integer equal to the lift(A) evaluated in x=2. For example, if A = x^2+x+1 in F_2[x], we have lift(A) = x^2+x+1 in Z[x], and ivgenpoly(A) = 2^2+2+1 = 7. Similarly, for every positive integer n, we let genpoly(n) denote the unique polynomial A in F_2[x] such that n = ivgenpoly(A). The coefficients of A, are the digits of the base-2 expansion of n.
Over the integers, it is easy to check that sigma(p)=p+1 implies that p is a prime number, where sigma(n) is the sum of all positive divisors of the positive integer n. However, in F_2[x] the analogous result is false.
We denote by sigma(A) the sum of all divisors of A. The sequence shows integers k = ivgenpoly(A) such that A is a composite polynomial in F_2[x] for which sigma(A)=A+1.

Examples

			a(1) = 1905, since 1905 = ivgenpoly(A), with A = x^10+x^9+x^8+x^6+x^5+x^4+1, satisfies A = (x^3+x+1)*(x^3+x^2+1)*(x^4+x+1) so that sigma(A) = (x^3+x)*(x^3+x^2)*(x^4+x) = A+1, and for any number m with 0 < m < 1905, with m = ivgenpoly(B), one has that either sigma(B) is unequal to B+1 or B is irreducible.
Moreover, a(2) = 424321, since 424321 = ivgenpoly(A), with A = x^18+x^17+x^14+x^13+x^12+x^11+x^8+x^7+1, satisfies A = (x^4+x^3+1)*(x^4+x^3+x^2+x+1)*(x^5+x^2+1)*(x^5+x^4+x^2+1) so that sigma(A) = A+1, and for any number m with 1905 < m < 424321, with m = ivgenpoly(B), one has that either sigma(B) is unequal to B+1 or B is irreducible.
		

Crossrefs

Cf. A000203.

A354226 a(n) is the number of distinct prime factors of (p^p - 1)/(p - 1) where p = prime(n).

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 3, 1, 4, 7, 1, 7, 5, 3, 3, 5, 3, 4, 6, 4, 10, 5, 4, 6, 6, 9, 5, 4, 5, 8, 6, 4, 11
Offset: 1

Author

Luis H. Gallardo, May 20 2022

Keywords

Comments

a(34) > 3, and depends on the full factorization of the 296-digit composite number (139^139 - 1)/138. - Tyler Busby, Jan 22 2023
Sequence continues as ?, 8, ?, 5, 8, 4, 5, ?, 8, ?, 8, 7, 6, 3, 3, ..., where ? represents uncertain terms. - Tyler Busby, Jan 22 2023

Examples

			a(3)=2, since (5^5 - 1)/(5 - 1) = 11*71.
		

Programs

  • PARI
    a(n) = my(p=prime(n)); omega((p^p-1)/(p-1)); \\ Michel Marcus, May 22 2022
    
  • Python
    from sympy import factorint, prime
    def a(n): p = prime(n); return len(factorint((p**p-1)//(p-1)))
    print([a(n) for n in range(1, 12)]) # Michael S. Branicky, May 23 2022

Formula

a(n) = A001221(A001039(n)).

Extensions

a(18)-a(33) from Amiram Eldar, May 20 2022

A351682 Prime numbers p such that the (p-1)-st Bell number B(p-1) is a primitive root modulo p.

Original entry on oeis.org

2, 3, 11, 13, 17, 19, 29, 31, 47, 53, 71, 103, 113, 127, 131, 137, 139, 149, 173, 179, 181, 191, 211, 233, 239, 241, 251, 257, 263, 269, 293, 317, 347, 367, 379, 401, 431, 439, 449, 461, 503, 509, 523, 541, 557, 587, 607, 617, 619, 647, 653, 683, 691, 733, 743, 761, 773, 797, 821, 823, 827, 853, 859, 881, 919, 929
Offset: 1

Author

Luis H. Gallardo, May 04 2022

Keywords

Comments

Heuristically, the density of the sequence in the primes should approach Artin's constant: 0.3739558136...

Examples

			For n = 2 one has a(2) = 3 since B(2) = 2 is a primitive root modulo 3.
		

Crossrefs

Programs

  • Maple
    filter:= proc(p) local b;
      b:= combinat:-bell(p-1);
      numtheory:-order(b,p) = p-1
    end proc:
    select(filter, [seq(ithprime(i),i=1..200)]); # Robert Israel, May 04 2023

Extensions

Corrected by Robert Israel, May 04 2023

A351688 Prime numbers p such that the order of the (p-1)-th Bell number B(p-1) is a power of 2 modulo p.

Original entry on oeis.org

3, 17, 23, 37, 67, 89, 193, 227, 257, 593, 641, 769, 1889, 10331, 12289, 13441, 18433, 40961, 65537, 85121, 96769, 2752513, 3655681
Offset: 1

Author

Luis H. Gallardo, May 05 2022

Keywords

Comments

An odd prime p is a counterexample of Kurepa's conjecture if and only if B(p-1) = 1 modulo p.

Examples

			a(1)=3 since B(2)=2 has order 2 modulo 3.
a(3)=37, since B(36)=6 modulo 37 has order 4 = 2^2 modulo 37.
		

Crossrefs

Cf. A000110.

Programs

  • Mathematica
    Do[p = Prime[k]; m = Mod[BellB[p-1], p]; If[m != 0, f = FactorInteger[MultiplicativeOrder[m, p]]; If[Length[f] == 1 && f[[1, 1]] == 2, Print[p]]], {k, 1, 500}] (* Vaclav Kotesovec, May 06 2022 *)

A350523 Prime numbers p such that K(p) = 0! + 1! + ... + (p-1)! == -2 (mod p).

Original entry on oeis.org

2, 3, 23, 67, 227, 10331
Offset: 1

Author

Luis H. Gallardo, Jan 03 2022

Keywords

Comments

The Kurepa Conjecture says that K(p) is nonzero in F_p, the finite field with p elements. Primes for which K(p) takes some fixed nonzero value in F_p might have some interest.
No further terms < 6*10^6. - Michael S. Branicky, Jan 03 2022

Crossrefs

Subsequence of A236400.

Programs

  • Mathematica
    q[p_] := PrimeQ[p] && Divisible[Sum[k!, {k, 0, p - 1}] + 2, p]; Select[Range[230], q] (* Amiram Eldar, Jan 03 2022 *)
  • Python
    from sympy import isprime
    def K(n):
        ans, f = 0, 1
        for i in range(1, n+1):
            ans += f%n
            f = (f*i)%n
        return ans%n
    def ok(n): return isprime(n) and (K(n) + 2)%n == 0
    print([k for k in range(11000) if ok(k)]) # Michael S. Branicky, Jan 03 2022
    
  • Python
    # faster version for initial segment of sequence
    from sympy import isprime
    def afind(limit):
        f = 1 # (p-1)!
        s = 2 # sum(0! + 1! + ... + (p-1)!)
        for p in range(2, limit+1):
            if isprime(p) and s%p == p-2:
                print(p, end=", ")
            s += f*p
            f *= p
    afind(11000) # Michael S. Branicky, Jan 03 2022

A350429 Prime numbers p for which there exists at least one integer k < p such that p divides the k-th Bell number.

Original entry on oeis.org

5, 7, 13, 19, 23, 29, 37, 47, 53, 61, 67, 71, 73, 89, 101, 107, 131, 137, 139, 157, 163, 167, 173, 179, 181, 191, 193, 211, 223, 239, 241, 251, 271, 277, 281, 283, 293, 307, 311, 313, 331, 349, 353, 367, 401, 419, 431, 433, 439, 443, 449, 467, 491, 499, 509, 541
Offset: 1

Author

Luis H. Gallardo, Dec 30 2021

Keywords

Comments

Igor Shparlinski proved in 1991 that k < (1/2)*binomial(2*p,p) (see A290059).

Examples

			a(1)=5 since modulo 5 we have B(0)=1, B(1)=1, B(2)=2, and B(3)=0.
		

Crossrefs

Programs

  • Mathematica
    q[p_] := Module[{k = 1}, While[k < p && ! Divisible[BellB[k], p], k++]; k < p]; Select[Range[500], PrimeQ[#] && q[#] &] (* Amiram Eldar, Dec 30 2021 *)

A335383 a(n) is the number of irreducible Mersenne polynomials in GF(2)[x] that have degree n.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 0, 4, 2, 2, 2, 0, 2, 6, 0, 6, 2, 0, 2, 2, 2, 4, 0, 4, 0, 0, 8, 2, 2, 8, 0, 4, 2, 2, 2, 0, 0, 6, 0, 4, 0, 0, 2, 0, 2, 8, 0, 8, 0, 0, 8, 0, 0, 4, 0, 8, 2, 0, 8, 0, 2, 8, 0, 4, 0, 0, 4, 0, 0, 10, 0, 6, 2, 0, 2, 0, 0, 4, 0, 6, 0, 0, 6, 0, 2, 2, 0, 2, 0, 0, 2, 2, 2, 4, 0, 8, 4, 0, 6
Offset: 2

Author

Luis H. Gallardo, Jun 04 2020

Keywords

Comments

A Mersenne polynomial is a binary (i.e., an element of GF(2)[x]) polynomial M, of degree > 1, such that M+1 has only 0 and 1 as roots in a fixed algebraic closure of GF(2).
If for some positive integers a,b, M = x^a(x+1)^b+1 is an irreducible Mersenne polynomial, then gcd(a,b)=1. This condition is not sufficient.
There is no known formula for a(n). Of course it is bounded above by the total number of prime (irreducible) binary polynomials of degree n, but this is a too weak upper bound. A trivial, better upper bound, is simply n-1, the total number of Mersenne polynomials (prime or not) of degree n.

Examples

			For n = 5 one has a(5) = 2 since there are 2 irreducible Mersenne polynomials of degree 5. Namely, x^2*(x+1)^3+1 and x^3*(x+1)^2+1.
For n = 8, a(8) = 0 since there are no irreducible Mersenne polynomial of degree 8.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(k=1, n-1, polisirreducible(Mod(1, 2)*(x^(n-k)*(x+1)^k+1))); \\ Michel Marcus, Jun 07 2020

Formula

a(A272486(n)) = 0. - Michel Marcus, Jun 07 2020

A335379 a(n) is the number of Mersenne prime (irreducible) polynomials M = x^k(x+1)^(n-k)+1 of degree n in GF(2)[x] (k goes from 1 to n-1) such that Phi_7(M) has an odd number of prime divisors (omega(Phi_7(M)) is odd).

Original entry on oeis.org

1, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
Offset: 2

Author

Luis H. Gallardo, Jun 03 2020

Keywords

Comments

Phi_7(x)=1+x+x^2+x^3+x^4+x^5+x^6, is the 7th cyclotomic polynomial; omega(P(x)) counts the 2 X 2 distinct irreducible divisors of the binary polynomial P(x) in GF(2)[x].
It is surprising that a(n) be so small (conjecturally it is always 1 or 2). The sequence appeared when working the special case p=7 of a conjecture (see Links) about prime divisors in GF(2)[x] of the composed cyclotomic polynomial Phi_p(M), where p is a prime number and M is a Mersenne irreducible polynomial.

Examples

			For n=4 a(4)= 0 (the sequence begins a(2)=1,a(3)=2,...), since there is no Mersenne polynomial M of degree 4 in GF(2)[x] such that omega(Phi_7(M)) is odd.
		

Crossrefs

Programs

  • PARI
    a(n)={my(phi7=polcyclo(7)); sum(k=1, n-1, my(p=Mod(x^k * (x+1)^(n-k) + 1, 2)); polisirreducible(p) && #(factor(subst(phi7, x, p))~)%2)} \\ Andrew Howroyd, Jun 04 2020

Extensions

Terms a(22) and beyond from Andrew Howroyd, Jun 04 2020

A307671 Decimal expansion of the alternating convergent series S = Sum_{k>=0} (-1)^k*f(k), where f(k) = harmonic(2^k) - k*log(2) - gamma, harmonic(m) is the Sum_{j=1..m} 1/j, and gamma is Euler-Mascheroni constant.

Original entry on oeis.org

2, 7, 2, 3, 4, 3, 5, 8, 7, 7, 0, 7, 5, 9, 6, 7, 6, 4, 7, 8, 4, 0, 7, 0, 6, 7, 6, 9, 2, 3, 9, 5, 5, 5, 7, 8, 7, 4, 8, 2, 2, 5, 1, 0, 8, 0, 6, 4, 3, 9, 5, 8, 7, 1, 6, 4, 5, 3, 8, 9, 6, 2, 0, 4, 1, 2, 8, 3, 7, 5, 9, 7, 0, 0, 5, 7, 2, 9, 6, 5, 1, 1, 5, 0, 1, 2, 9, 8, 4, 6, 1, 7, 7, 3, 1, 3, 1, 7, 3, 9, 8, 0, 2, 7
Offset: 0

Author

Luis H. Gallardo, Apr 20 2019

Keywords

Examples

			0.272343587707596764784070676923955578748225108064395871645389620412837597...
		

Crossrefs

Cf. A001620 (Euler-Mascheroni), A001008/A002805 (harmonic), A002162 (log(2)), A094640 (alternate Euler's constant), A256921 (a similar constant).

Programs

  • Maple
    evalf(Sum((-1)^k*(harmonic(2^k) - k*log(2) - gamma), k=0..infinity), 120); # Vaclav Kotesovec, Apr 30 2019
  • Mathematica
    digits = 104; s = NSum[(-1)^k*(HarmonicNumber[2^k] - k*Log[2] - EulerGamma), {k, 0, Infinity}, Method -> "AlternatingSigns", WorkingPrecision -> digits+10]; RealDigits[s, 10, digits][[1]] (* Jean-François Alcover, Apr 28 2019 *)
  • PARI
    default(realprecision, 120); sumalt(k=0, (-1)^k*(psi(2^k+1) - k*log(2))) \\ Vaclav Kotesovec, Apr 30 2019

A280717 Given a prime number p, let b = -p and c = p^2. Assuming that the polynomial P(x) := x^2+b*x+c takes at least one prime value for some positive integer x

Original entry on oeis.org

3, 7, 43, 1693, 2864557, 8205572225569, 67331415548799635795058613, 4533519519805137360312930667312809111343819483374997, 20552799236454203238557860425684304712780972342513397945121797314302926172950212696842909492430773376197
Offset: 1

Author

Luis H. Gallardo, Jan 07 2017

Keywords

Comments

The next term is only defined if the set S above is not empty.
Conjecture: the sequence is well defined.
a(13) has 1654 digits. If S is not empty, then its maximal element is P(x) where x is the least positive integer x <= p/2 such that P(x) is prime. - Chai Wah Wu, Jan 09 2017

Examples

			a(2) = 7, since 7 = max S_3, where S_3 = {x^2-3x+9 : x is an integer with 0<x<2, and x^2-3x+9 is a prime number}. Clearly, S_3={7}, thus a(2)=7. Now we explain why a(3)=43. We have 43 = max S_7. S_7 := {x^2-7x+49 : x is an integer, 0 <x<7, and x^2-7x+49 is a prime number}. By computations S_7 = {37,43}. Thus a(3) = max S_7 = 43. We explain also why a(4) = 1693. One has 1693 = max S_43, where S_43 = {x^2-43x+43^2 : x is an integer, 0 <x < 43, and x^2-43x+43^2 is a prime number}. By computations S_43 = {1399,1429,1459,1543,1597,1627,1693}. Thus a(3) = max S_43 = 1693.
		

Programs

  • Maple
    with(numtheory):
    xa := proc(aa) local P,x,a,a2,mi,mm; a:= aa; a2 := a^2; mi := 0; for x from 1 to a-1 do P := x^2-a*x+a2; if isprime(P) then mi := max(P,mi); fi; od;; mi; end;
    F := proc(n) option remember if n=1 then return(3); fi; if n=2 then xa(3); else xa(F(n-1)); fi; end;
  • Mathematica
    P[p_, x_] := x^2 - p x + p^2;
    A280717[1] = 3;
    A280717[n_] := A280717[n] = P[A280717[n - 1], NestWhile[# - 1 &, A280717[n - 1] - 1, # > A280717[n - 1]/2 && ! PrimeQ@P[A280717[n - 1], #] &]];
    A280717 /@ Range[5] (* Davin Park, Feb 06 2017 *)
  • Python
    from _future_ import division
    from sympy import isprime
    A280717_list, n = [3], 3
    for _ in range(10):
        for i in range(1,n//2+1):
            j = i**2+n*(n-i)
            if isprime(j):
                n = j
                A280717_list.append(n)
                break # Chai Wah Wu, Jan 09 2017

Extensions

a(5) corrected and a(6)-a(9) added by Chai Wah Wu, Jan 09 2017