OFFSET
0,3
COMMENTS
Same definition for k:
k+b(n)+n is a square for each term b(n) of A097063 except the first;
k+b(n)+n+1 is a square for each term b(n) of A007590 except the first;
k+b(n)+n is a cube for each term b(n) of the sequence 0, 7, 18, 43, 78, 133, 204, 301, 420, 571, 750, 967, 1218, 1513, 1848, 2233, 2664, 3151, 3690, 4291, 4950, 5677, 6468, 7333, ... (last digit repeats with period 10);
k+b(n)+n is a triangular number for each term b(n) of A002378 (oblong numbers);
k+b(n)+n is an oblong number for each term b(n) of A000217 (triangular numbers);
k+b(n)+n is a prime for each term b(n) of the sequence 0, 1, 2, 6, 7, 11, 12, 18, 21, 23, 26, 30, 31, 35, 40, 42, 43, 47, 48, 60, 69, 73, 78, 80, 87, 99, 102, 104, 107, 115, 118, 120, 125, 135, ...
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,1,-3,0,1).
FORMULA
a(n) = a(n-1) +a(n-2) +floor(n/2) -1 with n>1, a(0)=0, a(1)=1.
From Bruno Berselli, Jul 31 2012: (Start)
G.f.: x*(1-2*x^2+x^3+x^4)/((1+x)*(1-x)^2*(1-x-x^2)).
a(n) = Fibonacci(n+2)-A004526(n+1) with n>0, a(0)=0.
a(n) = A129696(n-1)+1 with n>1, a(0)=0, a(1)=1. (End)
EXAMPLE
For n + 1 = 7, a(n + 1) = 30 is the least k > a(n) = a(6) = 18 such that k + a(n) + n + 1 = 30 + 18 + 6 + 1 = 55 is a Fibonacci number. - David A. Corneth, Sep 03 2016
MATHEMATICA
Join[{0}, LinearRecurrence[{2, 1, -3, 0, 1}, {1, 2, 3, 6, 10}, 39]] (* Jean-François Alcover, Oct 05 2017 *)
PROG
(Python)
prpr = 0
prev = 1
fib = [0]*100
for n in range(100):
fib[n] = prpr
curr = prpr+prev
prpr = prev
prev = curr
a = 0
for n in range(1, 55):
print(a, end=', ')
b = c = 0
while c <= a:
c = fib[b] - a - n
b += 1
a=c
(Python)
print(0, end=', ')
prpr = 1
prev = 2
for n in range(3, 56):
print(prpr, end=', ')
curr = prpr+prev + n//2 - 1
prpr = prev
prev = curr
(Magma) [n le 3 select n else Self(n)+Self(n-1)+Floor(n/2)-1: n in [0..40]]; // Bruno Berselli, Jul 31 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Jul 31 2012
EXTENSIONS
Definition corrected by David A. Corneth, Sep 03 2016
STATUS
approved