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.

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

This page as a plain text file.
%I A335012 #29 Jun 28 2020 18:49:12
%S A335012 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 A335012 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 A335012 4,60,15,18,6,6,6,33,17,66,6,35,11,8,3,4,19,6,6,13,4,81
%N A335012 Number of different remainders when the first n terms of 1, 11, 111, 1111, ... are divided by n.
%C A335012 a(n) = n if and only if n is a power of 3.
%C A335012 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 A335012 If gcd(n,30) = 1 then a(n) = A084680(n). - _Robert Israel_, Jun 25 2020
%e A335012 a(4) = 2 since when 1, 11, 111, 1111 are divided by 4 the remainders are 1, 3, 3, 3, two different numbers.
%e A335012 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 A335012 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 A335012 # Simpler:
%p A335012 f:= n -> nops({seq(((10^i-1)/9) mod n,i=1..n)}):
%p A335012 map(f, [$1..100]); # _Robert Israel_, Jun 25 2020
%t A335012 Table[Length@ Union@ Array[Mod[(10^# - 1)/9, n] &, n], {n, 81}] (* _Michael De Vlieger_, Jun 28 2020 *)
%o A335012 (PARI) a(n) = #Set(vector(n, k, (10^k-1)/9) % n); \\ _Michel Marcus_, Jun 15 2020
%Y A335012 Cf. A000042, A006883, A084680.
%K A335012 nonn,base,look
%O A335012 1,3
%A A335012 _Sen-Peng Eu_, May 19 2020