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-10 of 15 results. Next

A061505 Leading digit of n^n.

Original entry on oeis.org

1, 1, 4, 2, 2, 3, 4, 8, 1, 3, 1, 2, 8, 3, 1, 4, 1, 8, 3, 1, 1, 5, 3, 2, 1, 8, 6, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 5, 6, 8, 1, 1, 2, 3, 5, 7, 1, 1, 3, 4, 8, 1, 2, 3, 6, 1, 2, 4, 7, 1, 2, 5, 1, 2, 4, 8, 1, 3, 8, 1, 3, 8, 1, 4, 1, 2, 5, 1, 3, 7, 1, 4, 1, 2, 7, 1, 5, 1, 3, 1, 2, 7, 2, 5, 1
Offset: 0

Views

Author

Amarnath Murthy, May 06 2001

Keywords

Comments

The sequence equals 2 in the range n = 3628..3730. - Rémy Sigrist, Dec 13 2018

Examples

			a(7) = 8, as 7^7 = 823543.
		

Crossrefs

Cf. A056849.

Programs

  • Mathematica
    a = {}; Do[ a = Append[ a, IntegerDigits[ n^n ] [ [ 1 ] ] ], {n, 1, 75 } ]; a
  • PARI
    a(n) = digits(n^n)[1] \\ Rémy Sigrist, Dec 13 2018

Formula

Using the formula in A000030: a(n) = [n^n / 10^([log_10(n^n)])] = [n^n / 10^([n*log_10(n)])].

Extensions

More terms from Robert G. Wilson v, May 10 2001
Further terms from Asher Auel, May 20 2001
a(0) = 1 prepended by Rémy Sigrist, Dec 13 2018

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

A322489 Numbers k such that k^k ends with 4.

Original entry on oeis.org

2, 18, 22, 38, 42, 58, 62, 78, 82, 98, 102, 118, 122, 138, 142, 158, 162, 178, 182, 198, 202, 218, 222, 238, 242, 258, 262, 278, 282, 298, 302, 318, 322, 338, 342, 358, 362, 378, 382, 398, 402, 418, 422, 438, 442, 458, 462, 478, 482, 498, 502, 518, 522, 538, 542, 558
Offset: 1

Views

Author

Bruno Berselli, Dec 12 2018

Keywords

Comments

Also numbers k == 2 (mod 4) such that 2^k and k^2 end with the same digit.
Numbers congruent to {2, 18} mod 20. - Amiram Eldar, Feb 27 2023

Crossrefs

Subsequence of A139544, A235700.
Numbers k such that k^k ends with d: A008592 (d=0), A017281 (d=1), A067870 (d=3), this sequence (d=4), A017329 (d=5), A271346 (d=6), A322490 (d=7), A017377 (d=9).

Programs

  • GAP
    List([1..70], n -> 10*n+3*(-1)^n-5);
    
  • Julia
    [10*n+3*(-1)^n-5 for n in 1:70] |> println
    
  • Magma
    [10*n+3*(-1)^n-5: n in [1..70]];
    
  • Maple
    select(n->n^n mod 10=4,[$1..558]); # Paolo P. Lava, Dec 18 2018
  • Mathematica
    Table[10 n + 3 (-1)^n - 5, {n, 1, 60}]
  • Maxima
    makelist(10*n+3*(-1)^n-5, n, 1, 70);
    
  • PARI
    apply(A322489(n)=10*n+3*(-1)^n-5, [1..70]) \\ M. F. Hasler, Dec 14 2018
    
  • PARI
    Vec(2*x*(1 + 8*x + x^2) / ((1 - x)^2*(1 + x)) + O(x^70)) \\ Colin Barker, Dec 13 2018
  • Python
    [10*n+3*(-1)**n-5 for n in range(1, 70)]
    
  • Sage
    [10*n+3*(-1)^n-5 for n in (1..70)]
    

Formula

