A385700 Numbers such that when the leftmost digit is moved to the unit's place the result is divisible by 4.
0, 4, 8, 21, 23, 25, 27, 29, 40, 42, 44, 46, 48, 61, 63, 65, 67, 69, 80, 82, 84, 86, 88, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269
Offset: 1
Examples
263 is a term since 632 = 158*4 is divisible by 4.
Links
- Stefano Spezia, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
Select[Range[0,270],Divisible[FromDigits[RotateLeft[IntegerDigits[#]]],4] &]
-
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) % 4 == 0; \\ Michel Marcus, Jul 08 2025
-
Python
def ok(n): return int((s:=str(n))[1:]+s[0])%4 == 0 print([k for k in range(270) if ok(k)]) # Michael S. Branicky, Jul 08 2025