login
A130909
Period 16: repeat [0, 1, 2, ..., 15]; a(n) = n mod 16.
7
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
OFFSET
0,3
COMMENTS
The value of the rightmost digit in the base-16 representation of n. Also, the equivalent value of the two rightmost digits in the base-4 representation of n. Also, the equivalent value of the four rightmost digits in the base-2 representation of n.
FORMULA
a(n) = n mod 16 = n - 16*floor(n/16).
G.f.: g(x) = (Sum_{k=1..15} k*x^k)/(1-x^16).
G.f.: g(x) = x*(15x^16-16x^15+1)/((1-x^16)*(1-x)^2).
a(n) = A000035(n) + 2*A010877(A004526(n)).
a(n) = A010873(n) + 4*A010873(A002265(n)).
a(n) = A010877(n) + 8*A000035(floor(n/8)).
MATHEMATICA
Mod[Range[0, 127], 16] (* Paolo Xausa, May 22 2026 *)
PROG
(PARI) a(n)=n%16 \\ Charles R Greathouse IV, Jul 13 2016
(Python)
def A130909(n): return n&15 # Chai Wah Wu, Jan 18 2023
CROSSREFS
Cf. partial sums A130910. Other related sequences A010872, A010873, A130481, A130482, A130483, A130486.
See A010877 for a general formula in terms of powers of -1 (for period 2^k).
Sequence in context: A295300 A139179 A262437 * A275993 A160700 A002377
KEYWORD
nonn,easy
AUTHOR
Hieronymus Fischer, Jun 11 2007
STATUS
approved