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.

A352217 Smallest power of 2 that is one more than a multiple of 2n-1.

This page as a plain text file.
%I A352217 #28 Mar 27 2022 17:30:40
%S A352217 2,4,16,8,64,1024,4096,16,256,262144,64,2048,1048576,262144,268435456,
%T A352217 32,1024,4096,68719476736,4096,1048576,16384,4096,8388608,2097152,256,
%U A352217 4503599627370496,1048576,262144,288230376151711744,1152921504606846976,64,4096
%N A352217 Smallest power of 2 that is one more than a multiple of 2n-1.
%C A352217 Every odd number is a divisor of a number of the form 2^n-1.
%H A352217 Michael S. Branicky, <a href="/A352217/b352217.txt">Table of n, a(n) for n = 1..1661</a>
%F A352217 From _Alois P. Heinz_, Mar 07 2022: (Start)
%F A352217 a(n) = 2^A002326(n-1).
%F A352217 a(n) = 1 + A165781(n-1)*(2*n-1). (End)
%e A352217 a(5)=64 because 63 is the smallest number of the form 2^n-1 that's a multiple of 9.
%p A352217 a:= n-> 2^`if`(n=1, 1, numtheory[order](2, 2*n-1)):
%p A352217 seq(a(n), n=1..50);  # _Alois P. Heinz_, Mar 07 2022
%t A352217 Table[2^MultiplicativeOrder[2, 2*n - 1], {n, 1, 33}] (* _Amiram Eldar_, Mar 08 2022 *)
%o A352217 (Python)
%o A352217 def a(n):
%o A352217     if n == 1: return 2
%o A352217     p, m = 2, 2*n-1
%o A352217     while p <= m or p % m != 1: p *= 2
%o A352217     return p
%o A352217 print([a(n) for n in range(1, 34)]) # _Michael S. Branicky_, Mar 07 2022
%o A352217 (Python)
%o A352217 from sympy import n_order
%o A352217 def a(n): return 2**n_order(2, 2*n-1)
%o A352217 print([a(n) for n in range(1, 34)]) # _Michael S. Branicky_, Mar 07 2022 after _Alois P. Heinz_
%o A352217 (PARI) a(n) = 1 << znorder(Mod(2,2*n-1)); \\ _Kevin Ryde_, Mar 07 2022
%Y A352217 Cf. A002326, A005408, A165781.
%K A352217 nonn,easy
%O A352217 1,1
%A A352217 _J. Lowell_, Mar 07 2022
%E A352217 a(14) and beyond from _Michael S. Branicky_, Mar 07 2022