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.

A072982 Primes p for which the period of 1/p is a power of 2.

This page as a plain text file.
%I A072982 #90 Nov 20 2024 09:47:21
%S A072982 3,11,17,73,101,137,257,353,449,641,1409,10753,15361,19841,65537,
%T A072982 69857,453377,976193,1514497,5767169,5882353,6187457,8253953,8257537,
%U A072982 70254593,167772161,175636481,302078977,458924033,639631361,1265011073
%N A072982 Primes p for which the period of 1/p is a power of 2.
%C A072982 All Fermat primes > 5 (A019434) are in the sequence, since it can be shown that the period of 1/(2^(2^n)+1) is 2^(2^n) whenever 2^(2^n)+1 is prime. - _Benoit Cloitre_, Jun 13 2007
%C A072982 Take all the terms from row 2^k of triangle in A046107 for k >= 0 and sort to arrive at this sequence. - _Ray Chandler_, Nov 04 2011
%C A072982 Additional terms, but not necessarily the next in sequence: 13462517317633 has period 1048576 = 2^20; 46179488366593 has period 2199023255552 = 2^41; 101702694862849 has period 8388608 = 2^23; 171523813933057 has period 4398046511104 = 2^42; 505775348776961 has period 2199023255552 = 2^41; 834427406578561 has period 64 = 2^6 - _Ray Chandler_, Nov 09 2011
%C A072982 Furthermore (excluding the initial term 3) this sequence is also the ascending sequence of primes dividing 10^(2^k)+1 for some nonnegative integer k. For a prime dividing 10^(2^k)+1, the period of 1/p is 2^(k+1). Thus for the prime p = 558711876337536212257947750090161313464308422534640474631571587847325442162307811\
%C A072982 65223702155223678309562822667655169, a factor of 10^(2^7)+1, the period of 1/p is only 2^8. This large prime then also belongs to the sequence. - _Christopher J. Smyth_, Mar 13 2014
%C A072982 For any m, every term that is not a factor of 10^(2^k)-1 for some k < m is congruent to 1 (mod 2^m). Thus all terms except 3, 11, 17, 73, 101, 137, 353, 449, 69857, 976193, 5882353, 6187457 are congruent to 1 (mod 128). - _Robert Israel_, Jun 17 2016
%C A072982 Additional terms listed earlier confirmed as next terms in sequence. - _Arkadiusz Wesolowski_, Jun 17 2016
%H A072982 Arkadiusz Wesolowski, <a href="/A072982/b072982.txt">Table of n, a(n) for n = 1..45</a> (first 33 terms from Ray Chandler, to 36 terms from Robert G. Wilson v, to 39 terms from Ray Chandler)
%H A072982 Ray Chandler, <a href="/A072982/a072982_1.txt">Known Terms of A072982</a>
%H A072982 Wilfrid Keller, <a href="http://www.prothsearch.com/GFN10.html">Prime factors of generalized Fermat numbers Fm(10) and complete factoring status</a>
%H A072982 <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>
%e A072982 15361 has a period of 256 = 2^8, hence 15361 is in the sequence.
%p A072982 filter:= proc(p) local k;
%p A072982   if not isprime(p) then return false fi;
%p A072982   k:=igcd(p-1,2^ilog2(p));
%p A072982   evalb(10 &^ k mod p = 1)
%p A072982 end proc:
%p A072982 r:= select(`<=`,`union`(seq(numtheory:-factorset(10^(2^k)-1),k=1..6)),10^9):
%p A072982 b:= select(filter, {seq(i,i=129..10^9,128)}):
%p A072982 sort(convert(r union b, list)); # _Robert Israel_, Jun 17 2016
%t A072982 Do[ If[ IntegerQ[ Log[2, Length[ RealDigits[ 1/Prime[n]] [[1, 1]]]]], Print[ Prime[n]]], {n, 1, 47500}] (* _Robert G. Wilson v_, May 09 2007 *)
%t A072982 pmax = 10^10; p = 1; While[p < pmax,p = NextPrime[p];If[ IntegerQ[Log[2, MultiplicativeOrder[10, p] ] ], Print[ p];];]; (* _Ray Chandler_, May 14 2007 *)
%o A072982 (PARI) select( {is_A072982(p)=if(p>5, 1<<exponent(p=znorder(Mod(10, p))),3)==p}, primes(10^5)) \\ is_A...(p) assumes p is prime. - _M. F. Hasler_, Nov 18 2024
%o A072982 (Python)
%o A072982 from itertools import count, islice
%o A072982 from sympy import prime, n_order
%o A072982 def A072982_gen(): return (p for p in (prime(n) for n in count(2)) if p != 5 and bin(n_order(10,p))[2:].rstrip('0') == '1')
%o A072982 A072982_list = list(islice(A072982_gen(),10)) # _Chai Wah Wu_, Feb 07 2022
%o A072982 (Python)
%o A072982 from sympy import primerange, n_order
%o A072982 A072982_upto = lambda N=1e5: [p for p in primerange(3, N) if p != 5 and n_order(10, p).bit_count() == 1] # or (...) to get a generator. - _M. F. Hasler_, Nov 19 2024
%Y A072982 Cf. A002371, A007138, A046107, A054471.
%Y A072982 Cf. A197224 (power of 2 which is the period of the decimal 1/a(n)).
%K A072982 nonn,base
%O A072982 1,1
%A A072982 _Benoit Cloitre_, Jul 26 2002
%E A072982 Edited by _Robert G. Wilson v_, Aug 20 2002
%E A072982 a(18) from _Ray Chandler_, May 02 2007
%E A072982 a(19) from _Robert G. Wilson v_, May 09 2007
%E A072982 a(20)-a(32) from _Ray Chandler_, May 14 2007
%E A072982 Deleted an unsatisfactory PARI program. - _N. J. A. Sloane_, Nov 19 2024