login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A133622 a(n) = 1 if n is odd, a(n) = n/2+1 if n is even. 12

%I #36 Mar 03 2020 16:14:37

%S 1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,

%T 17,1,18,1,19,1,20,1,21,1,22,1,23,1,24,1,25,1,26,1,27,1,28,1,29,1,30,

%U 1,31,1,32,1,33,1,34,1,35,1,36,1,37,1,38,1,39,1,40,1,41,1,42,1,43,1,44,1

%N a(n) = 1 if n is odd, a(n) = n/2+1 if n is even.

%C a(n) is the count of terms a(n+1) present so far in the sequence, with a(n+1) included in the count; example: a(1) = 1 "says" that there is 1 term "2" so far in the sequence; a(2) = 2 "says" that there are 2 terms "1" so far in the sequence... etc. This comment was inspired by A039617. - _Eric Angelini_, Mar 03 2020

%F a(n)=1+(binomial(n+1,2)mod n)=1+(binomial(n+1,n-1)mod n).

%F a(n)=binomial(n+2,2) mod n = binomial(n+2,n) mod n for n>2.

%F a(n)=1+(1+(-1)^n)*n/4.

%F a(n)=1+(A000217(n) mod n).

%F a(n)=a(n-2)+1, if n is even, a(n)=a(n-2) if n is odd.

%F a(n)=a(n-2)+1-(n mod 2)=a(n-2)+(1+(-1)^n)/2 for n>2.

%F a(n)=(a(n-3)+a(n-2))/a(n-1) for n>3.

%F G.f.: g(x)=x(1+2x-x^2-x^3)/(1-x^2)^2.

%F G.f.: (Q(0)-1-x)/x^2, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Apr 23 2013

%F a(n) = 2*a(n-2)-a(n-4) for n > 4. - _Chai Wah Wu_, May 26 2016

%F E.g.f.: exp(x) - 1 + x*sinh(x)/2. - _Robert Israel_, May 27 2016

%p seq([1,n][],n=2..100); # _Robert Israel_, May 27 2016

%t Riffle[Range[2,50],1,{1,-1,2}] (* _Harvey P. Dale_, Jan 19 2013 *)

%o (Haskell)

%o import Data.List (transpose)

%o a133622 n = (1 - m) * n' + 1 where (n', m) = divMod n 2

%o a133622_list = concat $ transpose [[1, 1 ..], [2 ..]]

%o -- _Reinhard Zumkeller_, Feb 20 2015

%o (PARI) a(n)=if(n%2,1,n/2+1) \\ _Charles R Greathouse IV_, Sep 02 2015

%Y Cf. A133620, A133621, A133623, A133624, A133625, A133630, A038509, A133634-A133636, A133872, A133882, A133880, A133890, A133900, A133910, A165157 (partial sums).

%Y Other related sequences: A000217, A007879, A057979.

%K nonn,easy

%O 1,2

%A _Hieronymus Fischer_, Sep 30 2007

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 04:56 EDT 2024. Contains 371767 sequences. (Running on oeis4.)