login
A100455
a(n) = 2^n + sin(n*Pi/2).
1
1, 3, 4, 7, 16, 33, 64, 127, 256, 513, 1024, 2047, 4096, 8193, 16384, 32767, 65536, 131073, 262144, 524287, 1048576, 2097153, 4194304, 8388607, 16777216, 33554433, 67108864, 134217727, 268435456, 536870913, 1073741824, 2147483647, 4294967296, 8589934593
OFFSET
0,2
COMMENTS
The sequence represents a noised binary mask.
FORMULA
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3), with a(0)=1, a(1)=3, a(2)=4. - Harvey P. Dale, Jan 17 2012
G.f.: (1+x-x^2)/((1-2*x)*(1+x^2)). - R. J. Mathar, Nov 07 2015
MATHEMATICA
With[{c=Pi/2}, Table[2^n+Sin[c n], {n, 0, 40}]] (* or *) LinearRecurrence[ {2, -1, 2}, {1, 3, 4}, 40] (* Harvey P. Dale, Jan 17 2012 *)
PROG
(Magma) I:=[1, 3, 4]; [n le 3 select I[n] else 2*Self(n-1) -Self(n-2) +2*Self(n-3): n in [1..51]]; // G. C. Greubel, Apr 07 2023
(SageMath)
@CachedFunction
def a(n): # a = A100455
if (n<3): return (1, 3, 4)[n]
else: return 2*a(n-1) - a(n-2) + 2*a(n-3)
[a(n) for n in range(81)] # G. C. Greubel, Apr 07 2023
CROSSREFS
Sequence in context: A116090 A287741 A291710 * A363055 A291773 A287752
KEYWORD
nonn,easy
AUTHOR
Konstantin Loutski (kilout(AT)yandex.ru), Nov 22 2004
STATUS
approved