login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239678 Least numbers k such that k*2^n+1 is a square. 2
3, 4, 2, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Excluding a(1) and a(2), these numbers equal 2^n-1 (See A000225).
The sequence A088041 is the square roots of the squares produced.
LINKS
FORMULA
a(n+2) == A000225(n) for n >= 1.
a(n) = 3*a(n-1)-2*a(n-2) for n>4. G.f.: (4*x^4+3*x^3-4*x^2-5*x+3) / ((x-1)*(2*x-1)). - Colin Barker, Mar 24 2014
EXAMPLE
1*2^1+1 = 3 is not a square. 2*2^1+1 = 5 is not a square. 3*2^1+1 = 7 is not a square. 4*2^1+1 = 9 is a square. Thus, a(1) = 4.
MATHEMATICA
CoefficientList[Series[(4 x^4 + 3 x^3 - 4 x^2 - 5 x + 3)/((x - 1) (2 x - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Mar 24 2014 *)
PROG
(Python)
import sympy
from sympy import isprime
def TwoSq(n):
..for k in range(1, 10**10):
....for i in range(10**4):
......if k*(2**n)+1 == i**2:
........return k
......if k*(2**n)+1 < i**2:
........break
n = 1
while n < 100:
..print(TwoSq(n))
..n += 1
(PARI)
Vec((4*x^4+3*x^3-4*x^2-5*x+3)/((x-1)*(2*x-1)) + O(x^100)) \\ Colin Barker, Mar 24 2014
CROSSREFS
Sequence in context: A201909 A070352 A227216 * A136374 A303869 A081246
KEYWORD
nonn,easy
AUTHOR
Derek Orr, Mar 23 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 07:38 EDT 2024. Contains 371782 sequences. (Running on oeis4.)