OFFSET
1,6
COMMENTS
Number of double-stars (diameter 3 trees) with n nodes. For n >= 3, number of partitions of n-2 into two parts. - Washington Bomfim, Feb 12 2011
Number of roots of the n-th Bernoulli polynomial in the left half-plane. - Michel Lagneau, Nov 08 2012
From Gus Wiseman, Oct 17 2020: (Start)
Also the number of 3-part non-strict integer partitions of n - 1. The Heinz numbers of these partitions are given by A285508. The version for partitions of any length is A047967, with Heinz numbers A013929. The a(4) = 1 through a(15) = 6 partitions are (A = 10, B = 11, C = 12):
111 211 221 222 322 332 333 433 443 444 544 554
311 411 331 422 441 442 533 552 553 644
511 611 522 622 551 633 661 662
711 811 722 822 733 833
911 A11 922 A22
B11 C11
(End)
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
Washington Bomfim, Double-star corresponding to the partition [3,7]
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = floor((n-2)/2), for n > 1, otherwise 0. - Washington Bomfim, Feb 12 2011
G.f.: x^4/(1-x-x^2+x^3). - Colin Barker, Jan 31 2012
EXAMPLE
The square (n=4) has two congruent diagonals; so a(4)=1. The regular pentagon also has congruent diagonals; so a(5)=1. Among all the diagonals in a regular hexagon, there are two noncongruent ones; hence a(6)=2, etc.
MAPLE
with(numtheory): for n from 1 to 80 do:it:=0:
y:=[fsolve(bernoulli(n, x) , x, complex)] : for m from 1 to nops(y) do : if Re(y[m])<0 then it:=it+1:else fi:od: printf(`%d, `, it):od:
MATHEMATICA
a[1]=0; a[n_?OddQ] := (n-3)/2; a[n_] := n/2-1; Array[a, 100] (* Jean-François Alcover, Nov 17 2015 *)
PROG
(PARI) a(n)=if(n>1, n\2-1, 0) \\ Charles R Greathouse IV, Oct 16 2015
(Magma)
A140106:= func< n | n eq 1 select 0 else Floor((n-2)/2) >;
[A140106(n): n in [1..80]]; // G. C. Greubel, Feb 10 2023
(SageMath)
def A140106(n): return 0 if (n==1) else (n-2)//2
[A140106(n) for n in range(1, 81)] # G. C. Greubel, Feb 10 2023
(Python)
def A140106(n): return n-2>>1 if n>1 else 0 # Chai Wah Wu, Sep 18 2023
CROSSREFS
Essentially the same as A004526.
KEYWORD
nonn,easy
AUTHOR
Andrew McFarland, Jun 03 2008
EXTENSIONS
More terms from Joseph Myers, Sep 05 2009
STATUS
approved