cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

A116081 Final nonzero digit of n^n.

Original entry on oeis.org

1, 4, 7, 6, 5, 6, 3, 6, 9, 1, 1, 6, 3, 6, 5, 6, 7, 4, 9, 6, 1, 4, 7, 6, 5, 6, 3, 6, 9, 9, 1, 6, 3, 6, 5, 6, 7, 4, 9, 6, 1, 4, 7, 6, 5, 6, 3, 6, 9, 5, 1, 6, 3, 6, 5, 6, 7, 4, 9, 6, 1, 4, 7, 6, 5, 6, 3, 6, 9, 9, 1, 6, 3, 6, 5, 6, 7, 4, 9, 6, 1, 4, 7, 6, 5, 6, 3, 6, 9, 1, 1, 6, 3, 6, 5, 6, 7, 4, 9, 1, 1, 4, 7, 6, 5
Offset: 1

Views

Author

Greg Dresden, Mar 12 2006

Keywords

Comments

The decimal number .147656369116... formed from these digits is a transcendental number; see Dresden's second article. These digits are never eventually periodic.
Digits appear with predictable frequencies: 1/10 for 3, 4, and 7; 1/9 for 5; 3/25 for 9; 28/225 for 1; and 307/900 for 6. - Charles R Greathouse IV, Oct 03 2022

Examples

			a(4) = 6 because 4^4 (which is 256) ends in 6.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d, m, p; d:= min(padic:-ordp(n,2), padic:-ordp(n,5));
       m:= n/10^d;
       p:= n - 1 mod 4 + 1;
       m &^ p mod 10;
    end proc:
    seq(f(n), n=1..1000); # Robert Israel, Oct 19 2014
  • Mathematica
    f[n_] := Block[{m = n}, While[ Mod[m, 10] == 0, m /= 10]; PowerMod[m, n, 10]]; Array[f, 105] (* Robert G. Wilson v, Mar 13 2006 and modified Oct 12 2014 *)
  • PARI
    f(n) = while(!(n % 10), n/=10); n % 10; \\ A065881
    a(n) = lift(Mod(f(n), 10)^n); \\ Michel Marcus, Sep 13 2022
    
  • PARI
    a(n)=my(k=n/10^valuation(n,10)); lift(Mod(k,10)^(n%4+4)) \\ Charles R Greathouse IV, Sep 13 2022
    
  • Python
    def a(n):
        k = n
        while k%10 == 0: k //= 10
        return pow(k, n, 10)
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Sep 13 2022
    
  • Python
    def A116081(n): return pow(int(str(n).rstrip('0')[-1]),n,10) # Chai Wah Wu, Dec 07 2023

Formula

a(n) = A065881(n)^n mod 10 = A010879(A065881(n)^(A010883(n-1))). - Robert Israel, Oct 19 2014

Extensions

More terms from Robert G. Wilson v, Mar 13 2006

A322490 Numbers k such that k^k ends with 7.

Original entry on oeis.org

3, 17, 23, 37, 43, 57, 63, 77, 83, 97, 103, 117, 123, 137, 143, 157, 163, 177, 183, 197, 203, 217, 223, 237, 243, 257, 263, 277, 283, 297, 303, 317, 323, 337, 343, 357, 363, 377, 383, 397, 403, 417, 423, 437, 443, 457, 463, 477, 483, 497, 503, 517, 523, 537, 543, 557, 563
Offset: 1

Views

Author

Bruno Berselli, Dec 12 2018

Keywords

Comments

Equivalently, numbers k such that k and (7^h)^k end with the same digit, where h == 1 (mod 4).
Also, numbers k such that k and (3^h)^k end with the same digit, where h == 3 (mod 4).
Numbers congruent to {3, 17} mod 20. - Amiram Eldar, Feb 27 2023

Crossrefs

Subsequence of A063226, A295009.
Similar sequences are listed in A322489.

Programs

  • GAP
    List([1..70], n -> 10*n+2*(-1)^n-5);
    
  • Julia
    [10*n+2*(-1)^n-5 for n in 1:70] |> println
    
  • Magma
    [10*n+2*(-1)^n-5: n in [1..70]];
    
  • Maple
    select(n->n^n mod 10=7,[$1..563]); # Paolo P. Lava, Dec 18 2018
  • Mathematica
    Table[10 n + 2 (-1)^n - 5, {n, 1, 60}]
    LinearRecurrence[{1,1,-1},{3,17,23},80] (* Harvey P. Dale, Sep 15 2019 *)
  • Maxima
    makelist(10*n+2*(-1)^n-5, n, 1, 70);
    
  • PARI
    apply(A322490(n)=10*n+2*(-1)^n-5, [1..70])
    
  • PARI
    Vec(x*(3 + 14*x + 3*x^2) / ((1 + x)*(1 - x)^2) + O(x^55)) \\ Colin Barker, Dec 13 2018
  • Python
    [10*n+2*(-1)**n-5 for n in range(1, 70)]
    
  • Sage
    [10*n+2*(-1)^n-5 for n in (1..70)]
    

Formula

O.g.f.: x*(3 + 14*x + 3*x^2)/((1 + x)*(1 - x)^2).
E.g.f.: 3 + 2*exp(-x) + 5*(2*x - 1)*exp(x).
a(n) = -a(-n+1) = a(n-1) + a(n-2) - a(n-3).
a(n) = 10*n + 2*(-1)^n - 5. Therefore:
a(n) = 10*n - 7 for odd n;
a(n) = 10*n - 3 for even n.
a(n+2*k) = a(n) + 20*k.
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(7*Pi/20)*Pi/20. - Amiram Eldar, Feb 27 2023
Showing 1-2 of 2 results.