|
|
A176982
|
|
Sequence defined by the recursion a(n) = (1/2)*((1-signum(abs(b(n))-n))*b(n)+(1+signum(abs(b(n))-n))*a(n-1)), with a(1)=1 and b(n)=1+a(n-1-(n mod a(n-1)))-(-1)^n*a(n-1).
|
|
1
|
|
|
1, 1, 2, 1, 3, 1, 3, 1, 3, -1, -1, 1, 3, -3, -5, 3, 1, 1, 3, -1, -1, 1, 3, 1, 3, 1, 3, -1, -1, 1, 3, -3, -5, 5, 11, -13, -9, 21, 21, -21, -21, 1, 3, -23, -21, 1, 3, 1, 3, 1, 3, -1, -1, 1, 3, -3, -5, 7, 11, -9, -9, 9, 19, -21, -11, 1, 3, -13, -33, 23, 11, -21, -11, 1, 3, -1, -1, 1, 3, -3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Behaves erratically (see linked picture).
There is a similar sequence with a(1)=2.
|
|
REFERENCES
|
G. Balzarotti and P. P. Lava, 103 curiosità matematiche, Hoepli, 2010, p. 276.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (1/2)*((1-signum(abs(b(n))-n))*b(n)+(1+signum(abs(b(n))-n))*a(n-1)), with a(1)=1 and b(n)=1+a(n-1-(n mod a(n-1)))-(-1)^n*a(n-1).
|
|
EXAMPLE
|
a(1)=1.
b(2)=signum(abs(1+(2-1-(2 mod 1))-(-1)^2*1)-2)=signum(abs(1+1-1)-2)=-1.
a(2)=(1/2)*(1+1)*1+(1/2)*(1-1)*1=1+0=1.
|
|
MAPLE
|
P:=proc(i) local a, n; a:=array(1..50000); a[1]:=1; print(a[1]); for n from 2 by 1 to i do a[n]:=1/2*(1-signum(abs(1+a[n-1-(n mod (a[n-1]))]-(-1)^n*a[n-1])-n))*(1+a[n-1-(n mod (a[n-1]))]-(-1)^n*a[n-1])+1/2*(1+signum(abs(1+a[n-1-(n mod (a[n-1]))]-(-1)^n*a[n-1])-n))*a[n-1]; print(a[n]); od; end: P(10000);
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|