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!)
A286110 Number of distinct hexaflexagons of length n. 2
1, 1, 1, 3, 3, 7, 8, 17, 21, 47, 63, 132, 205, 411, 685, 1353, 2385, 4643, 8496, 16430, 30735, 59343, 112531, 217245, 415628, 803209, 1545463, 2991191, 5778267, 11201883, 21702708, 42141575, 81830748, 159140895, 309590883, 602938098, 1174779397, 2290920127 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,4
LINKS
Marshall Hampton, Constructing and Counting Hexaflexagons, arXiv:1704.07775 [math.CO], 2017.
MAPLE
A286110 := proc(n)
if type(n, 'odd') then
add(A052307(n, ceil(n/2)+1+3*i), i=0..n/6+1) ;
else
add(A052307(n, ceil(n/2)+3*i), i=0..n/6) ;
%-A052307(n, n/2)/2+A007148(n/2)/2-1
end if;
end proc:
seq(A286110(n), n=3..40) ; # R. J. Mathar, Jul 23 2017
MATHEMATICA
A007148[n_] := (1/2)*(2^(n - 1) + Total[EulerPhi[2*#]*2^(n/#) & /@ Divisors[n]]/(2*n));
A052307[n_, k_] := Module[{hk = Mod[k, 2], a = 0}, If[k == 0, Return[1]]; Do[a = a + EulerPhi[d]*Binomial[n/d - 1, k/d - 1], {d, Divisors[GCD[k, n]]}]; (a/k + Binomial[Floor[(n - hk)/2], Floor[k/2]])/2];
a[n_] := Module[{s}, If[Mod[n, 2] == 1, Sum[A052307[n, Ceiling[n/2] + 1 + 3*i], {i, 0, Floor[n/6] + 1}], s = Sum[A052307[n, Ceiling[n/2] + 3*i], {i, 0, Floor[n/6] }]; s - A052307[n, n/2]/2 + A007148[n/2]/2 - 1]];
Table[a[n], {n, 3, 40}] (* Jean-François Alcover, Nov 28 2017, after R. J. Mathar *)
PROG
(Python)
from sympy import binomial as C, totient, divisors, gcd, floor, ceiling
def a007148(n):
if n==1: return 1
return 2**(n - 2) + sum(totient(2*d)*2**(n//d) for d in divisors(n))//(4*n)
def a052307(n, k): return 1 if n==0 else C((n//2) - k%2 * (1 - n%2), (k//2))/2 + sum(totient(d)*C(n//d, k//d) for d in divisors(gcd(n, k)))/(2*n)
def a(n):
if n%2: return sum([a052307(n, ceiling(n/2) + 1 + 3*i) for i in range(n//6 + 2)])
else:
s=sum([a052307(n, ceiling(n/2) + 3*i) for i in range(n//6 + 1)])
return s - a052307(n, n//2)//2 + a007148(n//2)//2 - 1
print([a(n) for n in range(3, 41)]) # Indranil Ghosh, Jul 24 2017, after Maple code
CROSSREFS
Sequence in context: A304179 A182559 A108046 * A116157 A056357 A288728
KEYWORD
nonn
AUTHOR
Michel Marcus, May 02 2017
STATUS
approved

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 18:58 EDT 2024. Contains 371781 sequences. (Running on oeis4.)