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 11-18 of 18 results.

A385225 Primes p such that multiplicative order of -5 modulo p is odd.

Original entry on oeis.org

2, 3, 7, 23, 29, 43, 47, 61, 67, 83, 103, 107, 127, 163, 167, 223, 227, 229, 263, 283, 307, 347, 349, 367, 383, 421, 443, 449, 463, 467, 487, 503, 509, 521, 523, 547, 563, 587, 607, 643, 647, 661, 683, 701, 709, 727, 743, 761, 787, 821, 823, 827, 863, 883, 887, 907, 947, 967, 983
Offset: 1

Views

Author

Jianing Song, Jun 22 2025

Keywords

Comments

The multiplicative order of -5 modulo a(n) is A385231(n).
Contained in primes congruent to 1, 3, 7, 9 modulo 20 (primes p such that -5 is a quadratic residue modulo p, A139513), and contains primes congruent to 3, 7 modulo 20 (A122870).
Conjecture: this sequence has density 1/3 among the primes.

Crossrefs

Subsequence of A139513. Contains A122870 as a subsequence.
Cf. A385231 (the actual multiplicative orders).
Cf. other bases: A014663 (base 2), A385220 (base 3), A385221 (base 4), A385192 (base 5), A163183 (base -2), A385223 (base -3), A385224 (base -4), this sequence (base -5).

