OFFSET
0,2
COMMENTS
Binary expansion is 0, 101, 11011, 1110111, 111101111, ... (see A138148).
9 + 8a(n) = s^2 is a perfect square with s = 2^(n + 2) -1 = 3, 7, 15, 31, 63, ...
Numbers with middle bit 0, that have only one bit 0, and the total number of bits is odd.
The fractional part of the base 2 logarithm of a(n) approaches 1 as n approaches infinity.
Also called binary cyclops numbers.
Last digit of the decimal representation follows the pattern 5, 7, 9, 5, 5, 7, 9, 5, ... . - Alex Ratushnyak, Dec 08 2012
LINKS
Robert Israel, Table of n, a(n) for n = 0..1630
Brady Haran and Simon Pampena, Glitch Primes and Cyclops Numbers, Numberphile video, video (2015)
Index entries for linear recurrences with constant coefficients, signature (7,-14,8).
FORMULA
a(n) = 2^(2n + 1) - 2^n - 1 = 2*4^n - 2^n - 1 = (2^n - 1)(2*2^n + 1).
G.f.: x*(8*x-5)/((x-1)*(2*x-1)*(4*x-1)).
Recurrences:
a(n) = (1/2)*(7 + 8*a(n - 1) + sqrt(9 + 8*a(n - 1))), a(0) = 0;
a(n) = 6*a(n - 1) - 8*a(n - 2) - 3, a(0) = 0, a(1) = 5;
a(n) = 7*a(n - 1) - 14*a(n - 2) + 8*a(n - 3), a(0) = 0, a(1) = 5, a(2) = 27.
a(n) = A006516(n+1) - 1.
MAPLE
MATHEMATICA
(* 1st *) FromDigits[ #, 2]&/@NestList[Append[Prepend[ #, 1], 1]&, {0}, 25] (* 2nd *) NestList[(1/2)(7 + 8# + Sqrt[9 + 8# ])&, 0, 22] (* both of these are from Zak Seidov *)
f[n_] := 2^(2n + 1) - 2^n - 1; Table[f@n, {n, 0, 22}] (* Robert G. Wilson v, Aug 24 2007 *)
Table[EulerE[2, 2^n], {n, 1, 60}]/2 - 1 (* Vladimir Joseph Stephan Orlovsky, Nov 03 2009 *)
(* After running the program in A134808 *) Select[Range[0, 2^16 - 1], cyclopsQ[#, 2] &] (* Alonso del Arte, Dec 17 2010 *)
LinearRecurrence[{7, -14, 8}, {0, 5, 27}, 30] (* Vincenzo Librandi, Dec 08 2015 *)
PROG
(Magma) [2^(2*n+1)-2^n-1: n in [0..25]]; // Vincenzo Librandi, Dec 08 2015
(PARI) concat(0, Vec(x*(5-8*x)/(1-7*x+14*x^2-8*x^3) + O(x^100))) \\ Altug Alkan, Dec 08 2015
(Python)
def A129868(n): return ((m:=1<<n)-1)*((m<<1)+1) # Chai Wah Wu, Mar 19 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Zak Seidov, May 24 2007
STATUS
approved