O.g.f.: 2*x*(1 + 8*x + x^2)/((1 + x)*(1 - x)^2).
E.g.f.: 2 + 3*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 + 3*(-1)^n - 5. Therefore:
a(n) = 10*n - 8 for odd n;
a(n) = 10*n - 2 for even n.
a(n+2*k) = a(n) + 20*k.
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(2*Pi/5)*Pi/20 = sqrt(5+2*sqrt(5))*Pi/20. - Amiram Eldar, Feb 27 2023

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

A238291 Final digit of real part of (n+n*i)^n.

Original entry on oeis.org

1, 0, 6, 6, 0, 0, 4, 6, 4, 0, 8, 6, 8, 0, 0, 6, 2, 0, 2, 0, 6, 0, 6, 6, 0, 0, 4, 6, 4, 0, 8, 6, 8, 0, 0, 6, 2, 0, 2, 0, 6, 0, 6, 6, 0, 0, 4, 6, 4, 0, 8, 6, 8, 0, 0, 6, 2, 0, 2, 0, 6, 0, 6, 6, 0, 0, 4, 6, 4, 0, 8, 6, 8, 0, 0, 6, 2, 0, 2, 0, 6, 0, 6, 6, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Starting from a(2) the sequence is periodic with period length 20. - Giovanni Resta, Feb 23 2014

Crossrefs

Programs

  • Mathematica
    re[n_, b_] := Mod[b + Re@PowerMod[(n + n I), n, b], b];
    Table[re[n, 10], {n, 100}]

A238292 Final digit of imaginary part of (n+n*i)^n.

Original entry on oeis.org

1, 8, 4, 0, 0, 2, 6, 0, 4, 0, 2, 0, 8, 2, 0, 0, 2, 8, 8, 0, 6, 8, 4, 0, 0, 2, 6, 0, 4, 0, 2, 0, 8, 2, 0, 0, 2, 8, 8, 0, 6, 8, 4, 0, 0, 2, 6, 0, 4, 0, 2, 0, 8, 2, 0, 0, 2, 8, 8, 0, 6, 8, 4, 0, 0, 2, 6, 0, 4, 0, 2, 0, 8, 2, 0, 0, 2, 8, 8, 0, 6, 8, 4, 0, 0, 2
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    im[n_, b_] := Mod[b + Im@PowerMod[(n + n I), n, b], b]; Table[im[n, 10], {n, 100}]

A271346 Numbers k such that the final digit of k^k is 6.

Original entry on oeis.org

4, 6, 8, 12, 14, 16, 24, 26, 28, 32, 34, 36, 44, 46, 48, 52, 54, 56, 64, 66, 68, 72, 74, 76, 84, 86, 88, 92, 94, 96, 104, 106, 108, 112, 114, 116, 124, 126, 128, 132, 134, 136, 144, 146, 148, 152, 154, 156, 164, 166, 168, 172, 174, 176, 184, 186, 188, 192, 194
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 04 2016

Keywords

Comments

The values of n^n (A000312) end in every digit except for 2 and 8. The sequence of final digits of n^n (A056849) is periodic with period 20; for n=1,2,... the last digits are [1, 4, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 4, 9, 0]. Thus, 6 is the most common final digit of n^n. Since 6 does not occur at any odd index in the list above, all terms of a(n) are even. Also, from the distribution of 6's in the list, we can see that the difference between any two consecutive values of a(n) will be 2, 4 or 8.

Crossrefs

Cf. A000312 (n^n), A056849 (final digit of n^n).

Programs

  • Magma
    I:=[4,6,8,12,14,16,24]; [n le 7 select I[n] else Self(n-1)+Self(n-6)-Self(n-7): n in [1..60]]; // Vincenzo Librandi, Oct 09 2017
    
  • Maple
    A271346:=n->`if`(n^n mod 10 = 6, n, NULL): seq(A271346(n), n=1..500);
  • Mathematica
    LinearRecurrence[{1, 0, 0, 0, 0, 1, -1}, {4, 6, 8, 12, 14, 16, 24},59] (* Ray Chandler, Mar 08 2017 *)
  • PARI
    is(n) = Mod(n, 10)^n==6 \\ Felix Fröhlich, Apr 07 2016
    
  • PARI
    Vec(2*x*(1 + x^2)*(2 + x - x^2 + x^3 + 2*x^4) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)) + O(x^59)) \\ Colin Barker, Dec 13 2018

