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 71-80 of 198 results. Next

A212953 Minimal order of degree-n irreducible polynomials over GF(2).

Original entry on oeis.org

1, 3, 7, 5, 31, 9, 127, 17, 73, 11, 23, 13, 8191, 43, 151, 257, 131071, 19, 524287, 25, 49, 69, 47, 119, 601, 2731, 262657, 29, 233, 77, 2147483647, 65537, 161, 43691, 71, 37, 223, 174763, 79, 187, 13367, 147, 431, 115, 631, 141, 2351, 97, 4432676798593, 251
Offset: 1

Views

Author

Alois P. Heinz, Jun 01 2012

Keywords

Comments

a(n) = smallest odd m such that A002326((m-1)/2) = n. - Thomas Ordowski, Feb 04 2014
For n > 1; n < a(n) < 2^n, wherein a(n) = n+1 iff n+1 is A001122 a prime with primitive root 2, or a(n) = 2^n-1 iff n is a Mersenne exponent A000043. - Thomas Ordowski, Feb 08 2014

Examples

			For n=4 the degree-4 irreducible polynomials p over GF(2) are 1+x+x^2+x^3+x^4, 1+x+x^4, 1+x^3+x^4. Their orders (i.e., the smallest integer e for which p divides x^e+1) are 5, 15, 15. (Example: (1+x+x^2+x^3+x^4) * (1+x) == x^5+1 (mod 2)). Thus the minimal order is 5 and a(4) = 5.
		

References

  • W. Narkiewicz, Elementary and Analytic Theory of Algebraic Numbers, Springer 2004, Third Edition, 4.3 Factorization of Prime Ideals in Extensions. More About the Class Group (Theorem 4.33), 4.4 Notes to Chapter 4 (Theorem 4.40). - Regarding the first comment.

Crossrefs

Programs

  • Maple
    with(numtheory):
    M:= proc(n) option remember;
          divisors(2^n-1) minus U(n-1)
        end:
    U:= proc(n) option remember;
          `if`(n=0, {}, M(n) union U(n-1))
        end:
    a:= n-> min(M(n)[]):
    seq(a(n), n=1..50);
  • Mathematica
    M[n_] := M[n] = Divisors[2^n-1] ~Complement~ U[n-1];
    U[n_] := U[n] = If[n == 0, {}, M[n] ~Union~ U[n-1]];
    a[n_] := Min[M[n]];
    Array[a, 50] (* Jean-François Alcover, Mar 22 2017, translated from Maple *)

Formula

a(n) = min(M(n)) with M(n) = {d : d|(2^n-1)} \ U(n-1) and U(n) = M(n) union U(n-1) for n>0, U(0) = {}.
a(n) = A059912(n,1) = A213224(n,1).

A246702 The number of positive k < (2n-1)^2 such that (2^k - 1)/(2n - 1)^2 is an integer.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 1, 3, 2, 1, 10, 2, 1, 1, 1, 6, 3, 2, 1, 9, 2, 3, 3, 2, 2, 6, 1, 13, 9, 1, 1, 10, 5, 1, 3, 2, 8, 3, 2, 2, 1, 1, 10, 3, 8, 7, 9, 2, 2, 3, 1, 2, 26, 1, 3, 9, 4, 2, 9, 4, 1, 6, 1, 18, 9, 1, 7, 3, 2, 1, 3, 2, 5, 10, 1, 10, 6, 38, 3, 3, 4, 1, 41, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 15 2014

Keywords

Comments

a(n) is the number of integers k in range 1 .. A016754(n-1)-1 such that A000225(k) is an integral multiple of A016754(n-1). - Antti Karttunen, Nov 15 2014
Conjecture: the positions of 1's, a(k)=1, are exactly given by the 2k-1 which are elements of A167791. - Antti Karttunen, Nov 15 2014
From Charlie Neder, Oct 18 2018: (Start)
It would appear that, if 2k-1 is in A167791, then so is (2k-1)^2, and so a(k) = 1 would follow by definition.
Conjecture: Let B be the first value such that (2k-1)^2 divides 2^B - 1. Then either 2k-1 divides B, or 2k-1 is a Wieferich prime (A001220). (End)

Examples

			a(2) = 1 because (2^6 - 1)/(2*2 - 1)^2 = 7 is an integer and 6 < 9.
