login
a(n) is the smallest integer k (k>=2) such that 13...3 (1 followed by n 3's) mod k is even.
0

%I #18 Jul 31 2020 11:49:10

%S 7,7,11,9,7,17,7,7,11,9,7,17,7,7,11,9,7,17,7,7,11,9,7,17,7,7,11,9,7,

%T 17,7,7,11,9,7,23,7,7,11,9,7,17,7,7,11,9,7,23,7,7,11,9,7,17,7,7,11,9,

%U 7,17,7,7,11,9,7,17,7,7,11,9,7,17,7,7,11,9,7,17,7,7

%N a(n) is the smallest integer k (k>=2) such that 13...3 (1 followed by n 3's) mod k is even.

%C More sequences can be generated by replacing the digit 1 by any integers of the form 3x+1. However, the sequence won't be as interesting if the following digits (the 3's) are replaced by any other digits.

%F I have proved the following properties:

%F For n=12x+1, a(n)=7.

%F For n=12x+2, a(n)=7.

%F For n=12x+3, a(n)=11.

%F For n=12x+4, a(n)=9.

%F For n=12x+5, a(n)=7.

%F For n=12x+6, a(n)=17.

%F For n=12x+7, a(n)=7.

%F For n=12x+8, a(n)=7.

%F For n=12x+9, a(n)=11.

%F For n=12x+10, a(n)=9.

%F For n=12x+11, a(n)=7.

%F For n=12x, a(n) can be 17, 19, 23 or 25.

%e a(5)=7 because

%e 133333 mod 2 = 1

%e 133333 mod 3 = 1

%e 133333 mod 4 = 1

%e 133333 mod 5 = 3

%e 133333 mod 6 = 1

%e 133333 mod 7 = 4, which is the first time the result is even.

%o (Python)

%o n=1

%o a=13

%o while n<=1000:

%o c=2

%o while True:

%o if (a%c)%2==1:

%o c=c+1

%o else:

%o print(c,end=", ")

%o break

%o n=n+1

%o a=10*a+3

%o (PARI) f(n) = (4*10^n-1)/3; \\ A097166

%o a(n) = my(k=2); while ((f(n) % k) % 2, k++); k; \\ _Michel Marcus_, Jul 05 2020

%Y Cf. A097166.

%K easy,nonn,base

%O 1,1

%A _Yuan-Hao Huang_, Jul 05 2020