A385701 Numbers such that when the leftmost digit is moved to the unit's place the result is divisible by 6.
0, 6, 21, 24, 27, 42, 45, 48, 60, 63, 66, 69, 81, 84, 87, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240, 243, 246, 249, 252, 255, 258, 261, 264, 267, 270, 273, 276, 279, 282, 285, 288, 291, 294, 297, 402, 405, 408, 411, 414, 417, 420, 423, 426, 429
Offset: 1
Examples
426 is a term since 264 = 44*6 is divisible by 6.
Links
- Stefano Spezia, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
Select[Range[0,430],Divisible[FromDigits[RotateLeft[IntegerDigits[#]]],6] &]
-
PARI
isok(k) = if (k==0, return(1)); my(d=digits(k), v = vector(#d-1, i, d[i+1])); v = concat(v, d[1]); fromdigits(v) % 6 == 0; \\ Michel Marcus, Jul 08 2025
-
Python
def ok(n): return int((s:=str(n))[1:]+s[0])%6 == 0 print([k for k in range(430) if ok(k)]) # Michael S. Branicky, Jul 08 2025