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.

A176693 Union of squares and the even numbers.

This page as a plain text file.
%I A176693 #20 Sep 18 2024 16:33:03
%S A176693 0,1,2,4,6,8,9,10,12,14,16,18,20,22,24,25,26,28,30,32,34,36,38,40,42,
%T A176693 44,46,48,49,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,81,82,84,
%U A176693 86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,121,122
%N A176693 Union of squares and the even numbers.
%C A176693 Numbers k such that k^k is a square. - _Chai Wah Wu_, Sep 18 2024
%t A176693 With[{upto=150},Union[Join[Range[0,upto,2],Range[Sqrt[upto]]^2]]] (* _Harvey P. Dale_, Apr 29 2015 *)
%o A176693 (PARI) is_A176693(n)=!bittest(n, 0)||issquare(n) \\ _M. F. Hasler_, Apr 19 2015
%o A176693 (Python)
%o A176693 from math import isqrt
%o A176693 def A176693(n):
%o A176693     def f(x): return n-1+(x>>1)+(x&1)-(isqrt(x)+1>>1)
%o A176693     m, k = n-1, f(n-1)
%o A176693     while m != k: m, k = k, f(k)
%o A176693     return m # _Chai Wah Wu_, Sep 18 2024
%Y A176693 Cf. A128201 (Union of squares and the odd numbers).
%K A176693 nonn,easy
%O A176693 1,3
%A A176693 _Vincenzo Librandi_, Apr 24 2010
%E A176693 Initial a(1)=0 added by _M. F. Hasler_, Apr 20 2015