|
|
A001670
|
|
k appears k times (k even).
|
|
7
|
|
|
2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
With a different offset: g.f. = Sum_{j>=0} 2*x^(j^2+i)/(1-x). - Ralf Stephan, Mar 11 2003
a(n) = a(n - a(n-2)) + 2; a(1)=2, a(2)=2.
a(n) = 2*round(sqrt(n)). (End)
G.f.: x^(3/4)*theta_2(0,x)/(1-x) where theta_2 is the second Jacobi theta function. - Robert Israel, Jan 14 2015
a(n) = 2*floor((sqrt(4*n-3)+1)/2). - Néstor Jofré, Apr 24 2017
|
|
MAPLE
|
|
|
MATHEMATICA
|
a[1]=2, a[2]=2, a[n_]:=a[n]=a[n-a[n-2]]+2 (* Branko Curgus, May 11 2010 *)
Flatten[Table[Table[n, {n}], {n, 2, 16, 2}]] (* Harvey P. Dale, May 31 2012 *)
|
|
PROG
|
(MATLAB) a = @(n) 2*floor((sqrt(4*n-3)+1)/2); % handle function // Néstor Jofré, Apr 24 2017
(Python)
from math import isqrt
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|