The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A335012 Number of different remainders when the first n terms of 1, 11, 111, 1111, ... are divided by n. 0

%I #29 Jun 28 2020 18:49:12

%S 1,1,3,2,1,3,6,3,9,1,2,4,6,6,3,4,16,9,18,2,6,2,22,5,2,6,27,7,28,3,15,

%T 5,6,16,6,10,3,18,6,3,5,6,21,3,9,22,46,6,42,2,48,7,13,27,2,8,18,28,58,

%U 4,60,15,18,6,6,6,33,17,66,6,35,11,8,3,4,19,6,6,13,4,81

%N Number of different remainders when the first n terms of 1, 11, 111, 1111, ... are divided by n.

%C a(n) = n if and only if n is a power of 3.

%C Conjecture: a(n) = n-1 if and only if n is a long period prime (A006883), that is, n is a prime and the decimal expansion of 1/n has period n-1.

%C If gcd(n,30) = 1 then a(n) = A084680(n). - _Robert Israel_, Jun 25 2020

%e a(4) = 2 since when 1, 11, 111, 1111 are divided by 4 the remainders are 1, 3, 3, 3, two different numbers.

%e a(6) = 3 since when 1, 11, 111, 1111, 11111, 111111 are divided by 6 the remainders are 1, 5, 3, 1, 5, 3, three different numbers.

%p with(ListTools): a := proc (n) return add(10^i, i = 0 .. n-1) end proc: r := proc (n) return seq(`mod`(a(i), n), i = 1 .. n) end proc: seq(nops(MakeUnique([r(n)])), n = 1 .. 243);

%p # Simpler:

%p f:= n -> nops({seq(((10^i-1)/9) mod n,i=1..n)}):

%p map(f, [$1..100]); # _Robert Israel_, Jun 25 2020

%t Table[Length@ Union@ Array[Mod[(10^# - 1)/9, n] &, n], {n, 81}] (* _Michael De Vlieger_, Jun 28 2020 *)

%o (PARI) a(n) = #Set(vector(n, k, (10^k-1)/9) % n); \\ _Michel Marcus_, Jun 15 2020

%Y Cf. A000042, A006883, A084680.

%K nonn,base,look

%O 1,3

%A _Sen-Peng Eu_, May 19 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 1 22:07 EDT 2024. Contains 373032 sequences. (Running on oeis4.)