Formula

a(n) = a(n-1) + a(n-6) - a(n-7) for n > 7. - Wesley Ivan Hurt, Oct 08 2017
G.f.: 2*x*(1 + x^2)*(2 + x - x^2 + x^3 + 2*x^4) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)). - Colin Barker, Dec 13 2018

A365935 Final digit (in decimal system) of n^(n+1) = A007778(n).

Original entry on oeis.org

0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6
Offset: 0

Views

Author

Marco Ripà, Sep 23 2023

Keywords

Comments

This is a periodic sequence (1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0) with period 20 (which is twice the base).

Examples

			For n = 3, a(3) = 3^4 mod 10 = 81 mod 10 = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Last[IntegerDigits[n^(n+1)]]; Array[a,87,0] (* Stefano Spezia, Sep 26 2023 *)
  • PARI
    a(n) = lift(Mod(n, 10)^(n+1)); \\ Michel Marcus, Sep 23 2023

Formula

a(n) = n^(n+1) mod 10.
a(n) = A010879(A007778(n)).
a(n) = A365936(n+10).

A175348 Last digit of p^p, where p is the n-th prime.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Euler and Sadek ask whether the sequence, interpreted as the decimal expansion N = 0.47531..., is rational or irrational.
Dickson's conjecture implies that each finite sequence with values in {1,3,7,9} occurs as a substring. In particular, this implies that the above N is irrational. - Robert Israel, Jan 26 2017

Examples

			prime(4) = 7 and 7^7 = 823543, so a(4) = 3.
		

References

  • R. Euler and J. Sadek, A number that gives the unit digit of n^n. Journal of Recreational Mathematics, 29:3 (1998), pp. 203-204.

Crossrefs

Programs

  • Maple
    R:= [seq(i &^ i mod 10, i=1..20)]:
    seq(R[ithprime(i) mod 20],i=1..100); # Robert Israel, Jan 26 2017
  • Mathematica
    Table[PowerMod[n,n,10],{n,Prime[Range[110]]}] (* Harvey P. Dale, Mar 24 2024 *)
  • PARI
    a(n)=[1,4,7,0,5,0,3,0,9,0,1,0,3,0,0,0,7,0,9][prime(n)%20]

Formula

a(n) = A056849(A000040(n)). - Robert Israel, Jan 26 2017

A229481 Final digit of 1^n + 2^n + ... + n^n.

Original entry on oeis.org

0, 1, 5, 6, 4, 5, 1, 4, 2, 5, 5, 6, 0, 1, 5, 0, 8, 3, 9, 0, 6, 1, 5, 6, 0, 5, 1, 4, 8, 5, 5, 6, 6, 1, 5, 0, 4, 3, 9, 0, 2, 1, 5, 6, 6, 5, 1, 4, 4, 5, 5, 6, 2, 1, 5, 0, 0, 3, 9, 0, 8, 1, 5, 6, 2, 5, 1, 4, 0, 5, 5, 6, 8, 1, 5, 0, 6, 3, 9, 0, 4, 1, 5, 6, 8, 5, 1, 4, 6, 5, 5, 6, 4, 1, 5, 0, 2, 3, 9, 0
Offset: 0

Views

Author

Keywords

Comments

Cyclic with period 100.

Crossrefs

Programs

  • Maple
    a:= proc(n) local l; l:=[seq(add(k&^i mod 10, k=1..i) mod 10, i=0..99)]:
          proc(n) l[1+irem(n, 100)] end
        end():
    seq(a(n), n=0..200);  # Alois P. Heinz, Sep 26 2013
  • Mathematica
    Table[Mod[Sum[PowerMod[i, n, 10], {i, 1, n}], 10], {n, 0, 133}]
  • PARI
    a(n)=n%=100;lift(sum(k=1,n,Mod(k,10)^n)) \\ Charles R Greathouse IV, Dec 13 2013

Formula

a(n) = a(n-100). - Wesley Ivan Hurt, Jan 02 2024
Showing 1-10 of 15 results. Next