a(3) = 1 because (2^20 - 1)/(2*3 - 1)^2 = 41943 is an integer and 20 < 25.
a(3) = 2 because (2^21 - 1)/(2*4 - 1)^2 = 42799 is an integer and 21 < 49; and also (2^42 - 1)/(2*4 - 1)^2 = 89756051247 is an integer and 42 < 49.
		

Crossrefs

A246703 gives the positions of records.

Programs

  • Maple
    A246702 := proc(n)
        local a,klim,k ;
        a := 0 ;
        klim := (2*n-1)^2 ;
        for k from 1 to klim-1 do
            if modp(2^k-1,klim) = 0 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A246702(n),n=1..80) ; # R. J. Mathar, Nov 15 2014
  • Mathematica
    A246702[n_] := Module[{a, klim, k}, a = 0; klim = (2*n-1)^2; For[k = 1, k <= klim-1, k++, If[Mod[2^k-1, klim] == 0, a = a+1]]; a];
    Table[A246702[n], {n, 1, 84}] (* Jean-François Alcover, Oct 04 2017, translated from R. J. Mathar's Maple code *)
  • PARI
    a(n)=my(t=(2*n-1)^2,m=Mod(1,t)); sum(k=1,t-1,m*=2;m==1) \\ Charles R Greathouse IV, Nov 16 2014
    
  • PARI
    a246702(n) = my(m=(2*n-1)^2); (m-1)\znorder(Mod(2,m)); \\ Max Alekseyev, Oct 11 2023
  • Scheme
    (define (A246702 n) (let ((u (A016754 (- n 1)))) (let loop ((k (- u 1)) (s 0)) (cond ((zero? k) s) ((zero? (modulo (A000225 k) u)) (loop (- k 1) (+ s 1))) (else (loop (- k 1) s)))))) ;; Antti Karttunen, Nov 15 2014
    

Formula

a(n) = floor( 4*n*(n-1) / A002326(2*n*(n-1)) ). - Max Alekseyev, Oct 11 2023

Extensions

Corrected by R. J. Mathar, Nov 15 2014

A256608 Longest eventual period of a^(2^k) mod n for all a.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 4, 1, 2, 2, 1, 1, 1, 2, 6, 1, 2, 4, 10, 1, 4, 2, 6, 2, 3, 1, 4, 1, 4, 1, 2, 2, 6, 6, 2, 1, 4, 2, 6, 4, 2, 10, 11, 1, 6, 4, 1, 2, 12, 6, 4, 2, 6, 3, 28, 1, 4, 4, 2, 1, 2, 4, 10, 1, 10, 2, 12, 2, 6, 6, 4, 6, 4, 2, 12, 1, 18, 4, 20, 2, 1, 6
Offset: 1

Views

Author

Ivan Neretin, Apr 04 2015

Keywords

Comments

a(n) is a divisor of phi(phi(n)) (A010554).

Examples

			In other words, eventual period of {0..n-1} under the map x -> x^2 mod n.
For example, with n=10 the said map acts as follows. Read down the columns: the column headed 2 for example means that (repeatedly squaring mod 10), 2 goes to 4 goes to 16 = 6 (mod 10) goes to 36 = 6 mod 10 --- and has reached a fixed point.
0 1 2 3 4 5 6 7 8 9
0 1 4 9 6 5 6 9 4 1
0 1 6 1 6 5 6 1 6 1
0 1 6 1 6 5 6 1 6 1
and thus every number reaches a fixed point. This means the eventual common period is 1, hence a(10)=1.
		

Crossrefs

First differs from A256607 at n=43.
LCM of entries in row n of A279185.

Programs

  • Mathematica
    a[n_] := With[{lambda = CarmichaelLambda[n]}, MultiplicativeOrder[2, lambda / (2^IntegerExponent[lambda, 2])]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 28 2016 *)
  • PARI
    rpsi(n) = lcm(znstar(n)[2]); \\ A002322
    pb(n) = znorder(Mod(2, n/2^valuation(n, 2))); \\ A007733
    a(n) = pb(rpsi(n)); \\ Michel Marcus, Jan 28 2016

Formula

a(n) = A007733(A002322(n)).
a(prime(n)) = A037178(n). - Michel Marcus, Jan 27 2016

Extensions

Name changed by Jianing Song, Feb 02 2025

A268923 All odd primes a(n) such that for all odd primes q smaller than a(n) the order of 2 modulo a(n)*q is a proper divisor of phi(a(n)*q)/2. The totient function phi is given in A000010.

Original entry on oeis.org

17, 31, 41, 43, 73, 89, 97, 109, 113, 127, 137, 151, 157, 193, 223, 229, 233, 241, 251, 257, 277, 281, 283, 307, 313, 331, 337, 353, 397, 401, 409, 431, 433, 439, 449, 457, 499, 521, 569, 571, 577, 593, 601, 617, 631, 641, 643, 673, 683, 691, 727, 733, 739, 761, 769, 809, 811, 857, 881, 911, 919
Offset: 1

Views

Author

Wolfdieter Lang, Apr 01 2016

Keywords

Comments

This sequence was inspired by A269454 submitted by Marina Ibrishimova.
It seems that if for an odd prime p > 3 the order(2, p*3) < phi(p*3)/2 = p-1 then p is in this sequence.
Note that 2^(phi(p*q)/2) == 1 (mod p*q) for distinct odd primes p and q, due to Nagell's corollary on Theorem 64, p. 106. The products of distinct primes considered in the present sequence have order of 2 modulo p*q smaller than phi(p*q)/2.
Up to and including prime(100) = 541 the only odd primes p such that for all odd primes q smaller than p the order of 2 modulo p*q equals phi(p*q)/2 are 5, 7, and 11.
Complement of A216371 = A001122 U A105874 in the set of odd primes. Composed of the primes modulo which neither 2 nor -2 is a primitive root. Also, prime(n) is a term iff A376010(n) > 2. - Max Alekseyev, Sep 05 2024

Examples

			n=1: Order(2, 17*3) = 8, and 8 is a proper divisor of phi(17*3)/2 = 16;
   order(2, 17*5) =  8, and 8 is a proper divisor of phi(17*5)/2 = 32;
   order(2, 17*7) = 24, and 24 is a proper divisor of phi(17*7)/2 = 48;
   order(2, 17*11) = 40, and 40 is a proper divisor of phi(17*11)/2 = 80;
   order(2, 17*13) = 24, and 24 is a proper divisor of phi(17*13)/2 = 96.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range[3, 157], Function[p, AllTrue[Prime@ Range[2, PrimePi@ p - 1], Function[q, With[{e = EulerPhi[p q]/2}, And[Divisible[e, #], # != e]] &@ MultiplicativeOrder[2, p q]]]]] (* Michael De Vlieger, Apr 01 2016, Version 10 *)

Extensions

More terms from Michael De Vlieger, Apr 01 2016

A286573 Compound filter: a(n) = P(A007733(n), A046523(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 2, 5, 7, 14, 23, 9, 29, 42, 40, 65, 80, 90, 31, 40, 121, 44, 142, 189, 109, 61, 115, 77, 302, 273, 148, 318, 94, 434, 532, 20, 497, 115, 86, 148, 826, 702, 271, 148, 355, 230, 601, 119, 220, 265, 131, 299, 1178, 297, 485, 86, 265, 1430, 838, 320, 328, 271, 556, 1769, 1957, 1890, 50, 142, 2017, 148, 751, 2277, 179, 373, 832, 665, 2932, 54, 856, 485
Offset: 1

Views

Author

Antti Karttunen, May 26 2017

Keywords

Crossrefs

Programs

  • PARI
    A007733(n) = znorder(Mod(2, n/2^valuation(n, 2))); \\ This function from Michel Marcus, Apr 11 2015
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286573(n) = (1/2)*(2 + ((A007733(n)+A046523(n))^2) - A007733(n) - 3*A046523(n));
    
  • Python
    from sympy import divisors, factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a002326(n):
        m=1
        while True:
            if (2**m - 1)%(2*n + 1)==0: return m
            else: m+=1
    def a000265(n): return max(list(filter(lambda i: i%2 == 1, divisors(n))))
    def a007733(n): return a002326((a000265(n) - 1)/2)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a(n): return T(a007733(n), a046523(n)) # Indranil Ghosh, May 26 2017

Formula

a(n) = (1/2)*(2 + ((A007733(n)+A046523(n))^2) - A007733(n) - 3*A046523(n)).

A295740 Even pseudoprimes (A006935) that are not squarefree.

Original entry on oeis.org

190213279479817426, 283959621257123566, 301971651496560046, 575203724324614126, 800951203404568126, 849341919686285026, 1118572636403947726, 2080713636347910526, 2270517620327541586, 2767984602684877486, 5013069719001987826, 5133266340887464066, 5252931629341901506, 5743747078662858526
Offset: 1

Views

Author

Max Alekseyev, Nov 26 2017

Keywords

Comments

For a prime p, if p^2 divides an even pseudoprime, then p is a Wieferich prime (A001220) and A007733(p)=A002326((p-1)/2) is odd. Currently, the only known such prime is p=3511.
So, all known terms are multiples of 3511^2. Furthermore, no term can be a multiple of 3511^3.

Examples

			a(1) = 190213279479817426 = 2 * 7 * 79 * 1951 * 3511^2 * 7151.
a(2) = 283959621257123566 = 2 * 599 * 937 * 3511^2 * 20521.
a(3) = 301971651496560046 = 2 * 31 * 71 * 73 * 3511^2 * 76231.
		

Crossrefs

Intersection of A006935 and A013929.
The even terms of A158358. Also, unless there is a Wieferich prime greater than 3511, the even terms of A247831.

A003571 Order of 3 mod 3n+1.

Original entry on oeis.org

1, 2, 6, 4, 3, 4, 18, 5, 20, 6, 30, 16, 18, 4, 42, 11, 42, 6, 20, 28, 10, 16, 22, 12, 12, 18, 78, 8, 16, 10, 6, 23, 48, 20, 34, 52, 27, 12, 44, 29, 5, 30, 126, 12, 18, 16, 138, 35, 28, 18, 50, 30, 78, 8, 162, 41, 39, 42, 60, 88, 45, 22, 80, 36, 16, 42, 198, 100, 8
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    List([0..70],n->OrderMod(3,3*n+1)); # Muniru A Asiru, Feb 16 2019
    
  • Maple
    a := n -> `if`(n=0, 1, numtheory:-order(3, 3*n+1)):
    seq(a(n), n = 0..68);
  • Mathematica
    Table[MultiplicativeOrder[3, 3*n + 1], {n, 0, 68}] (* Arkadiusz Wesolowski, Nov 27 2012 *)
  • PARI
    a(n) = znorder(Mod(3, 3*n+1)); \\ Michel Marcus, Feb 16 2019
  • Sage
    def A003571(n):
        s, m, N = 0, 1, 3*n + 1
        while True:
            k = N + m
            v = valuation(k, 3)
            s += v
            m = k // 3^v
            if m == 1: break
        return s
    print([A003571(n) for n in (0..68)]) # Peter Luschny, Oct 07 2017
    

Extensions

a(0) = 1 added by Peter Luschny, Oct 07 2017

A007346 Order of group generated by perfect shuffles of 2n cards.

Original entry on oeis.org

2, 8, 24, 24, 1920, 7680, 322560, 64, 92897280, 3715891200, 40874803200, 194641920, 25505877196800, 1428329123020800, 21424936845312000, 160, 23310331287699456000, 1678343852714360832000, 31888533201572855808000
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Bisections give A002671, A274303.

Programs

  • Maple
    f:=proc(n) local k,i,np;
    if n=1 then 2
    elif (n mod 2) = 1 then n!*2^(n-1)
    elif n=6 then 2^9*3*5
    elif n=12 then 2^17*3^3*5*11
    elif n=2 then 8
    elif (n mod 4)=2 then n!*2^n
    else
    np:=n; k:=1;
    for i while (np mod 2) = 0 do
       np:=np/2; k:=k+1; od;
       if (n=2^(k-1)) then k*2^k else n!*2^(n-2); fi;
    fi;
    end;
    [seq(f(n),n=1..64)]; # N. J. A. Sloane, Jun 20 2016
  • Mathematica
    a[1] = 2; a[2] = 8; a[n_] := With[{m = 2^n*n!}, Which[Mod[n, 4] == 2, If[n == 6, m/6, m], Mod[n, 4] == 1, m/2, Mod[n, 4] == 3, m/2, True, If[n == 2^IntegerExponent[n, 2], 2*n*(IntegerExponent[n, 2] + 1), If[n == 12, m/(2*7!), m/4]]]]; Table[a[n], {n, 1, 19}](* Jean-François Alcover, Feb 17 2012, after Franklin T. Adams-Watters *)
  • PARI
    A007346(n) = local(M); M=2^n*n!; if(n%4==2, if(n==2, 8, if(n==6, M/6, M)), if(n%4==1, if(n==1, 2, M/2), if(n%4==3, M/2, if(n==2^valuation(n, 2), 2*n*(valuation(n, 2)+1), if(n==12, M/(7!*2), M/4))))) \\ Franklin T. Adams-Watters, Nov 30 2006

Formula

See Maple program. - N. J. A. Sloane, Jun 20 2016

Extensions

Corrected and extended by Franklin T. Adams-Watters, Nov 30 2006

A056951 Triangle whose rows show the result of flipping the first, first two, ... and finally first n coins when starting with the stack (1,2,3,4,...,n) [starting with all heads up, where signs show whether particular coins end up heads or tails].

Original entry on oeis.org

-1, -2, 1, -3, -1, 2, -4, -2, 1, 3, -5, -3, -1, 2, 4, -6, -4, -2, 1, 3, 5, -7, -5, -3, -1, 2, 4, 6, -8, -6, -4, -2, 1, 3, 5, 7, -9, -7, -5, -3, -1, 2, 4, 6, 8, -10, -8, -6, -4, -2, 1, 3, 5, 7, 9, -11, -9, -7, -5, -3, -1, 2, 4, 6, 8, 10, -12, -10, -8, -6, -4, -2, 1, 3, 5, 7, 9, 11, -13, -11, -9, -7, -5, -3, -1, 2, 4, 6, 8, 10, 12, -14, -12, -10
Offset: 1

Views

Author

Henry Bottomley, Sep 05 2000

Keywords

Examples

			Third row is constructed by starting from (1, 2, 3), going to (-1, 2, 3), then going to (-2, 1, 3) and finally going to (-3, -1, 2). Rows are: (-1), (-2, 1), (-3, -1, 2), (-4, -2, 1, 3) etc. as each row is reverse of previous row, with signs changed and -n added as the first term in the row.
		

Crossrefs

A003558 is the number of times the operation needs to be repeated to return to the starting point, taking no account of heads/tails (i.e., signs). A002326 is the number required if heads/tails (i.e., signs) are also required to return to their original position.
Cf. A130517 (unsigned version).

Programs

  • Mathematica
    t[n_, 1] := -n; t[n_, n_] := n - 1; t[n_, k_] := 2 * k - n - If[2 * k <= n + 1, 2, 1]; Table[t[n, k], {n, 14}, {k, n}] // Flatten (* Jean-François Alcover, Oct 03 2013 *)

Formula

T(n, k) = 2k - n - b with 1 <= k <= n (where b = 2 if 2k <= n + 1, b = 1 otherwise).

A059911 a(n) = |{m : multiplicative order of n mod m = 6}|.

Original entry on oeis.org

0, 3, 10, 16, 37, 10, 42, 24, 58, 53, 164, 26, 68, 38, 32, 68, 169, 22, 222, 38, 42, 50, 328, 40, 180, 219, 108, 26, 334, 82, 460, 82, 92, 72, 220, 108, 449, 86, 128, 80, 192, 22, 336, 110, 222, 218, 540, 84, 778, 129, 150, 80, 270, 54, 328, 356, 132, 68, 348, 22
Offset: 1

Views

Author

Vladeta Jovovic, Feb 08 2001

Keywords

Comments

The multiplicative order of a mod m, gcd(a,m) = 1, is the smallest natural number d for which a^d = 1 (mod m).

Examples

			a(2) = |{9,21,63}| = 3, a(3) = |{7,14,28,52,56,91,104,182,364,728}| = 10, a(4) = |{13,35,39,45,65,91,105,117,195,273,315,455,585,819,1365,4095}| = 16,...
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Total[{1, -1, -1, 1} * DivisorSigma[0, n^{6, 3, 2, 1} - 1]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jan 25 2025*)
  • PARI
    a(n) = if(n == 1, 0, numdiv(n^6-1) - numdiv(n^3-1) - numdiv(n^2-1) + numdiv(n-1)); \\ Amiram Eldar, Jan 25 2025

Formula

a(n) = tau(n^6-1)-tau(n^3-1)-tau(n^2-1)+tau(n-1), where tau(n) = number of divisors of n A000005. Generally, if b(n, r) = |{m : multiplicative order of n mod m = r}| then b(n, r) = Sum_{d|r} mu(d)*tau(n^(r/d)-1), where mu(n) = Moebius function A008683.
Previous Showing 71-80 of 198 results. Next