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

A294434 a(0)=0; for n>0, a(n) = (A163778(n)-1)/2.

Original entry on oeis.org

0, 1, 2, 4, 5, 11, 14, 16, 17, 19, 20, 25, 26, 32, 34, 40, 41, 44, 47, 49, 52, 56, 59, 65, 67, 77, 86, 89, 91, 94, 95, 104, 110, 115, 116, 119, 121, 122, 125, 130, 136, 140, 146, 149, 151, 154, 161, 164, 179, 185, 187, 196, 205, 206, 209, 214, 215, 220, 221
Offset: 0

Views

Author

N. J. A. Sloane, Nov 16 2017

Keywords

Comments

Appears to be equal to the indices of maximal entries in A294673.

Crossrefs

A054639 Queneau numbers: numbers n such that the Queneau-Daniel permutation {1, 2, 3, ..., n} -> {n, 1, n-1, 2, n-2, 3, ...} is of order n.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 11, 14, 18, 23, 26, 29, 30, 33, 35, 39, 41, 50, 51, 53, 65, 69, 74, 81, 83, 86, 89, 90, 95, 98, 99, 105, 113, 119, 131, 134, 135, 146, 155, 158, 173, 174, 179, 183, 186, 189, 191, 194, 209, 210, 221, 230, 231, 233, 239
Offset: 1

Views

Author

Gilles Esposito-Farese (gef(AT)cpt.univ-mrs.fr), May 17 2000

Keywords

Comments

