This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A373100 #17 Jul 06 2024 23:47:36 %S A373100 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, %T A373100 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 %N A373100 Last digit of n*2^n - 1. %C A373100 This is a cyclic sequence of 20 numbers, using only 1,3,5,7 and 9 (4 times each). %D A373100 Richard K. Guy (2004), Unsolved Problems in Number Theory (3rd ed.), New York: Springer Verlag, pp. section B20, ISBN 0-387-20860-7. %H A373100 Wikipedia, <a href="https://en.wikipedia.org/wiki/Woodall_number">Woodall number</a>. %H A373100 <a href="/index/Rec#order_13">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,-1,1,1,-1,-1,1,0,-1,0,1). %F A373100 a(n) = A010879(A003261(n)). %F A373100 From _Chai Wah Wu_, Jul 06 2024: (Start) %F A373100 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. %F A373100 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) %p A373100 lastDigit := proc(n) %p A373100 return (n * 2^n - 1) mod 10; %p A373100 end proc: %p A373100 # Example usage %p A373100 minN := 1; maxN := 10; %p A373100 lastDigits := [seq(lastDigit(n), n = minN .. maxN)]; %p A373100 print(lastDigits); %t A373100 lastDigit[n_] := Mod[n * 2^n - 1, 10] %t A373100 (* Example usage *) %t A373100 minN = 1; maxN = 10; %t A373100 lastDigits = Table[lastDigit[n], {n, minN, maxN}] %t A373100 Print[lastDigits] %o A373100 (Python) %o A373100 def last_digit(n): %o A373100 return (n * 2**n - 1) % 10 %o A373100 # Example usage %o A373100 min_n, max_n = 1, 10 %o A373100 last_digits = [last_digit(n) for n in range(min_n, max_n + 1)] %o A373100 print(last_digits) %o A373100 (PARI) a(n) = lift(Mod(n*2^n - 1, 10)) %Y A373100 Cf. A010879, A003261. %Y A373100 Cf. A373098, A373099. %K A373100 nonn,base,easy %O A373100 1,2 %A A373100 _Javier Rodríguez Ríos_, May 23 2024