cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A096777 a(n) = a(n-1) + Sum_{k=1..n-1}(a(k) mod 2), a(1) = 1.

This page as a plain text file.
%I A096777 #42 Feb 16 2025 08:32:54
%S A096777 1,2,3,5,8,11,15,20,25,31,38,45,53,62,71,81,92,103,115,128,141,155,
%T A096777 170,185,201,218,235,253,272,291,311,332,353,375,398,421,445,470,495,
%U A096777 521,548,575,603,632,661,691,722,753,785,818,851,885,920,955,991,1028
%N A096777 a(n) = a(n-1) + Sum_{k=1..n-1}(a(k) mod 2), a(1) = 1.
%C A096777 a(n) = a(n-1) + (number of odd terms so far in the sequence). Example: 15 is 11 + 4 odd terms so far in the sequence (they are 1,3,5,11). See A007980 for the same construction with even integers. - _Eric Angelini_, Aug 05 2007
%C A096777 A016789 and A032766 give positions where even and odd terms occur; a(3*n)=A056106(n); a(3*n-1)=A077588(n); a(3*n-2)=A056108(n). - _Reinhard Zumkeller_, Dec 29 2007
%H A096777 Reinhard Zumkeller, <a href="/A096777/b096777.txt">Table of n, a(n) for n = 1..10000</a>
%H A096777 J.-L. Baril, T. Mansour, A. Petrossian, <a href="http://jl.baril.u-bourgogne.fr/equival.pdf">Equivalence classes of permutations modulo excedances</a>, 2014.
%H A096777 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/OddNumber.html">Odd Number</a>
%H A096777 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,1,-2,1).
%F A096777 a(n+1) - a(n) = A004396(n).
%F A096777 a(n) = floor(n/3) * (3*floor(n/3) + 2*(n mod 3) - 1) + n mod 3 + 0^(n mod 3). - _Reinhard Zumkeller_, Dec 29 2007
%F A096777 a(n) = floor((n-2)^2/3) + n. - _Christopher Hunt Gribble_, Mar 06 2014
%F A096777 G.f.: -x*(x^4+1) / ((x-1)^3*(x^2+x+1)). - _Colin Barker_, Mar 07 2014
%F A096777 Euler transform of finite sequence [2, 0, 1, 1, 0, 0, 0, -1]. - _Michael Somos_, Apr 18 2020
%F A096777 a(n) = (10 + 3*n*(n - 1) - A061347(n+1))/9. - _Stefano Spezia_, Sep 22 2022
%e A096777 G.f. = x + 2*x^2 + 3*x^3 + 5*x^4 + 8*x^5 + 11*x^6 + 15*x^7 + 20*x^8 + ... - _Michael Somos_, Apr 18 2020
%p A096777 A096777:=n->n + floor((n-2)^2/3); seq(A096777(n), n=1..100); # _Wesley Ivan Hurt_, Mar 06 2014
%t A096777 Table[n + Floor[(n-2)^2/3], {n, 100}] (* _Wesley Ivan Hurt_, Mar 06 2014 *)
%o A096777 (PARI) a(n)=(n-2)^2\3+n \\ _Charles R Greathouse IV_, Mar 06 2014
%o A096777 (Haskell)
%o A096777 a096777 n = a096777_list !! (n-1)
%o A096777 a096777_list = 1 : zipWith (+) a096777_list
%o A096777                                (scanl1 (+) (map (`mod` 2) a096777_list))
%o A096777 -- _Reinhard Zumkeller_, Mar 11 2014
%o A096777 (Magma) [Floor((n-2)^2/3)+n: n in [1..60]]; // _Vincenzo Librandi_, Dec 27 2015
%Y A096777 Cf. A004396, A007980, A016789, A032766, A056106, A056108, A061347, A077588, A097602, A131093.
%K A096777 nonn,easy
%O A096777 1,2
%A A096777 _Reinhard Zumkeller_, Jul 09 2004