The troubadour Arnaut Daniel composed sestinas based on the permutation 123456 -> 615243, which cycles after 6 iterations.
Roubaud quotes the number 141, but the corresponding Queneau-Daniel permutation is only of order 47 = 141/3.
This appears to coincide with the numbers n such that a type-2 optimal normal basis exists for GF(2^n) over GF(2). But are these two sequences really the same? - Joerg Arndt, Feb 11 2008
The answer is Yes - see Theorem 2 of the Dumas reference. [Jean-Guillaume Dumas (Jean-Guillaume.Dumas(AT)imag.fr), Mar 20 2008]
From Peter R. J. Asveld, Aug 17 2009: (Start)
a(n) is the n-th T-prime (Twist prime). For N >= 2, the family of twist permutations is defined by
p(m,N) == +2m (mod 2N+1) if 1 <= m < k = ceiling((N+1)/2),
p(m,N) == -2m (mod 2N+1) if k <= m < N.
N is T-prime if p(m,N) consists of a single cycle of length N.
The twist permutation is the inverse of the Queneau-Daniel permutation.
N is T-prime iff p=2N+1 is a prime number and exactly one of the following three conditions holds;
(1) N == 1 (mod 4) and +2 generates Z_p^* (the multiplicative group of Z_p) but -2 does not,
(2) N == 2 (mod 4) and both +2 and -2 generate Z_p^*,
(3) N == 3 (mod 4) and -2 generate Z_p^* but +2 does not. (End)
The sequence name says the permutation is of order n, but P. R. J. Asveld's comment says it's an n-cycle. Is there a proof that those conditions are equivalent for the Queneau-Daniel permutation? (They are not equivalent for any arbitrary permutation; e.g., (123)(45)(6) has order 6 but isn't a 6-cycle.) More generally, I have found that for all n <= 9450, (order of Queneau-Daniel permutation) = (length of orbit of 1) = A003558(n). Does this hold for all n? - David Wasserman, Aug 30 2011

Examples

			For N=6 and N=7 we obtain the permutations (1 2 4 5 3 6) and (1 2 4 7)(3 6)(5): 6 is T-prime, but 7 is not. - _Peter R. J. Asveld_, Aug 17 2009
		

References

  • Raymond Queneau, Note complémentaire sur la Sextaine, Subsidia Pataphysica 1 (1963), pp. 79-80.
  • Jacques Roubaud, Bibliothèque Oulipienne No 65 (1992) and 66 (1993).

Crossrefs

Not to be confused with Queneau's "s-additive sequences", see A003044.
A005384 is a subsequence.
Union of A163782 (Josephus_2-primes) and A163781 (dual Josephus_2-primes); also the union of A163777 (Archimedes_0-primes) and A163778 (Archimedes_1-primes); also the union of A071642/2 (shuffle primes) and A163776/2 (dual shuffle primes). - Peter R. J. Asveld, Aug 17 2009
Cf. A216371, A003558 (for which a(n) == n).

Programs

  • Maple
    QD:= proc(n) local i;
      if n::even then map(op,[seq([n-i,i+1],i=0..n/2-1)])
      else map(op, [seq([n-i,i+1],i=0..(n-1)/2-1),[(n+1)/2]])
      fi
    end proc:
    select(n -> GroupTheory:-PermOrder(Perm(QD(n)))=n, [$1..1000]); # Robert Israel, May 01 2016
  • Mathematica
    a[p_] := Sum[Cos[2^n Pi/((2 p + 1) )], {n, 1, p}];
    Select[Range[500],Reduce[a[#] == -1/2, Rationals] &] (* Gerry Martens, May 01 2016 *)
  • PARI
    is(n)=
    {
        if (n==1, return(1));
        my( m=n%4 );
        if ( m==4, return(0) );
        my(p=2*n+1, r=znorder(Mod(2,p)));
        if ( !isprime(p), return(0) );
        if ( m==3 && r==n, return(1) );
        if ( r==2*n, return(1) ); \\ r == 1 or 2
        return(0);
    }
    for(n=1,10^3, if(is(n),print1(n,", ")) );
    \\ Joerg Arndt, May 02 2016

Formula

a(n) = (A216371(n)-1)/2. - L. Edson Jeffery, Dec 18 2012
a(n) >> n log n, and on the Bateman-Horn-Stemmler conjecture a(n) << n log^2 n. I imagine a(n) ≍ n log n, and numerics suggest that perhaps a(n) ~ kn log n for some constant k (which seems to be around 1.122). - Charles R Greathouse IV, Aug 02 2023

A163777 Even terms in the sequence of Queneau numbers A054639.

Original entry on oeis.org

2, 6, 14, 18, 26, 30, 50, 74, 86, 90, 98, 134, 146, 158, 174, 186, 194, 210, 230, 254, 270, 278, 306, 326, 330, 338, 350, 354, 378, 386, 398, 410, 414, 426, 438, 470, 530, 554, 558, 606, 614, 618, 638, 650, 686, 690, 726, 746, 774, 810, 818, 834, 846, 866, 870
Offset: 1

Views

Author

Peter R. J. Asveld, Aug 11 2009

Keywords

Comments

Previous name was: a(n) is the n-th A_0-prime (Archimedes_0 prime).
We have: (1) N is A_0-prime if and only if N is even, p = 2N + 1 is a prime number and both +2 and -2 generate Z_p^* (the multiplicative group of Z_p); (2) N is A_0-prime if and only if N = 2 (mod 4), p = 2N + 1 is a prime number and both +2 and -2 generate Z_p^*.

Crossrefs

The A_0-primes are the even T- or Twist-primes, these T-primes are equal to the Queneau-numbers (A054639). For the related A_1-, A^+_1- and A^-_1-primes, see A163778, A163779 and A163780. Considered as sets A163777 is the intersection of the Josephus_2-primes (A163782) and the dual Josephus_2-primes (A163781), it also equals the difference of A054639 and the A_1-primes (A163779).
Cf. A137310.

Programs

  • Mathematica
    okQ[n_] := EvenQ[n] && PrimeQ[2n+1] && MultiplicativeOrder[2, 2n+1] == 2n;
    Select[Range[1000], okQ] (* Jean-François Alcover, Sep 10 2019, from PARI *)
  • PARI
    Follow(s, f)={my(t=f(s), k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
    ok(n)={n>1 && n==Follow(1, j->ceil((n+1)/2) - (-1)^j*ceil((j-1)/2))}
    select(ok, [1..1000]) \\ Andrew Howroyd, Nov 11 2017
    
  • PARI
    ok(n)={n%2==0 && isprime(2*n+1) && znorder(Mod(2, 2*n+1)) == 2*n}
    select(ok, [1..1000]) \\ Andrew Howroyd, Nov 11 2017

Formula

a(n) = 2*A137310(n). - Andrew Howroyd, Nov 11 2017

Extensions

Definition simplified by Michel Marcus, May 27 2013
a(33)-a(55) from Andrew Howroyd, Nov 11 2017
New name from Joerg Arndt, Mar 23 2018, edited by M. F. Hasler, Mar 24 2018

A163780 Terms in A054639 equal to 3 mod 4.

Original entry on oeis.org

3, 11, 23, 35, 39, 51, 83, 95, 99, 119, 131, 135, 155, 179, 183, 191, 231, 239, 243, 251, 299, 303, 323, 359, 371, 375, 411, 419, 431, 443, 483, 491, 495, 515, 519, 531, 543, 575, 611, 615, 639, 651, 659, 683, 719, 723, 743, 755, 771, 779, 783, 791, 803, 831, 879
Offset: 1

Views

Author

Peter R. J. Asveld, Aug 12 2009

Keywords

Comments

Previous name was: a(n) is the n-th A^-_1-prime (Archimedes^-_1 prime).
N is A^-_1-prime iff N=3 (mod 4), p=2N+1 is a prime number and -2 generates Z_p^* (the multiplicative group of Z_p) but +2 does not.

Crossrefs

The A^-_1-primes are the T- or Twist-primes congruent 3 (mod 4), these T-primes are equal to the Queneau-numbers (A054639). For the related A_0-, A_1- and A^+_1-primes, see A163777, A163778 and A163779. Considered as sets the union of A163779 and A163780 equals A163778, the union of A163780 and A163777 is equal to A163781 (dual J_2-primes).

Programs

  • PARI
    ok(n) = n%4==3 && isprime(2*n+1) && znorder(Mod(2, 2*n+1)) == n;
    select(ok, [1..1000]) \\ Andrew Howroyd, Nov 11 2017

Extensions

a(33)-a(55) from Andrew Howroyd, Nov 11 2017
New name from Andrey Zabolotskiy, Mar 23 2018

A105876 Primes for which -4 is a primitive root.

Original entry on oeis.org

3, 7, 11, 19, 23, 47, 59, 67, 71, 79, 83, 103, 107, 131, 139, 163, 167, 179, 191, 199, 211, 227, 239, 263, 271, 311, 347, 359, 367, 379, 383, 419, 443, 463, 467, 479, 487, 491, 503, 523, 547, 563, 587, 599, 607, 619, 647, 659, 719, 743, 751, 787, 823, 827, 839, 859, 863
Offset: 1

Views

Author

N. J. A. Sloane, Apr 24 2005

Keywords

Comments

Also, primes for which -16 is a primitive root. For proof see following comments from Michael Somos, Aug 07 2009:
Let p = 8*t + 3 be prime. It is well-known that 2 is a primitive root.
We will use the obvious fact that if a primitive root is a power of another element, then that other element is also a primitive root. So
-1 == 2^(4*t+1) (mod p) because 2 is primitive root.
-2 == 2^(4*t+2) == 4^(2*t+1) (mod p) obvious
2 == (-4)^(2*t+1) (mod p) obvious, therefore -4 is also primitive root.
2 == 2^(8*t+3) (mod p) obviously works not just for 2
4 == 2^(8*t+4) == 16^(2*t+1) (mod p) obvious
-4 == (-16)^(2*t+1) (mod p) obvious, therefore -16 is also primitive root.
The case where p = 8*t + 7 is similar.
From Jianing Song, Dec 24 2022: (Start)
Equivalently, primes p == 3 (mod 4) such that the multiplicative order of 4 modulo p is (p-1)/2 (a subsequence of A216371).
Proof of equivalence: let ord(a,k) be the multiplicative of a modulo k. First we notice that all terms are congruent to 3 modulo 4, since -4 is a quadratic residue modulo p if p == 1 (mod 4). If ord(4,p) = (p-1)/2. Note that (p-1)/2 is odd, so it is coprime to ord(-1,p) = 2. As a result, ord(-4,p) = ((p-1)/2) * 2 = p-1. Conversely, If ord(-4,p) = p-1, we must have ord(4,p) = (p-1)/2 by noting that ord(-4,p) <= lcm(2,ord(4,p)).
Also primes p such that the multiplicative order of 16 modulo p is (p-1)/2. Proof: note that ord(16,p) = ord(-4,p)/gcd(ord(-4,p),2). If ord(-4,p) = p-1, then ord(16,p) = (p-1)/2. Conversely, if ord(16,p) = (p-1)/2, then ord(-4,p) = p-1, since otherwise ord(-4,p) = (p-1)/2 is odd, which is impossible since that -4 is not a quadratic residue modulo a prime p == 3 (mod 4).
{(a(n)-1)/2} is the sequence of indices of fixed points of A302141.
An odd prime p is a term if and only if p == 3 (mod 4) and the multiplicative order of 2 modulo p is p-1 or (p-1)/2 (p-1 if p == 3 (mod 8), (p-1)/2 if p == 7 (mod 8)).
It seems that a(n) = 2*A163778(n-1) + 1 for n >= 2. (End)

Crossrefs

Cf. A114564, A302141, A163778. A216371 is a supersequence.

Programs

  • Mathematica
    pr=-4; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &] (* OR *)
    a[p_, q_]:=Sum[2 Cos[2^n Pi/((2 q+1)(2 p+1))],{n,1,2 q p}]
    2 Select[Range[500],Rationalize[N[a[#,2],20]]==1 &]+1
    (* Gerry Martens, Apr 28 2015 *)
  • PARI
    is(n)=isprime(n) && n>2 && znorder(Mod(-4,n))==n-1 \\ Charles R Greathouse IV, Apr 30 2015

Extensions

Edited by N. J. A. Sloane, Aug 08 2009

A163779 Numbers k of the form 4*j + 1 such that 2*k + 1 is a prime with primitive root 2.

Original entry on oeis.org

1, 5, 9, 29, 33, 41, 53, 65, 69, 81, 89, 105, 113, 173, 189, 209, 221, 233, 245, 261, 273, 281, 293, 309, 329, 393, 413, 429, 441, 453, 473, 509, 545, 561, 585, 593, 629, 641, 645, 653, 713, 725, 741, 749, 761, 765, 785, 809, 833, 873, 893, 933, 953, 965, 989, 993
Offset: 1

Views

Author

Peter R. J. Asveld, Aug 12 2009

Keywords

Comments

Previous name was: a(n) is the n-th A^+_1-prime (Archimedes^+_1 prime).
N is A^+_1-prime iff N=1 (mod 4), p=2N+1 is a prime number and +2 generates Z_p^* (the multiplicative group of Z_p) but -2 does not.

Crossrefs

The A^+_1-primes are the T- or Twist-primes congruent 1 (mod 4), these T-primes are equal to the Queneau-numbers (A054639). For the related A_0-, A_1- and A^-_1-primes, see A163777, A163778 and A163780. Considered as sets the union of A163779 and A163780 equals A163778, the union of A163779 and A163777 is equal to A163782 (J_2-primes).

Programs

  • Mathematica
    okQ[n_] := Mod[n, 4] == 1 && PrimeQ[2n+1] && MultiplicativeOrder[2, 2n+1] == 2n;
    Select[Range[1000], okQ] (* Jean-François Alcover, Jun 30 2018, after Andrew Howroyd *)
  • PARI
    ok(n) = n%4==1 && isprime(2*n+1) && znorder(Mod(2, 2*n+1))==2*n;
    select(ok, [1..1000]) \\ Andrew Howroyd, Nov 11 2017

Formula

2 * a(n) + 1 = A213051(n+1). - Joerg Arndt, Mar 23 2018

Extensions

a(32)-a(55) from Andrew Howroyd, Nov 11 2017
Term 1 prepended and new name from Joerg Arndt, Mar 23 2018

A294673 Order of the "inside-out" permutation on 2n+1 letters.

Original entry on oeis.org

1, 3, 5, 4, 9, 11, 9, 5, 12, 12, 7, 23, 8, 20, 29, 6, 33, 35, 20, 39, 41, 28, 12, 36, 15, 51, 53, 36, 44, 24, 20, 7, 65, 36, 69, 60, 42, 15, 20, 52, 81, 83, 9, 60, 89, 60, 40, 95, 12, 99, 84, 66, 105, 28, 18, 37, 113, 30, 92, 119, 81, 36, 25, 8, 36, 131, 22, 135, 20, 30, 47, 60, 48, 116, 132, 100, 51, 155
Offset: 0

Views

Author

P. Michael Hutchins, Nov 06 2017

Keywords

Comments

The "inside-out" permutation (closely related to the Mongean shuffle, see A019567) sends (t_1, t_2, ..., t_{2n+1}) to (t_{n+1}, t_{n+2}, t_{n}, t_{n+3}, t_{n-1}, ..., t_1). For n = 0, 1, 2, 3, this is (1), (2,3,1), (3,4,2,5,1), (4,5,3,6,2,7,1), whose orders are respectively 1,3,5,4.
This is the odd bisection of A238371 and also the odd bisection of A003558 (see Joseph L. Wetherell's comment below).

Examples

			For n=2: Iterating the "inside-out" permutation of a string of length 2n+1=5:
12345
34251
25413
41532
53124
12345
...
which has order a(2) = 5.
		

Crossrefs

Programs

  • Magma
    f:=func;
    [f(n): n in [0..100]]; // Joseph L. Wetherell, Nov 12 2017
    
  • Magma
    [Order(Integers(4*n+3)!-2*(-1)^n): n in [0..100]]; // Joseph L. Wetherell, Nov 15 2017
  • Maple
    f:= proc(n)
      ilcm(op(map(nops,convert(map(op, [[n+1],seq([n+1+i,n+1-i],i=1..n)]),disjcyc))))
    end proc:
    map(f, [$0..100]); # Robert Israel, Nov 09 2017
  • Mathematica
    a[n_] := MultiplicativeOrder[-2(-1)^n, 4n+3];
    a /@ Range[0, 100] (* Jean-François Alcover, Apr 07 2020 *)
  • PARI
    Follow(s,f)={my(t=f(s),k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
    CyclePoly(n,x)={my(p=0); for(i=1, 2*n+1, my(l=Follow(i, j->n+1+(-1)^j*ceil((j-1)/2) )); if(l,p+=x^l)); p}
    a(n)={my(p=CyclePoly(n,x), m=1); for(i=1,poldegree(p),if(polcoeff(p,i), m=lcm(m,i))); m} \\ Andrew Howroyd, Nov 08 2017
    
  • PARI
    a(n)=znorder(Mod(if(n%2,2,-2),4*n+3)) \\ See Wetherell formula; Charles R Greathouse IV, Nov 15 2017
    

Formula

The permutation sends i (1 <= i <= 2n+1) to p(i) = n + 1 + f(i), where f(i) = (-1)^i*ceiling((i-1)/2).
a(n) = minimal k>0 such that p^k() = p^0().
a((A163778(n)-1)/2) = A163778(n). - Andrew Howroyd, Nov 11 2017.
From Joseph L. Wetherell, Nov 14 2017: (Start)
a(n) is equal to the order of multiplication-by-2 acting on the set of nonzero elements in (Z/(4n+3)Z), modulo the action of +-1. To be precise, identify i=1,2,...,2*n+1 with the odd representatives J=1,3,...,4*n+1 of this set, via the map J = 2*i-1. It is not hard to show that the induced permutation on the set of J values is given on integer representatives by J -> (4*n+3+J)/2 if i=(J+1)/2 is even and J -> (4*n+3-J)/2 if i=(J+1)/2 is odd. It follows that this induces the permutation J -> +-J/2 (mod 4*n+3), from which we immediately see that the order is as stated.
Note that the order of 2 acting on (Z/(4n+3)Z)/{+-1} is the same as the order of either 2 or -2 acting on (Z/(4n+3)Z), depending on which of these is a quadratic residue modulo 4n+3. Thus an equivalent (and often easier) way to compute a(n) is as the order of -2*(-1)^n acting on (Z/(4n+3)Z).
Among other things, the lower and upper bounds log_2(n) + 2 < a(n) <= 2*n+1 follow immediately.
(End)
It appears that the upper bound a(n) = 2n+1 occurs iff 2n+1 belongs to A163778 or equivalently iff n belongs to A294434. This almost (but not quite) follows from the above comments by Andrew Howroyd and Joseph L. Wetherell. - N. J. A. Sloane, Nov 16 2017

A238371 a(1)=1; for n > 1, a(n) = the number of "topped" Mongean shuffles to reorder a stack of n cards to its original order.

Original entry on oeis.org

1, 1, 3, 3, 5, 5, 4, 4, 9, 9, 11, 11, 9, 9, 5, 5, 12, 12, 12, 12, 7, 7, 23, 23, 8, 8, 20, 20, 29, 29, 6, 6, 33, 33, 35, 35, 20, 20, 39, 39, 41, 41, 28, 28, 12, 12, 36, 36, 15, 15, 51, 51, 53, 53, 36, 36, 44, 44, 24, 24, 20, 20, 7, 7, 65, 65, 36, 36, 69, 69, 60, 60, 42, 42, 15, 15, 20, 20, 52, 52, 81, 81, 83, 83, 9, 9, 60, 60
Offset: 1

Views

Author

R. J. Mathar, Feb 25 2014

Keywords

Comments

In the Mongean shuffle, the top card of the stack becomes the top of the new stack, the second of the old stack goes on top of the new stack, the third to the bottom of the new stack, alternating top and bottom of the new stack.
Here we define a shuffle where the top-bottom placements in the new stack alternate in the same way, but the second card of the old stack moves to the *bottom* of the stack.
A single shuffle is a permutation of 1, 2, 3, 4, 5, 6, ... -> ..., 7, 5, 3, 1, 2, 4, 6, ...
The fixed points, where n=a(n), seem to be in A163778.
(The "topped" classification is a nomenclature invented here, to be replaced if this variant appears elsewhere in the literature.)

Crossrefs

Cf. A019567 (Mongean shuffle), A294673 (a bisection).

Programs

  • Maple
    topMong := proc(L)
        ret := [op(1,L)] ;
        for k from 2 to nops(L) do
            if type(k,'even') then
                ret := [op(ret),op(k,L)] ;
            else
                ret := [op(k,L),op(ret)] ;
            end if;
        end do:
        ret ;
    end proc:
    A238371 := proc(n)
        local ca,org,tu ;
        ca := [seq(k,k=1..n)] ;
        org := [seq(k,k=1..n)] ;
        for tu from 1 do
            ca := topMong(ca) ;
            if ca = org then
                return tu;
            end if:
        end do:
    end proc:
    seq(A238371(n),n=2..88) ;
  • Mathematica
    topMong[L_] := Module[{ret = {L[[1]]}}, For[k = 2, k <= Length[L], k++, If[ EvenQ[k], ret = Append[ret, L[[k]]], ret = Prepend[ret, L[[k]]]]]; ret];
    A238371[n_] := Module[{ca, org, tu}, ca = org = Range[n]; For[tu = 1, True, tu++, ca = topMong[ca]; If[ca == org, Return[tu]]]];
    Array[A238371, 88] (* Jean-François Alcover, Jul 03 2018, after R. J. Mathar *)
  • PARI
    apply( A238371(n)=znorder(Mod(bitand(n,2)*2-2,n\2*4+3)), [0..99]) \\ M. F. Hasler, Mar 31 2019

Formula

a(A163778(n)) = A163778(n). - Andrew Howroyd, Nov 11 2017

A302141 Multiplicative order of 16 mod 2n+1.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 3, 1, 2, 9, 3, 11, 5, 9, 7, 5, 5, 3, 9, 3, 5, 7, 3, 23, 21, 2, 13, 5, 9, 29, 15, 3, 3, 33, 11, 35, 9, 5, 15, 39, 27, 41, 2, 7, 11, 3, 5, 9, 12, 15, 25, 51, 3, 53, 9, 9, 7, 11, 3, 6, 55, 5, 25, 7, 7, 65, 9, 9, 17, 69, 23, 15, 7, 21, 37, 15, 6, 5, 13, 13, 33, 81, 5, 83, 39, 9, 43, 15, 29, 89, 45, 15, 9, 10, 9, 95, 24, 3, 49, 99, 33
Offset: 0

Views

Author

Jianing Song, Apr 02 2018

Keywords

Comments

Reptend length of 1/(2n+1) in hexadecimal.
a(n) <= n; it appears that equality holds if and only if n=1 or is in A163778. - Robert Israel, Apr 02 2018
From Jianing Song, Dec 24 2022: (Start)
a(n) <= psi(2*n+1)/2 <= n. a(n) = psi(2*n+1)/2 if and only if the multiplicative order of 2 modulo 2*n+1 is psi(2*n+1) or psi(2*n+1)/2, and psi(2*n+1) == 2 (mod 4).
a(n) = n if and only if A053447(n) = n and A053447(n) is odd. As a result, a(n) = n if and only if 2*n+1 = p is a prime congruent to 3 modulo 4, and the multiplicative order of 2 modulo p is p-1 or (p-1)/2 (p-1 if p == 3 (mod 8), (p-1)/2 if p == 7 (mod 8)). Such primes p are listed in A105876. (End)

Examples

			The fraction 1/13 is equal to 0.13B13B... in hexadecimal, so a(6) = 3.
		

Crossrefs

Programs

  • GAP
    List([0..100],n->OrderMod(16,2*n+1)); # Muniru A Asiru, Feb 25 2019
  • Magma
    [1] cat [ Modorder(16, 2*n+1): n in [1..100]]; // Vincenzo Librandi, Apr 03 2018
    
  • Maple
    seq(numtheory:-order(16, 2*n+1), n=0..100); # Robert Israel, Apr 02 2018
  • Mathematica
    Table[MultiplicativeOrder[16, 2 n + 1], {n, 0, 150}] (* Vincenzo Librandi, Apr 03 2018 *)
  • PARI
    a(n) = znorder(Mod(16, 2*n+1)) \\ Felix Fröhlich, Apr 02 2018
    

Formula

a(n) = A002326(n)/gcd(A002326(n),4) = A053447(n)/gcd(A053447(n),2). [Corrected by Jianing Song, Dec 24 2022]
Showing 1-9 of 9 results.