OFFSET
1,2
COMMENTS
From T. D. Noe, Jul 27 2007: (Start)
This is similar to A000123 and A005704, which both have a recursion a(n)=a(n-1)+a([n/k]), where k is 2 and 3, respectively. Those sequences count "partitions of k*n into powers of k". For the present sequence, k=phi. Does A006336(n) count the partitions of n*phi into powers of phi?
Answering my own question: If the recursion starts with a(0)=1, then I think we obtain "number of partitions of n*phi into powers of phi" (see A131882).
Here we need negative powers of phi also: letting p=phi and q=1/phi, we have
n=0: 0*p = {} for 1 partition,
n=1: 1*p = p = 1+q for 2 partitions,
n=2: 2*p = p+p = 1+p+q = 1+1+q+q = p^2+q for 4 partitions, etc.
So the present sequence, which starts with a(1)=1, counts 1/2 of the "number of partitions of n*phi into powers of phi". (End)
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
Max Alekseyev, Proof of Paul Hanna's formula.
D. R. Hofstadter, Eta-Lore. [Cached copy, with permission]
D. R. Hofstadter, Pi-Mu Sequences. [Cached copy, with permission]
D. R. Hofstadter and N. J. A. Sloane, Correspondence, 1977 and 1991.
FORMULA
It seems that A006336 can be generated by a rule using the golden ratio phi: a(n) = a(n-1) + a([n/Phi]) for n>1 with a(1)=1 where phi = (sqrt(5)+1)/2, I.e. the number of even terms up to position n-1 equals n-1 - [n/Phi] for n>1 where Phi = (sqrt(5)+1)/2. (This is true - see the Alekseyev link.) - Paul D. Hanna, Jul 22 2007
MAPLE
# Maple code for first M terms of a(n) and A060144, from N. J. A. Sloane, Oct 25 2014
M:=100;
v[1]:=1; v[2]:=2; w[1]:=0; w[2]:=1;
for n from 3 to M do
v[n]:=v[n-1]+v[n-1-w[n-1]];
if v[n] mod 2 = 0 then w[n]:=w[n-1]+1 else w[n]:=w[n-1]; fi; od:
[seq(v[n], n=1..M)]; # A006336
[seq(w[n], n=1..M)]; # A060144 shifted
MATHEMATICA
a[n_Integer] := a[n] = Block[{c, k}, c = 0; k = 1; While[k < n, If[ EvenQ[ a[k] ], c++ ]; k++ ]; Return[a[n - 1] + a[n - 1 - c] ] ]; a[1] = 1; a[2] = 2; Table[ a[n], {n, 0, 60} ]
PROG
(PARI) A006336(N=99) = local(a=vector(N, i, 1), e=0); for(n=2, #a, e+=0==(a[n]=a[n-1]+a[n-1-e])%2); a \\ M. F. Hasler, Jul 23 2007
(Haskell)
a006336 n = a006336_list !! (n-1)
a006336_list = 1 : h 2 1 0 where
h n last evens = x : h (n + 1) x (evens + 1 - x `mod` 2) where
x = last + a006336 (n - 1 - evens)
-- Reinhard Zumkeller, May 18 2011
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
D. R. Hofstadter, Jul 15 1977
EXTENSIONS
More terms from Robert G. Wilson v, Mar 07 2001
Entry revised by N. J. A. Sloane, Oct 25 2014
STATUS
approved