OFFSET
1,3
COMMENTS
Numbers k such that k^k is a square. - Chai Wah Wu, Sep 18 2024
MATHEMATICA
With[{upto=150}, Union[Join[Range[0, upto, 2], Range[Sqrt[upto]]^2]]] (* Harvey P. Dale, Apr 29 2015 *)
PROG
(PARI) is_A176693(n)=!bittest(n, 0)||issquare(n) \\ M. F. Hasler, Apr 19 2015
(Python)
from math import isqrt
def A176693(n):
def f(x): return n-1+(x>>1)+(x&1)-(isqrt(x)+1>>1)
m, k = n-1, f(n-1)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Sep 18 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Apr 24 2010
EXTENSIONS
Initial a(1)=0 added by M. F. Hasler, Apr 20 2015
STATUS
approved