This site is supported by donations to The OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A151842 a(3n)=n, a(3n+1)=2n+1, a(3n+2)=n+1. 2
 0, 1, 1, 1, 3, 2, 2, 5, 3, 3, 7, 4, 4, 9, 5, 5, 11, 6, 6, 13, 7, 7, 15, 8, 8, 17, 9, 9, 19, 10, 10, 21, 11, 11, 23, 12, 12, 25, 13, 13, 27, 14, 14, 29, 15, 15, 31, 16, 16, 33, 17, 17, 35, 18, 18, 37, 19, 19, 39, 20, 20, 41, 21, 21, 43, 22, 22, 45, 23, 23, 47 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,5 COMMENTS Take a list of numbers (like 0,1,2,3,4,5,...) and then pair them up like this: (0,1)(1,2),(2,3),(3,4)... Then sum each pair, and insert the sum between the numbers, like this: (0,1,1), (1,3,2), (2,5,3), ... Finally, remove the parentheses: 0,1,1,1,3,2,2,5,3,... This mirrors the pattern used to make a dragon curve fractal. You take two points, then find one to insert between them. In the next iteration, you take those three points and find two numbers to insert between them. (Rather than summing the two numbers, a different function is used to find a point relative to two other points.) LINKS Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1). FORMULA From R. J. Mathar, Jul 14 2009: (Start) G.f.: x*(1+x)*(1+x^2)/((x-1)^2*(1+x+x^2)^2). a(n) = 2*a(n-3) - a(n-6). (End) Expansion of x * (1 - x^4) / ((1 - x) * (1 - x^3)^2) in powers of x. - Michael Somos, Aug 12 2009 Euler transform of length 4 sequence [ 1, 0, 2, -1]. - Michael Somos, Aug 12 2009 -a(n) = a(-1-n). - Michael Somos, Nov 11 2013 EXAMPLE G.f. = x + x^2 + x^3 + 3*x^4 + 2*x^5 + 2*x^6 + 5*x^7 + 3*x^8 + 3*x^9 + ... - Michael Somos, Aug 12 2009 MATHEMATICA CoefficientList[Series[x (1 + x) (1 + x^2) / ((x - 1)^2 (1 + x + x^2)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Feb 14 2015 *) PROG (Python) def pairup(x): return [x[i:i+2] for i in range(len(x)-1)] def combine(vals): return sum(vals) def expand(L, fn): return [(x, fn(x), x) for x in pairup(L)] L = range(20) print expand(L, combine) (PARI) {a(n) = kronecker(9, n) + (n\3) * [1, 2, 1][n%3 + 1]} /* Michael Somos, Aug 12 2009 */ (C++) int main(){     int sum = 0;     int i = 0;     int mod = 0;     while(true){         sum += i;         if (i != 0)             mod = sum % i;         if(mod != 0)             cout<

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

Last modified October 20 12:47 EDT 2019. Contains 328257 sequences. (Running on oeis4.)