login

Revision History for A216479

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(n) is the least multiple of n which uses only the digit 1, or a(n) = -1 if no such multiple exists.
(history; published version)
#23 by N. J. A. Sloane at Sat Dec 12 05:19:35 EST 2020
STATUS

proposed

approved

#22 by Michael De Vlieger at Fri Dec 11 23:08:18 EST 2020
STATUS

editing

proposed

#21 by Michael De Vlieger at Fri Dec 11 23:08:15 EST 2020
MATHEMATICA

Array[IfWhich[GCD[#, 10] =!= 1, -1, Mod[#, 3] == 0, Block[{k = 1}, While[Mod[k, #] != 0, k = 10 k + 1]; k], True, (10^MultiplicativeOrder[10, #] - 1)/9] &, 42] (* Michael De Vlieger, Dec 11 2020 *)

#20 by Michael De Vlieger at Fri Dec 11 22:44:23 EST 2020
MATHEMATICA

Array[If[GCD[#, 10] == 1, Block[{k = 1}, While[Mod[k, #] != 0, k = 10 k + 1]; k], -1] &, 42] (* Michael De Vlieger, Dec 11 2020 *)

STATUS

proposed

editing

#19 by Kevin Ryde at Sun Nov 29 00:25:21 EST 2020
STATUS

editing

proposed

Discussion
Mon Nov 30
00:51
Azanul Haque: Python does not have a multiplicative order function. So, the most straight forward code is this one.
#18 by Kevin Ryde at Sun Nov 29 00:23:35 EST 2020
CROSSREFS

Cf. A084681 (number of 1's), A190301 (multiplier).

Discussion
Sun Nov 29
00:25
Kevin Ryde: There's some multiplicative order stuff set out in A190301 going straight to the repunit length, which is A084681, if that may suit code.
#17 by Kevin Ryde at Sun Nov 29 00:18:05 EST 2020
CROSSREFS

Cf. A190301 (multiplier).

STATUS

proposed

editing

#16 by Azanul Haque at Sat Nov 28 23:41:01 EST 2020
STATUS

editing

proposed

#15 by Azanul Haque at Sat Nov 28 23:38:53 EST 2020
PROG

rem = (rem*10 + 1) % n

Discussion
Sat Nov 28
23:40
Azanul Haque: Changed the line "rem = (rem*10 + 1) % n" to "rem = rem*10 + 1"
#14 by Michel Marcus at Sat Nov 28 11:13:26 EST 2020
STATUS

proposed

editing

Discussion
Sat Nov 28
12:40
Michael S. Branicky: in the program, if you change the while block from "rem = (rem*10 + 1) % n" to "rem = (rem*10 + 1)" then it is correct.
12:48
Michael S. Branicky: Length of data is 311 characters