A373100 Last digit of n*2^n - 1.
1, 7, 3, 3, 9, 3, 5, 7, 7, 9, 7, 1, 5, 5, 9, 5, 3, 1, 1, 9, 1, 7, 3, 3, 9, 3, 5, 7, 7, 9, 7, 1, 5, 5, 9, 5, 3, 1, 1, 9, 1, 7, 3, 3, 9, 3, 5, 7, 7, 9, 7, 1, 5, 5, 9, 5, 3, 1, 1, 9, 1, 7
Offset: 1
References
- Richard K. Guy (2004), Unsolved Problems in Number Theory (3rd ed.), New York: Springer Verlag, pp. section B20, ISBN 0-387-20860-7.
Links
- Wikipedia, Woodall number.
- Index entries for linear recurrences with constant coefficients, signature (0,1,0,-1,1,1,-1,-1,1,0,-1,0,1).
Programs
-
Maple
lastDigit := proc(n) return (n * 2^n - 1) mod 10; end proc: # Example usage minN := 1; maxN := 10; lastDigits := [seq(lastDigit(n), n = minN .. maxN)]; print(lastDigits);
-
Mathematica
lastDigit[n_] := Mod[n * 2^n - 1, 10] (* Example usage *) minN = 1; maxN = 10; lastDigits = Table[lastDigit[n], {n, minN, maxN}] Print[lastDigits]
-
PARI
a(n) = lift(Mod(n*2^n - 1, 10))
-
Python
def last_digit(n): return (n * 2**n - 1) % 10 # Example usage min_n, max_n = 1, 10 last_digits = [last_digit(n) for n in range(min_n, max_n + 1)] print(last_digits)
Formula
From Chai Wah Wu, Jul 06 2024: (Start)
a(n) = a(n-2) - a(n-4) + a(n-5) + a(n-6) - a(n-7) - a(n-8) + a(n-9) - a(n-11) + a(n-13) for n > 13.
G.f.: x*(-9*x^12 - x^11 + 8*x^10 - 2*x^9 - 13*x^8 + 2*x^7 + 9*x^6 - 6*x^5 - 7*x^4 + 4*x^3 - 2*x^2 - 7*x - 1)/((x - 1)*(x^4 + x^3 + x^2 + x + 1)*(x^8 - x^6 + x^4 - x^2 + 1)). (End)
Comments