login
A385703
Numbers such that when the leftmost digit is moved to the unit's place the result is divisible by 8.
4
0, 8, 23, 27, 42, 46, 61, 65, 69, 80, 84, 88, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255, 259, 263, 267, 271, 275, 279, 283, 287, 291, 295, 299, 402, 406, 410, 414, 418, 422, 426, 430, 434, 438, 442, 446, 450, 454, 458, 462, 466, 470, 474
OFFSET
1,2
LINKS
EXAMPLE
458 is a term since 584 = 73*8 is divisible by 8.
MATHEMATICA
Select[Range[0, 475], Divisible[FromDigits[RotateLeft[IntegerDigits[#]]], 8] &]
PROG
(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) % 8 == 0; \\ Michel Marcus, Jul 08 2025
(Python)
def ok(n): return int((s:=str(n))[1:]+s[0])%8 == 0
print([k for k in range(500) if ok(k)]) # Michael S. Branicky, Jul 08 2025
CROSSREFS
Similar sequences for k=1..9: A001477, A273892, A008585, A385700, A217398, A385701, A385702, this sequence, A008591.
Sequence in context: A029755 A022420 A326741 * A034811 A283848 A341770
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Jul 07 2025
STATUS
approved