%I #83 Nov 19 2024 00:57:46
%S 3,11,17,73,101,137,257,353,449,641,1409,10753,15361,19841,65537,
%T 69857,453377,976193,1514497,5767169,5882353,6187457,8253953,8257537,
%U 70254593,167772161,175636481,302078977,458924033,639631361,1265011073
%N Primes p for which the period of 1/p is a power of 2.
%C 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 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 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 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 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 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 Additional terms listed earlier confirmed as next terms in sequence. - _Arkadiusz Wesolowski_, Jun 17 2016
%H 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 Ray Chandler, <a href="/A072982/a072982_1.txt">Known Terms of A072982</a>
%H Wilfrid Keller, <a href="http://www.prothsearch.com/GFN10.html">Prime factors of generalized Fermat numbers Fm(10) and complete factoring status</a>
%H <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>
%e 15361 has a period of 256 = 2^8, hence 15361 is in the sequence.
%p filter:= proc(p) local k;
%p if not isprime(p) then return false fi;
%p k:=igcd(p-1,2^ilog2(p));
%p evalb(10 &^ k mod p = 1)
%p end proc:
%p r:= select(`<=`,`union`(seq(numtheory:-factorset(10^(2^k)-1),k=1..6)),10^9):
%p b:= select(filter, {seq(i,i=129..10^9,128)}):
%p sort(convert(r union b, list)); # _Robert Israel_, Jun 17 2016
%t 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 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 (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 (Python)
%o from itertools import count
%o from sympy import prime, n_order
%o 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_list = list(islice(A072982_gen(),10)) # _Chai Wah Wu_, Feb 07 2022
%Y Cf. A002371, A007138, A046107, A054471.
%Y Cf. A197224 (power of 2 which is the period of the decimal 1/a(n)).
%K nonn,base,changed
%O 1,1
%A _Benoit Cloitre_, Jul 26 2002
%E Edited by _Robert G. Wilson v_, Aug 20 2002
%E a(18) from _Ray Chandler_, May 02 2007
%E a(19) from _Robert G. Wilson v_, May 09 2007
%E a(20)-a(32) from _Ray Chandler_, May 14 2007
%E Deleted an unsatisfactory PARI program. - _N. J. A. Sloane_, Nov 19 2024