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!)
A276421 Number of palindromic compositions of n into nonprime numbers. 1
1, 1, 1, 1, 2, 1, 3, 1, 5, 3, 7, 4, 11, 6, 16, 9, 25, 14, 38, 21, 59, 34, 89, 50, 137, 77, 208, 117, 319, 180, 486, 273, 744, 420, 1134, 639, 1735, 977, 2648, 1491, 4048, 2281, 6180, 3480, 9444, 5321, 14421, 8122, 22035, 12412, 33655, 18957, 51417, 28966 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
V. E. Hoggatt, Jr., and Marjorie Bicknell, Palindromic compositions, Fibonacci Quart., Vol. 13(4), 1975, pp. 350-356.
FORMULA
G.f.: g(z)=(1+F(z))/(1-F(z^2)), where F(z)=Sum_{m nonprime} z^m = z + z^4 + z^6 + z^8 + z^9 + z^10 + z^12 + ... is the g.f. of A005171.
EXAMPLE
a(6) = 3 because we have [6], [1,4,1], and [1,1,1,1,1,1].
a(10) = 7 because we have [10], [1,8,1], [1,1,6,1,1], [1,4,4,1], [4,1,1,4], [1,1,1,4,1,1,1], and [1^{10}].
MAPLE
F:=sum(z^j, j=1..229)-(sum(z^ithprime(k), k=1..50)): g:=(1+F)/(1-subs(z = z^2, F)): gser:=series(g, z=0, 53): seq(coeff(gser, z, n), n=0..50);
# second Maple program:
a:= proc(n) option remember; `if`(isprime(n), 0, 1)+
add(`if`(isprime(j), 0, a(n-2*j)), j=1..n/2)
end:
seq(a(n), n=0..60); # Alois P. Heinz, Sep 03 2016
MATHEMATICA
a[n_] := a[n] = If[PrimeQ[n], 0, 1] + Sum[If[PrimeQ[j], 0, a[n-2j]], {j, 1, n/2}]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Feb 08 2017, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A323184 A102614 A307149 * A330547 A338357 A338358
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Sep 03 2016
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 24 07:35 EDT 2024. Contains 371922 sequences. (Running on oeis4.)