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.

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