login
Positive integers k such that the decimal representation of 2^k ends with some permutation of the string "0123456789".
2

%I #94 Oct 11 2021 18:30:22

%S 7386,11061,15176,16054,19950,24493,26749,29160,33902,42207,43013,

%T 44233,45627,52235,54727,56186,59228,59229,59230,60883,62823,63468,

%U 65404,69960,71225,71804,75176,78392,89416,96576,96682,97723,98085,98561,102735,104125,105301,105760

%N Positive integers k such that the decimal representation of 2^k ends with some permutation of the string "0123456789".

%C If k is a term of the sequence then some nonzero digit must occur more than once in the decimal representation of 2^k because 1+2+3+4+5+6+7+8+9=45, and 2^k is not divisible by 9. Thus 2^k>10^10 and therefore k>33 for any term k.

%C A positive integer k is a term of the sequence iff a decimal representation of the remainder of 2^k modulo 10^10 (possibly containing a leading zero) is a permutation of the string "0123456789".

%C Let d = 7812500 = 4*5^9 = phi(5^10) where phi is Euler's totient function. The remainders of the powers of 2 modulo 10^10 form an eventually periodic sequence with period d: if k >= 10 then 2^(k+d) - 2^k is divisible by 10^10 since 2^(k+d) - 2^k = 2^k*(2^d-1) and 10^10 = 2^10*5^10. Hence if k >= 10 then k + d is a term iff k is a term.

%C Actually the above equivalence holds for all positive integers k because neither k nor k + d is a term of the sequence for k < 10 (the decimal representations of the numbers 2^(k + d) with k = 1, 2, ..., 9 end, respectively, with the following strings: 3574218752, 7148437504, 4296875008, 8593750016, 7187500032, 4375000064, 8750000128, 7500000256, 5000000512).

%C There are 2795 terms not exceeding d. The last of them is 7808304, with decimal representation of the corresponding power of 2 ending with 9745238016.

%H Dimiter Skordev, <a href="/A347164/b347164.txt">Table of n, a(n) for n = 1..6000</a>

%F a(n+c) = a(n) + d with c=2795 and d as above.

%e 7386, 11061 and 15176 are in the sequence because the decimal representations of the corresponding powers of 2 end with 9815307264, 4706813952 and 0294875136, respectively.

%p q:= n-> (l-> is({l[], `if`(nops(l)<10, 0, [][])}=

%p {$0..9}))(convert(2&^n mod 10^10, base, 10)):

%p select(q, [$1..120000])[]; # _Alois P. Heinz_, Aug 23 2021

%t Select[Range[10^5],Union[If[Length[s=IntegerDigits@PowerMod[2,#,10^10]]==9,Join[{0},s],s]]==0~Range~9&] (* _Giorgos Kalogeropoulos_, Sep 03 2021 *)

%o (Python)

%o k,r,n=1,2,1

%o while n<=6000:

%o s,t=set(),r

%o for i in range(10):

%o s.add(t%10)

%o t=t//10

%o if len(s)==10:

%o print(n,k)

%o n=n+1

%o k,r=k+1,2*r%10**10

%o (PARI) isok(k) = my(d=digits(lift(Mod(2, 10^10)^k))); if (#d<10, d = concat(d, 0)); #Set(d) == 10; \\ _Michel Marcus_, Oct 01 2021

%Y Cf. A090493, A291926. Subsequence of A130694.

%K nonn,base

%O 1,1

%A _Dimiter Skordev_, Aug 20 2021