Programs

  • Mathematica
    Select[Prime[Range[200]], OddQ[MultiplicativeOrder[-5, #]] &] (* Paolo Xausa, Jun 28 2025 *)
  • PARI
    isA385225(p) = isprime(p) && (p!=5) && znorder(Mod(-5,p))%2

A091317 Primes p that divide 2^n+1 for some n.

Original entry on oeis.org

2, 3, 5, 11, 13, 17, 19, 29, 37, 41, 43, 53, 59, 61, 67, 83, 97, 101, 107, 109, 113, 131, 137, 139, 149, 157, 163, 173, 179, 181, 193, 197, 211, 227, 229, 241, 251, 257, 269, 277, 281, 283, 293, 307, 313, 317, 331, 347, 349, 353, 373, 379, 389, 397, 401, 409, 419, 421, 433
Offset: 1

Views

Author

N. J. A. Sloane, Feb 21 2004

Keywords

Comments

From Charles R Greathouse IV, Feb 13 2009: (Start)
Essentially the same as A014662.
Also primes p for which p^2 divides 2^n+1 for some n. If p | 2^g + 1, then 2^g = kp - 1 for some k, so 2^gp = (kp - 1)^p = (-1)^p + (-1)^(p-1) * kp * (p choose 1) + ... and so 2^gp = -1 (mod p^2). (End)

Crossrefs

Complement in primes of A014663.
Cf. A014662. - Charles R Greathouse IV, Feb 13 2009

Programs

  • Maple
    2, op(select(t -> isprime(t) and numtheory:-order(2,t)::even, [seq(2*i+1, i=1..1000)])); # Robert Israel, Aug 12 2015
  • Mathematica
    Join[{2}, Select[Prime[Range[100]], EvenQ[MultiplicativeOrder[2, #/ (2^IntegerExponent[#, 2])]]&]] (* Jean-François Alcover, Sep 02 2018 *)
  • PARI
    isA091317(p)=!bitand(znorder(Mod(2,p)),1) \\ Charles R Greathouse IV, Feb 13 2009

Formula

Has density 17/24 (Hasse 1966).

A103291 Numbers k such that sigma(2^k-1) >= 2*(2^k-1)-1, i.e., the number 2^k-1 is perfect, abundant, or least deficient.

Original entry on oeis.org

1, 12, 24, 36, 40, 48, 60, 72, 80, 84, 90, 96, 108, 120, 132, 140, 144, 156, 160, 168, 180, 192, 200, 204, 210, 216, 220, 228, 240, 252, 264, 270, 276, 280, 288, 300, 312, 320, 324, 330, 336, 348, 360, 372, 384, 396, 400, 408, 420, 432, 440, 444, 450, 456, 468
Offset: 1

Views

Author

Max Alekseyev, Jan 28 2005

Keywords

Comments

Is there an odd term besides 1? Numbers 2^a(i)-1 form set difference of sequences A103289 and A096399.
Odd terms > 1 exist, but there are none < 10^7. If k > 1 is an odd term, then 2^k-1 must have more than 900000 distinct prime factors and all of them must be members of A014663. - David Wasserman, Apr 15 2008

Crossrefs

Programs

  • PARI
    for(i=1,1000,n=2^i-1;if(sigma(n)>=2*n-1,print1(i, ", ")));

Formula

Numbers k such that 2^k-1 is in A103288.

Extensions

More terms from David Wasserman, Apr 15 2008

A278966 Least Hamming weight of multiples of the n-th prime.

Original entry on oeis.org

1, 2, 2, 3, 2, 2, 2, 2, 3, 2, 5, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 2, 4, 2, 2, 3, 2, 2, 2, 7, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 4, 2, 2, 4, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 4, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2
Offset: 1

Views

Author

Keywords

Comments

Since all primes after the first are odd, a(n) > 1 for n > 1.
a(n) = 2 if and only if A014664(n) is even, or equivalently prime(n) is not in A014663. - Robert Israel, Dec 08 2016
If prime(n) = A000668(k), then a(n) = A000043(k). - Robert Israel, Dec 20 2016

Crossrefs

Programs

  • Maple
    f:= proc(n) local p, R, V, W, k,v,r;
        p:= ithprime(n);
        R:= {seq(2 &^ i mod p, i=0..numtheory:-order(2,p)-1)};
        Rm:= map(t -> p-t, R);
        V:= R;
        W:= V;
        for k from 2 do
          if nops(V intersect Rm) > 0 then return k fi;
          V:= {seq(seq(v+r mod p, v=V),r=R)} minus W;
        W:= W union V;
        od
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Dec 20 2016
  • Mathematica
    a[n_] := Module[{p, R, V, W, k, v, r}, p = Prime[n]; R = Union @ Table[ PowerMod[2, i, p], {i, 0, MultiplicativeOrder[2, p]-1}]; Rm = p - R; V = R; W = V; For[k = 2, True, k++, If[Length[V ~Intersection~ Rm] > 0, Return[k]]; V = Union@ Flatten@ Table[Table[v + Mod[r, p], {v, V}], {r, R}] ~Complement~ W; {W, W ~Union~ V}]];
    a[1] = 1;
    Array[a, 100] (* Jean-François Alcover, Jun 08 2020, after Robert Israel *)
  • PARI
    a(n,p=prime(n))=my(o=znorder(Mod(2,p)), v1=Set(powers(Mod(2,p),o)), v=v1, s=1); while(!setsearch(v,Mod(0,p)), v=setbinop((x,y)->x+y,v,v1); s++); s

Formula

a(n) = A000120(A278967(n)). In particular, a(n) = A000120(prime(n)) whenever prime(n) is in A143027. - Max Alekseyev, May 22 2025

A103292 Numbers k such that sigma(2^k - 1) >= 2(2^k - 1), i.e., the number 2^k - 1 is perfect or abundant.

Original entry on oeis.org

12, 24, 36, 40, 48, 60, 72, 80, 84, 90, 96, 108, 120, 132, 140, 144, 156, 160, 168, 180, 192, 200, 204, 210, 216, 220, 228, 240, 252, 264, 270, 276, 280, 288, 300, 312, 320, 324, 330, 336, 348, 360, 372, 384, 396, 400, 408, 420, 432, 440, 444, 450, 456, 468, 480, 492, 504
Offset: 1

Views

Author

Max Alekseyev, Jan 28 2005

Keywords

Comments

Numbers k that 2^k - 1 is in A023196.
Are there any odd terms? This is a subsequence of A103291. Is the number 1 the only term where they differ? This is so if there is no least deficient number of the form 2^n-1 besides 1.
For each n in the sequence, 2n is also in the sequence: sigma[2^(2n)-1] = sigma[(2^n+1)(2^n-1)] >= (2^n+1)*sigma(2^n-1) because for each divisor d|2^n-1 there is (at least) the divisor (2^n+1)d |[(2^n+1)(2^n-1)]. Inserting sigma(2^n-1) >=2(2^n-1) yields (2^n+1)*sigma(2^n-1)>=(2^n+1)*2*(2^n-1)=2*[2^(2n)-1] qed. - R. J. Mathar, Aug 07 2007
From David Wasserman, May 16 2008: (Start)
Odd members exist. One such n is the lcm of the first 4416726 members of A139686, which has 6864499 digits. To show that n is a member, it's not necessary to exactly compute sigma(2^n-1).
The function f(x) = sigma(x)/x is multiplicative and has the property that for any a, b > 1, f(ab) > f(a). So it suffices to find some y such that f(y) >= 2 and y divides 2^n-1. In this case, y is the product of the first 4416726 members of A014663 and has 35260810 digits. (A014663(4416726) = 278379727.)
To see that this works, note that if a divides b, then 2^a-1 divides 2^b-1. For 1 <= i <= 4416726, A014663(i) divides 2^A139686(i)-1 by definition and A139686(i) divides n, so 2^A139686(i)-1 divides 2^n-1 and therefore A014663(i) divides 2^n-1. Then we can compute that f(y) = Product_{i = 1..4416726} (1 + 1/A014663(i)) is > 2.
The members of A014663 are the only primes that can divide 2^n-1 with n odd. Any powers of these primes are also possible divisors.
By including powers, we can construct a much smaller y. I found a y with 7057382 digits, omega(y) = 969004 and bigomega(y) = 969440. This y is close to the minimum possible. The least n such that y divides 2^n-1 is an odd number with 1472897 digits.
However, minimizing y is not the way to minimize n. We can get a smaller n by skipping primes p such that the order of 2 mod p is divisible by a large prime. This increases the number and size of the prime factors needed to make f(y) >= 2 and the time needed to find them.
The least odd n that I've found has 28375 digits. The corresponding y has 305621222 digits, omega(y) = 31903142 and bigomega(y) = 32796897. To find these prime factors, I searched up to A014663(96433108) = 7154804519.
I believe that the smallest odd member has between 10000 and 20000 digits, but the largest lower bound I can prove has 8 digits: f(p^i) is bounded above by 1 + 1/(p-1) and Product_{i=1..c} (1 + 1/(A014663(i)-1)) < 2 if c < 968858, so y must be at least Product_{i=1..968858} A014663(i), which has 7054790 digits.
Then n must be large enough that 2^n-1 >= y, yielding a lower bound of 23435503. I don't see any way to increase this significantly. (End)

Crossrefs

Programs

  • PARI
    for(i=1,1000,n=2^i-1;if(sigma(n)>=2*n,print(i)));

Extensions

Extended to a(32) by R. J. Mathar, Aug 07 2007
Terms from a(33) onwards from David Wasserman, May 16 2008

A367230 Base-2 Fermat pseudoprimes k such that the multiplicative order of 2 modulo k is odd.

Original entry on oeis.org

2047, 4681, 15841, 42799, 52633, 90751, 220729, 256999, 271951, 486737, 514447, 647089, 741751, 916327, 1082401, 1145257, 1730977, 1969417, 2205967, 2304167, 2748023, 2811271, 2953711, 2976487, 3567481, 4188889, 4469471, 4835209, 4863127, 5016191, 5049001, 5681809
Offset: 1

Views

Author

Amiram Eldar, Nov 11 2023

Keywords

Comments

The corresponding sequence for primes is A014663.
These pseudoprimes seem to be relatively rare: among the 118968378 base-2 Fermat pseudoprimes below 2^64 only 6292535 are terms of this sequence.
These pseudoprimes appear in a theorem by Rotkiewicz and Makowski (1966) about pseudoprimes that are products of two Mersenne numbers (see A367229).

Crossrefs

Intersection of A001567 and A036259.
A367231 is a subsequence.

Programs

  • Mathematica
    Select[2*Range[10^6] + 1, PowerMod[2, # - 1, #] == 1 && CompositeQ[#] && OddQ[MultiplicativeOrder[2, #]] &]
  • PARI
    is(n) = n > 1 && n % 2 && Mod(2, n)^(n-1) == 1 && !isprime(n) && znorder(Mod(2, n)) % 2;

A367229 Fermat pseudoprimes to base 2 that are products of two Mersenne numbers (not necessarily distinct) that are larger than 1.

Original entry on oeis.org

1905, 15841, 129921, 8322945, 66977281, 4395899025409, 4398012825601, 140735340806145, 36892925197465616385, 2342736497361113055105, 4951750712408555360305545217, 39304596247310823728047193985, 2535301191011725837253847547905, 1298074214624262174166747352924161
Offset: 1

Views

Author

Amiram Eldar, Nov 11 2023

Keywords

Comments

Without the restriction to Mersenne numbers that are larger than 1 all the composite Mersenne numbers (A065341) will be terms.
Szymiczek (1964) proved that if p is a prime == 7 (mod 8) (A007522) and t = 2^phi((p-1)/2), then M(p)*M(t) is a Fermat pseudoprime to base 2, where phi is the Euler totient function (A000010) and M(n) = 2^n-1 = A000225(n) is the n-th Mersenne number. The smallest pseudoprime that is generated by this rule, for p = 7 and t = 2^phi((7-1)/2) = 4, is M(7) * M(4) = 1905. The next two, corresponding to p = 23 and 31, have 316 and 87 digits, respectively.
Rotkiewicz and Makowski (1966) proved that if p is a prime or a Fermat pseudoprime to base 2 such that o(p), the multiplicative order of 2 modulo p, is odd (A014663 for primes, A367230 for pseudoprimes), then for each positive k <= p/o(o(p)), if t = 2^(k*o(o(p))) then M(p)*M(t) is a Fermat pseudoprime to base 2. For example, for p = 7, p/o(o(7)) = 7/2, so for k = 1, 2 and 3 the resulting pseudoprimes are 1905, 8322945 and 2342736497361113055105, respectively.

Examples

			a(1) = 1905 = (2^4-1) * (2^7-1).
a(2) = 15841 = (2^5-1) * (2^9-1).
		

Crossrefs

Programs

  • Mathematica
    With[{max = 110}, m = 2^Range[2, max] - 1; Sort@ Select[Times @@@ Subsets[m, {2}], # < m[[-1]] && PowerMod[2, # - 1, #] == 1 &]]

A213049 Primes p such that the order of 2 mod p is a square.

Original entry on oeis.org

5, 37, 73, 101, 109, 197, 257, 577, 601, 641, 677, 727, 1601, 1801, 2593, 3137, 3389, 3457, 4057, 4357, 5477, 8101, 8837, 10369, 14401, 14407, 16901, 17957, 18253, 18433, 20809, 21317, 22501, 25601, 30977, 33857, 37447, 42437, 44101, 47629, 47653, 50177
Offset: 1

Views

Author

Joerg Arndt, Jun 03 2012

Keywords

Examples

			The order of 2 mod 601 is 25, which is a square, so 601 is a term.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [2..6275] | IsSquare(Modorder(2, NthPrime(n)))]; // Bruno Berselli, Jun 08 2012
  • PARI
    { forprime (p=3, 10^6,
        r = znorder(Mod(2,p));
        if ( issquare(r), print1(p,", ") );
    ); }
    
Previous Showing 11-18 of 18 results.